diff options
author | jhb <jhb@FreeBSD.org> | 2012-04-12 21:34:58 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2012-04-12 21:34:58 +0000 |
commit | 4b63f702b77fee250d25c5caf39cd7a770789f07 (patch) | |
tree | 9a308890763595a81138aaa654405f0a9a54be0e /sys/ddb/db_main.c | |
parent | 02e8925eaaadc72af91ad69199fbca1d57fadec5 (diff) | |
download | FreeBSD-src-4b63f702b77fee250d25c5caf39cd7a770789f07.zip FreeBSD-src-4b63f702b77fee250d25c5caf39cd7a770789f07.tar.gz |
Update the ddb and gdb backends for the new 'trace_thread' hook.
It is implemented via db_trace_thread() for DDB and not implemented
for GDB. This should have been part of r234190.
Pointy hat to: jhb
Reported by: jkim
MFC after: 1 week
Diffstat (limited to 'sys/ddb/db_main.c')
-rw-r--r-- | sys/ddb/db_main.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sys/ddb/db_main.c b/sys/ddb/db_main.c index 8375108..6e9286c 100644 --- a/sys/ddb/db_main.c +++ b/sys/ddb/db_main.c @@ -51,8 +51,10 @@ SYSCTL_NODE(_debug, OID_AUTO, ddb, CTLFLAG_RW, 0, "DDB settings"); static dbbe_init_f db_init; static dbbe_trap_f db_trap; static dbbe_trace_f db_trace_self_wrapper; +static dbbe_trace_thread_f db_trace_thread_wrapper; -KDB_BACKEND(ddb, db_init, db_trace_self_wrapper, db_trap); +KDB_BACKEND(ddb, db_init, db_trace_self_wrapper, db_trace_thread_wrapper, + db_trap); vm_offset_t ksym_start, ksym_end; @@ -246,3 +248,15 @@ db_trace_self_wrapper(void) db_trace_self(); (void)kdb_jmpbuf(prev_jb); } + +static void +db_trace_thread_wrapper(struct thread *td) +{ + jmp_buf jb; + void *prev_jb; + + prev_jb = kdb_jmpbuf(jb); + if (setjmp(jb) == 0) + db_trace_thread(td, -1); + (void)kdb_jmpbuf(prev_jb); +} |