]> err.no Git - linux-2.6/commitdiff
MN10300: Make the kernel jump into gdbstub on a BUG
authorDavid Howells <dhowells@redhat.com>
Tue, 19 Feb 2008 18:58:59 +0000 (18:58 +0000)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 19 Feb 2008 23:51:36 +0000 (15:51 -0800)
Make the kernel jump into gdbstub (if configured) on a BUG with the register
set from the BUG rather than interpolating another illegal instruction and
leaving gdbstub's idea of the process counter in unsupported_syscall() where
the original BUG was detected.

With this patch, gdbstub reports a SIGABRT to the compiler and reports the
program counter at the original BUG, allowing the execution state at the time
of the BUG to be examined with GDB.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/mn10300/kernel/traps.c

index 8b9dc6d9dcc6e34e555deccc7d1fb594b4a8ac9e..fcb9a03d46a8a33212b852354b9928b9c575a6e0 100644 (file)
@@ -391,7 +391,7 @@ static asmlinkage void unsupported_syscall(struct pt_regs *regs,
        if (code == EXCEP_SYSCALL15 && !user_mode(regs)) {
                if (report_bug(regs->pc, regs) == BUG_TRAP_TYPE_BUG) {
 #ifdef CONFIG_GDBSTUB
-                       __gdbstub_bug_trap();
+                       gdbstub_intercept(regs, code);
 #endif
                }
        }