summaryrefslogtreecommitdiffstats
path: root/sys/ddb/db_print.c
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2004-07-10 23:47:20 +0000
committermarcel <marcel@FreeBSD.org>2004-07-10 23:47:20 +0000
commitaae5483213805c645aad67985fa4f638d6e34915 (patch)
tree533bc344dcaf70d30b9a52c0dc5327488516647b /sys/ddb/db_print.c
parent1dca995d693b9df1e65a294b6385cc1d442233b1 (diff)
downloadFreeBSD-src-aae5483213805c645aad67985fa4f638d6e34915.zip
FreeBSD-src-aae5483213805c645aad67985fa4f638d6e34915.tar.gz
Mega update for the KDB framework: turn DDB into a KDB backend.
Most of the changes are a direct result of adding thread awareness. Typically, DDB_REGS is gone. All registers are taken from the trapframe and backtraces use the PCB based contexts. DDB_REGS was defined to be a trapframe on all platforms anyway. Thread awareness introduces the following new commands: thread X switch to thread X (where X is the TID), show threads list all threads. The backtrace code has been made more flexible so that one can create backtraces for any thread by giving the thread ID as an argument to trace. With this change, ia64 has support for breakpoints.
Diffstat (limited to 'sys/ddb/db_print.c')
-rw-r--r--sys/ddb/db_print.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/sys/ddb/db_print.c b/sys/ddb/db_print.c
index 60282ad..b173c8c 100644
--- a/sys/ddb/db_print.c
+++ b/sys/ddb/db_print.c
@@ -37,33 +37,33 @@
__FBSDID("$FreeBSD$");
#include <sys/param.h>
+#include <sys/kdb.h>
+
+#include <machine/pcb.h>
#include <ddb/ddb.h>
#include <ddb/db_variables.h>
#include <ddb/db_sym.h>
void
-db_show_regs(dummy1, dummy2, dummy3, dummy4)
- db_expr_t dummy1;
- boolean_t dummy2;
- db_expr_t dummy3;
- char * dummy4;
+db_show_regs(db_expr_t _1, boolean_t _2, db_expr_t _3, char *_4)
{
- register struct db_variable *regp;
- db_expr_t value, offset;
- const char * name;
+ struct db_variable *regp;
+ db_expr_t value, offset;
+ const char *name;
for (regp = db_regs; regp < db_eregs; regp++) {
- db_read_variable(regp, &value);
- db_printf("%-12s%#10lr", regp->name, (unsigned long)value);
- db_find_xtrn_sym_and_offset((db_addr_t)value, &name, &offset);
- if (name != NULL && offset <= (unsigned long)db_maxoff &&
- offset != value) {
- db_printf("\t%s", name);
- if (offset != 0)
- db_printf("+%+#lr", (long)offset);
- }
- db_printf("\n");
+ if (!db_read_variable(regp, &value))
+ continue;
+ db_printf("%-12s%#10lr", regp->name, (unsigned long)value);
+ db_find_xtrn_sym_and_offset((db_addr_t)value, &name, &offset);
+ if (name != NULL && offset <= (unsigned long)db_maxoff &&
+ offset != value) {
+ db_printf("\t%s", name);
+ if (offset != 0)
+ db_printf("+%+#lr", (long)offset);
+ }
+ db_printf("\n");
}
- db_print_loc_and_inst(PC_REGS(DDB_REGS));
+ db_print_loc_and_inst(PC_REGS());
}
OpenPOWER on IntegriCloud