On Mon, 27 Dec 2004 13:51:04 +0100, 
Max Kellermann <[EMAIL PROTECTED]> wrote:
>Hi,
>
>I tried the new KDB 4.4 release for kernel 2.6.10, on x86. I enabled
>both KDB and kprobes:
>
>  CC      arch/i386/kernel/traps.o
>arch/i386/kernel/traps.c:796: error: conflicting types for 'do_int3'
>arch/i386/kernel/traps.c:677: error: previous definition of 'do_int3'
>was here
>make[2]: *** [arch/i386/kernel/traps.o] Error 1
>
>.. both of them define the function do_int3(). Disabling kprobes
>solved my problem, although I'd like to have both.

Apply this kludge over kdb-v4.4-2.6.10-i386-1.  I plan to convert kdb
into the notify_die model "soon", which will remove these conflicts.


Index: linux/arch/i386/kernel/traps.c
===================================================================
--- linux.orig/arch/i386/kernel/traps.c 2004-12-25 20:29:52.000000000 +1100
+++ linux/arch/i386/kernel/traps.c      2004-12-28 00:56:14.000000000 +1100
@@ -675,6 +675,10 @@ void unset_nmi_callback(void)
 #ifdef CONFIG_KPROBES
 fastcall int do_int3(struct pt_regs *regs, long error_code)
 {
+#ifdef CONFIG_KDB
+       if (kdb(KDB_REASON_BREAK, error_code, regs))
+               return 0;
+#endif
        if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP)
                        == NOTIFY_STOP)
                return 1;
@@ -791,14 +795,15 @@ clear_TF:
        return;
 }
 
-#ifdef CONFIG_KDB
-fastcall void do_int3(struct pt_regs * regs, long error_code)
+#if    defined(CONFIG_KDB) && !defined(CONFIG_KPROBES)
+fastcall int do_int3(struct pt_regs *regs, long error_code)
 {
        if (kdb(KDB_REASON_BREAK, error_code, regs))
-               return;
+               return 0;
        do_trap(3, SIGTRAP, "int3", 1, regs, error_code, NULL);
+       return 0;
 }
-#endif /* CONFIG_KDB */
+#endif /* CONFIG_KDB && !CONFIG_KPROBES */
 
 
 /*

---------------------------
Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe.

Reply via email to