aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/kdb.h
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2012-04-12 17:43:59 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2012-04-12 17:43:59 +0000
commit0cc457b000ffb0d0d67cfb71278995435996fe94 (patch)
tree26b9e2e550fbe63d131bb05f09fe4a80cd0e9c8c /sys/sys/kdb.h
parent6ad07d53c25f5460906eee407d5ea742846b11fb (diff)
downloadsrc-0cc457b000ffb0d0d67cfb71278995435996fe94.tar.gz
src-0cc457b000ffb0d0d67cfb71278995435996fe94.zip
- Extend the KDB interface to add a per-debugger callback to print a
backtrace for an arbitrary thread (rather than the calling thread). A kdb_backtrace_thread() wrapper function uses the configured debugger if possible, otherwise it falls back to using stack(9) if that is available. - Replace a direct call to db_trace_thread() in propagate_priority() with a call to kdb_backtrace_thread() instead. MFC after: 1 week
Notes
Notes: svn path=/head/; revision=234190
Diffstat (limited to 'sys/sys/kdb.h')
-rw-r--r--sys/sys/kdb.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/sys/kdb.h b/sys/sys/kdb.h
index 61ee0973eb14..1c0bf06569ac 100644
--- a/sys/sys/kdb.h
+++ b/sys/sys/kdb.h
@@ -31,31 +31,34 @@
#include <machine/setjmp.h>
+struct pcb;
+struct thread;
+struct trapframe;
+
typedef int dbbe_init_f(void);
typedef void dbbe_trace_f(void);
+typedef void dbbe_trace_thread_f(struct thread *);
typedef int dbbe_trap_f(int, int);
struct kdb_dbbe {
const char *dbbe_name;
dbbe_init_f *dbbe_init;
dbbe_trace_f *dbbe_trace;
+ dbbe_trace_thread_f *dbbe_trace_thread;
dbbe_trap_f *dbbe_trap;
int dbbe_active;
};
-#define KDB_BACKEND(name, init, trace, trap) \
+#define KDB_BACKEND(name, init, trace, trace_thread, trap) \
static struct kdb_dbbe name##_dbbe = { \
.dbbe_name = #name, \
.dbbe_init = init, \
.dbbe_trace = trace, \
+ .dbbe_trace_thread = trace_thread, \
.dbbe_trap = trap \
}; \
DATA_SET(kdb_dbbe_set, name##_dbbe)
-struct pcb;
-struct thread;
-struct trapframe;
-
extern int kdb_active; /* Non-zero while in debugger. */
extern int debugger_on_panic; /* enter the debugger on panic. */
extern struct kdb_dbbe *kdb_dbbe; /* Default debugger backend or NULL. */
@@ -67,6 +70,7 @@ int kdb_alt_break(int, int *);
int kdb_alt_break_gdb(int, int *);
int kdb_break(void);
void kdb_backtrace(void);
+void kdb_backtrace_thread(struct thread *);
int kdb_dbbe_select(const char *);
void kdb_enter(const char *, const char *);
void kdb_init(void);