diff options
author | msmith <msmith@FreeBSD.org> | 1998-12-28 23:03:00 +0000 |
---|---|---|
committer | msmith <msmith@FreeBSD.org> | 1998-12-28 23:03:00 +0000 |
commit | 981941d4060eac90f2a4487b0b968ccccc1aa9aa (patch) | |
tree | 01bd1afc7e6da245f5ace02fd85aaa4a9d0ff2cb /sys/kern/subr_trap.c | |
parent | 448471aa29ad0e51620b7b82116fd6d0b5453c3b (diff) | |
download | FreeBSD-src-981941d4060eac90f2a4487b0b968ccccc1aa9aa.zip FreeBSD-src-981941d4060eac90f2a4487b0b968ccccc1aa9aa.tar.gz |
Improved DDB_UNATTENDED behaviour. From the submitter:
There's something that's been bugging me for a while, so I decided to fix it.
FreeBSD now will DTRT WRT DDB and DDB_UNATTENDED (!debugger_on_panic), at least
in my opinion. The behavior change is such that:
1. Nothing changes when debugger_on_panic != 0.
2. When DDB_UNATTENDED (!debugger_on_panic), if a panic occurs, the
machine will reboot. Also, if a trap occurs, the machine will
panic and reboot, unlike how it broke to DDB before. HOWEVER,
a trap inside DDB will not cause a panic, allowing full use
of DDB without having to worry about the machine being stuck
at a DDB prompt if something goes wrong during the day.
Patches for this behavior follow my signature, and it would
be a boon to anyone (like me) who uses DDB_UNATTENDED, but
actually wants the machine to panic on a trap (otherwise,
what's the use, if the machine causes a fatal trap rather than
a true panic, of debugger_on_panic?). The changes cause no
adverse behavior, but do involve two symbols becoming global
Submitted by: Brian Feldman <green@unixhelp.org>
Diffstat (limited to 'sys/kern/subr_trap.c')
-rw-r--r-- | sys/kern/subr_trap.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c index 3d35483..e672368 100644 --- a/sys/kern/subr_trap.c +++ b/sys/kern/subr_trap.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)trap.c 7.4 (Berkeley) 5/13/91 - * $Id: trap.c,v 1.130 1998/12/06 00:03:30 archie Exp $ + * $Id: trap.c,v 1.131 1998/12/16 15:21:50 bde Exp $ */ /* @@ -93,6 +93,10 @@ #include <machine/vm86.h> #endif +#ifdef DDB + extern int in_Debugger, debugger_on_panic; +#endif + #include "isa.h" #include "npx.h" @@ -901,7 +905,7 @@ trap_fatal(frame, eva) return; #endif #ifdef DDB - if (kdb_trap (type, 0, frame)) + if ((debugger_on_panic || in_Debugger) && kdb_trap(type, 0, frame)) return; #endif printf("trap number = %d\n", type); |