summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include/db_machdep.h
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/amd64/include/db_machdep.h
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/amd64/include/db_machdep.h')
-rw-r--r--sys/amd64/include/db_machdep.h17
1 files changed, 5 insertions, 12 deletions
diff --git a/sys/amd64/include/db_machdep.h b/sys/amd64/include/db_machdep.h
index 18b5e5d..0a737eb 100644
--- a/sys/amd64/include/db_machdep.h
+++ b/sys/amd64/include/db_machdep.h
@@ -30,30 +30,23 @@
#define _MACHINE_DB_MACHDEP_H_
#include <machine/frame.h>
-#include <machine/psl.h>
#include <machine/trap.h>
-#define amd64_saved_state trapframe
-
typedef vm_offset_t db_addr_t; /* address - unsigned */
typedef long db_expr_t; /* expression - signed */
-typedef struct amd64_saved_state db_regs_t;
-extern db_regs_t ddb_regs; /* register state */
-#define DDB_REGS (&ddb_regs)
-
-#define PC_REGS(regs) ((db_addr_t)(regs)->tf_rip)
+#define PC_REGS() ((db_addr_t)kdb_thrctx->pcb_rip)
#define BKPT_INST 0xcc /* breakpoint instruction */
#define BKPT_SIZE (1) /* size of breakpoint inst */
#define BKPT_SET(inst) (BKPT_INST)
-#define BKPT_SKIP ddb_regs.tf_rip += 1
+#define BKPT_SKIP kdb_frame->tf_rip += 1
-#define FIXUP_PC_AFTER_BREAK ddb_regs.tf_rip -= 1;
+#define FIXUP_PC_AFTER_BREAK kdb_frame->tf_rip -= 1;
-#define db_clear_single_step(regs) ((regs)->tf_rflags &= ~PSL_T)
-#define db_set_single_step(regs) ((regs)->tf_rflags |= PSL_T)
+#define db_clear_single_step kdb_cpu_clear_singlestep
+#define db_set_single_step kdb_cpu_set_singlestep
#define IS_BREAKPOINT_TRAP(type, code) ((type) == T_BPTFLT)
/*
OpenPOWER on IntegriCloud