summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2013-10-27 16:20:52 +0000
committerkib <kib@FreeBSD.org>2013-10-27 16:20:52 +0000
commitb385bc7f3120f41d6df5d6fddd109ab27fce9851 (patch)
treedc9f56807d89e4ec4c383766c38ace5b07c6a08b /sys/kern
parenta5afef3ae88a3ec906b42c6b1b99be6d04b8bd95 (diff)
downloadFreeBSD-src-b385bc7f3120f41d6df5d6fddd109ab27fce9851.zip
FreeBSD-src-b385bc7f3120f41d6df5d6fddd109ab27fce9851.tar.gz
When reentering kdb, typically due to a bug causing trap or assert in
the code executed in the context of debugger, do not be ashamed to inform loudly about the re-entry. Also, print the backtrace before obliterating current stack with longjmp, allowing the operator to see a place which caused the bug. The change should make it less mysterious debugging the ddb itself. Sponsored by: The FreeBSD Foundation MFC after: 1 week
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/subr_kdb.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/subr_kdb.c b/sys/kern/subr_kdb.c
index 59d6258..a7ed944 100644
--- a/sys/kern/subr_kdb.c
+++ b/sys/kern/subr_kdb.c
@@ -503,6 +503,8 @@ kdb_reenter(void)
if (!kdb_active || kdb_jmpbufp == NULL)
return;
+ printf("KDB: reentering\n");
+ kdb_backtrace();
longjmp(kdb_jmpbufp, 1);
/* NOTREACHED */
}
OpenPOWER on IntegriCloud