diff options
author | kib <kib@FreeBSD.org> | 2012-10-14 17:09:50 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2012-10-14 17:09:50 +0000 |
commit | 447841289e863ece63179fcce37c1301ca66b6b4 (patch) | |
tree | 5c54adab166f4dc8a3a99b907efa65d76e3ffc19 /sys/i386 | |
parent | 36119706ad59915a02e5dbf18b71ace3ead21a6c (diff) | |
download | FreeBSD-src-447841289e863ece63179fcce37c1301ca66b6b4.zip FreeBSD-src-447841289e863ece63179fcce37c1301ca66b6b4.tar.gz |
MFamd64: add machdep.uprintf_signal.
MFC after: 1 week
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/i386/trap.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c index 7536f11..b7ce91d 100644 --- a/sys/i386/i386/trap.c +++ b/sys/i386/i386/trap.c @@ -195,6 +195,10 @@ TUNABLE_INT("machdep.panic_on_nmi", &panic_on_nmi); 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. @@ -761,6 +765,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 |