diff options
author | kib <kib@FreeBSD.org> | 2006-11-06 11:10:57 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2006-11-06 11:10:57 +0000 |
commit | d5b214bf2a8c7581087d53e86dfa2242cb572da8 (patch) | |
tree | 13df7fc93b7c7e9215f751d4578ccc66e3432d6a /sys | |
parent | 571eb96dc650429a7f821588890b99411559c8d6 (diff) | |
download | FreeBSD-src-d5b214bf2a8c7581087d53e86dfa2242cb572da8.zip FreeBSD-src-d5b214bf2a8c7581087d53e86dfa2242cb572da8.tar.gz |
Set up the context for the dbbe_trace callback in the ddb. Otherwise,
trap caused by backtracing would lead to panic.
Noted and reviewed by: bde
Diffstat (limited to 'sys')
-rw-r--r-- | sys/ddb/db_main.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/ddb/db_main.c b/sys/ddb/db_main.c index d047aeb..c196bf7 100644 --- a/sys/ddb/db_main.c +++ b/sys/ddb/db_main.c @@ -47,8 +47,9 @@ __FBSDID("$FreeBSD$"); static dbbe_init_f db_init; static dbbe_trap_f db_trap; +static dbbe_trace_f db_trace_self_wrapper; -KDB_BACKEND(ddb, db_init, db_trace_self, db_trap); +KDB_BACKEND(ddb, db_init, db_trace_self_wrapper, db_trap); vm_offset_t ksym_start, ksym_end; @@ -226,3 +227,15 @@ db_trap(int type, int code) return (1); } + +static void +db_trace_self_wrapper(void) +{ + jmp_buf jb; + void *prev_jb; + + prev_jb = kdb_jmpbuf(jb); + if (setjmp(jb) == 0) + db_trace_self(); + (void)kdb_jmpbuf(prev_jb); +} |