[Midnightbsd-cvs] src [8233] trunk/sys/i386/i386/trap.c: add machdep.uprintf_signal

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sat Sep 17 17:24:37 EDT 2016


Revision: 8233
          http://svnweb.midnightbsd.org/src/?rev=8233
Author:   laffer1
Date:     2016-09-17 17:24:37 -0400 (Sat, 17 Sep 2016)
Log Message:
-----------
add machdep.uprintf_signal

Modified Paths:
--------------
    trunk/sys/i386/i386/trap.c

Modified: trunk/sys/i386/i386/trap.c
===================================================================
--- trunk/sys/i386/i386/trap.c	2016-09-17 21:24:16 UTC (rev 8232)
+++ trunk/sys/i386/i386/trap.c	2016-09-17 21:24:37 UTC (rev 8233)
@@ -195,6 +195,10 @@
 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 @@
 	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



More information about the Midnightbsd-cvs mailing list