summaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel/traps.c
diff options
context:
space:
mode:
authorRandy Dunlap <rdunlap@xenotime.net>2006-04-10 22:53:11 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-04-11 06:18:33 -0700
commit7bee5c0fd2b25d185650cbfa049823e03f648c09 (patch)
treef0937f3d2ce67cee54ad8a81d7a6628e21d8e955 /arch/i386/kernel/traps.c
parent6cf272acd59e4e7a17b969adcdf413e15754bfe4 (diff)
downloadblackbird-op-linux-7bee5c0fd2b25d185650cbfa049823e03f648c09.tar.gz
blackbird-op-linux-7bee5c0fd2b25d185650cbfa049823e03f648c09.zip
[PATCH] i386: print EIP/ESP last
Print summary registers (EIP and SS:ESP only) as last death info. This makes this important data visible in case it had scrolled off the top of the display. Similar to what x86_64 does. Suggested by Andi Kleen. Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/i386/kernel/traps.c')
-rw-r--r--arch/i386/kernel/traps.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c
index e38527994590..2d22f5761b1d 100644
--- a/arch/i386/kernel/traps.c
+++ b/arch/i386/kernel/traps.c
@@ -365,6 +365,9 @@ void die(const char * str, struct pt_regs * regs, long err)
if (++die.lock_owner_depth < 3) {
int nl = 0;
+ unsigned long esp;
+ unsigned short ss;
+
handle_BUG(regs);
printk(KERN_EMERG "%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter);
#ifdef CONFIG_PREEMPT
@@ -387,8 +390,19 @@ void die(const char * str, struct pt_regs * regs, long err)
printk("\n");
if (notify_die(DIE_OOPS, str, regs, err,
current->thread.trap_no, SIGSEGV) !=
- NOTIFY_STOP)
+ NOTIFY_STOP) {
show_registers(regs);
+ /* Executive summary in case the oops scrolled away */
+ esp = (unsigned long) (&regs->esp);
+ savesegment(ss, ss);
+ if (user_mode(regs)) {
+ esp = regs->esp;
+ ss = regs->xss & 0xffff;
+ }
+ printk(KERN_EMERG "EIP: [<%08lx>] ", regs->eip);
+ print_symbol("%s", regs->eip);
+ printk(" SS:ESP %04x:%08lx\n", ss, esp);
+ }
else
regs = NULL;
} else
OpenPOWER on IntegriCloud