diff options
author | jake <jake@FreeBSD.org> | 2002-06-08 07:36:28 +0000 |
---|---|---|
committer | jake <jake@FreeBSD.org> | 2002-06-08 07:36:28 +0000 |
commit | c7a429349cd87c0ef6f3a43c9391eee8662df650 (patch) | |
tree | 970168df6db9104b53bced8acebef8b1487c3f05 /sys/sparc64 | |
parent | 75c335726c3d324435eb9a5d3ab9b529ec21b061 (diff) | |
download | FreeBSD-src-c7a429349cd87c0ef6f3a43c9391eee8662df650.zip FreeBSD-src-c7a429349cd87c0ef6f3a43c9391eee8662df650.tar.gz |
Add code to drop to ddb when a process gets a fatal signal that usually
suggests kernel bugs (4, 10, 11). Add a sysctl debug.debugger_on_signal
which turns this on and off, default off.
Diffstat (limited to 'sys/sparc64')
-rw-r--r-- | sys/sparc64/sparc64/trap.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/sparc64/sparc64/trap.c b/sys/sparc64/sparc64/trap.c index da03096..289b8cf 100644 --- a/sys/sparc64/sparc64/trap.c +++ b/sys/sparc64/sparc64/trap.c @@ -45,6 +45,7 @@ #include "opt_ktrace.h" #include <sys/param.h> +#include <sys/kernel.h> #include <sys/bus.h> #include <sys/interrupt.h> #include <sys/ktr.h> @@ -55,6 +56,7 @@ #include <sys/proc.h> #include <sys/smp.h> #include <sys/syscall.h> +#include <sys/sysctl.h> #include <sys/sysent.h> #include <sys/user.h> #include <sys/vmmeter.h> @@ -147,6 +149,10 @@ const char *trap_msg[] = { "kernel stack fault", }; +int debugger_on_signal = 0; +SYSCTL_INT(_debug, OID_AUTO, debugger_on_signal, CTLFLAG_RW, + &debugger_on_signal, 0, ""); + void trap(struct trapframe *tf) { @@ -373,6 +379,8 @@ trapsig: /* Translate fault for emulators. */ if (p->p_sysent->sv_transtrap != NULL) sig = (p->p_sysent->sv_transtrap)(sig, type); + if (debugger_on_signal && (sig == 4 || sig == 10 || sig == 11)) + Debugger("trapsig"); trapsignal(p, sig, ucode); user: userret(td, tf, sticks); |