mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Randy.Dunlap" <rdunlap@xenotime.net>
To: Andrew Morton <akpm@osdl.org>
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: [PATCH -mm] i386: print EIP/ESP last [refresh]
Date: Sun, 2 Apr 2006 10:26:07 -0700	[thread overview]
Message-ID: <20060402102607.e06ca375.rdunlap@xenotime.net> (raw)
In-Reply-To: <20060401222629.56527533.akpm@osdl.org>

From: Randy Dunlap <rdunlap@xenotime.net>

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>
---
 arch/i386/kernel/traps.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletion(-)

--- linux-2616-mm2.orig/arch/i386/kernel/traps.c
+++ linux-2616-mm2/arch/i386/kernel/traps.c
@@ -398,6 +398,9 @@ void die(const char * str, struct pt_reg
 
 	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
@@ -430,8 +433,19 @@ void die(const char * str, struct pt_reg
 	 	check_remote_debug(0,SIGTRAP,err,regs,)
 		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



---

      parent reply	other threads:[~2006-04-02 17:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-31  7:09 [PATCH -mm] i386: print EIP/ESP last Randy.Dunlap
     [not found] ` <20060401222629.56527533.akpm@osdl.org>
2006-04-02 17:26   ` Randy.Dunlap [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060402102607.e06ca375.rdunlap@xenotime.net \
    --to=rdunlap@xenotime.net \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®