diff options
author | avg <avg@FreeBSD.org> | 2010-09-21 15:07:44 +0000 |
---|---|---|
committer | avg <avg@FreeBSD.org> | 2010-09-21 15:07:44 +0000 |
commit | fe208ba09513af099f5dc6f4602814ccba69a10e (patch) | |
tree | e9c53997dce3661f9207d6f81d5e15d2c3d4b0e8 | |
parent | 619042c66828607943b3c5c67d134062a5c6759d (diff) | |
download | FreeBSD-src-fe208ba09513af099f5dc6f4602814ccba69a10e.zip FreeBSD-src-fe208ba09513af099f5dc6f4602814ccba69a10e.tar.gz |
kdb_backtrace: stack(9)-based code to print backtrace without any backend
The idea is to add KDB and KDB_TRACE options to GENERIC kernels on
stable branches, so that at least the minimal information is produced
for non-specific panics like traps on page faults.
The GENERICs in stable branches seem to already include STACK option.
Reviewed by: attilio
MFC after: 2 weeks
-rw-r--r-- | sys/kern/subr_kdb.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/kern/subr_kdb.c b/sys/kern/subr_kdb.c index 2a59503..963d0ed 100644 --- a/sys/kern/subr_kdb.c +++ b/sys/kern/subr_kdb.c @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include "opt_kdb.h" +#include "opt_stack.h" #include <sys/param.h> #include <sys/systm.h> @@ -37,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include <sys/pcpu.h> #include <sys/proc.h> #include <sys/smp.h> +#include <sys/stack.h> #include <sys/sysctl.h> #include <machine/kdb.h> @@ -300,6 +302,15 @@ kdb_backtrace(void) printf("KDB: stack backtrace:\n"); kdb_dbbe->dbbe_trace(); } +#ifdef STACK + else { + struct stack st; + + printf("KDB: stack backtrace:\n"); + stack_save(&st); + stack_print(&st); + } +#endif } /* |