From c2a445910d15c856f068b5b8f3f58c3ecd99a3df Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Sun, 27 Oct 2013 16:20:52 +0000 Subject: [PATCH] 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 --- sys/kern/subr_kdb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/kern/subr_kdb.c b/sys/kern/subr_kdb.c index 59d6258bad76..a7ed944a61fb 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 */ }