Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Oct 2012 12:17:22 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r241811 - stable/9/sys/i386/i386
Message-ID:  <201210211217.q9LCHMjM072225@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Sun Oct 21 12:17:22 2012
New Revision: 241811
URL: http://svn.freebsd.org/changeset/base/241811

Log:
  MFC r241550:
  MFamd64: add machdep.uprintf_signal.

Modified:
  stable/9/sys/i386/i386/trap.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/i386/i386/trap.c
==============================================================================
--- stable/9/sys/i386/i386/trap.c	Sun Oct 21 12:15:58 2012	(r241810)
+++ stable/9/sys/i386/i386/trap.c	Sun Oct 21 12:17:22 2012	(r241811)
@@ -195,6 +195,10 @@ TUNABLE_INT("machdep.panic_on_nmi", &pan
 static int prot_fault_translation = 0;
 SYSCTL_INT(_machdep, OID_AUTO, prot_fault_translation, CTLFLAG_RW,
 	&prot_fault_translation, 0, "Select signal to deliver on protection fault");
+static int uprintf_signal;
+SYSCTL_INT(_machdep, OID_AUTO, uprintf_signal, CTLFLAG_RW,
+    &uprintf_signal, 0,
+    "Print debugging information on trap signal to ctty");
 
 /*
  * Exception, fault, and trap interface to the FreeBSD kernel.
@@ -760,6 +764,21 @@ trap(struct trapframe *frame)
 	ksi.ksi_code = ucode;
 	ksi.ksi_addr = (void *)addr;
 	ksi.ksi_trapno = type;
+	if (uprintf_signal) {
+		uprintf("pid %d comm %s: signal %d err %x code %d type %d "
+		    "addr 0x%x eip 0x%08x "
+		    "<%02x %02x %02x %02x %02x %02x %02x %02x>\n",
+		    p->p_pid, p->p_comm, i, frame->tf_err, ucode, type, addr,
+		    frame->tf_eip,
+		    fubyte((void *)(frame->tf_eip + 0)),
+		    fubyte((void *)(frame->tf_eip + 1)),
+		    fubyte((void *)(frame->tf_eip + 2)),
+		    fubyte((void *)(frame->tf_eip + 3)),
+		    fubyte((void *)(frame->tf_eip + 4)),
+		    fubyte((void *)(frame->tf_eip + 5)),
+		    fubyte((void *)(frame->tf_eip + 6)),
+		    fubyte((void *)(frame->tf_eip + 7)));
+	}
 	trapsignal(td, &ksi);
 
 #ifdef DEBUG



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210211217.q9LCHMjM072225>