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
This commit is contained in:
kib 2006-11-06 11:10:57 +00:00
parent 571eb96dc6
commit d5b214bf2a

View File

@ -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);
}