Commit 7bee5c0f authored by Randy Dunlap's avatar Randy Dunlap Committed by Linus Torvalds

[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: default avatarRandy Dunlap <rdunlap@xenotime.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 6cf272ac
...@@ -365,6 +365,9 @@ void die(const char * str, struct pt_regs * regs, long err) ...@@ -365,6 +365,9 @@ void die(const char * str, struct pt_regs * regs, long err)
if (++die.lock_owner_depth < 3) { if (++die.lock_owner_depth < 3) {
int nl = 0; int nl = 0;
unsigned long esp;
unsigned short ss;
handle_BUG(regs); handle_BUG(regs);
printk(KERN_EMERG "%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter); printk(KERN_EMERG "%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter);
#ifdef CONFIG_PREEMPT #ifdef CONFIG_PREEMPT
...@@ -387,8 +390,19 @@ void die(const char * str, struct pt_regs * regs, long err) ...@@ -387,8 +390,19 @@ void die(const char * str, struct pt_regs * regs, long err)
printk("\n"); printk("\n");
if (notify_die(DIE_OOPS, str, regs, err, if (notify_die(DIE_OOPS, str, regs, err,
current->thread.trap_no, SIGSEGV) != current->thread.trap_no, SIGSEGV) !=
NOTIFY_STOP) NOTIFY_STOP) {
show_registers(regs); 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 else
regs = NULL; regs = NULL;
} else } else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment