aboutsummaryrefslogtreecommitdiff
path: root/sys/i386/include/db_machdep.h
diff options
context:
space:
mode:
authorMarcel Moolenaar <marcel@FreeBSD.org>2004-07-10 23:47:20 +0000
committerMarcel Moolenaar <marcel@FreeBSD.org>2004-07-10 23:47:20 +0000
commit37224cd3fcb911d440e40dd8e1f31652e2452537 (patch)
tree533bc344dcaf70d30b9a52c0dc5327488516647b /sys/i386/include/db_machdep.h
parent5971a234e5b07f66372970c407b8085d6ad7904e (diff)
downloadsrc-37224cd3fcb911d440e40dd8e1f31652e2452537.tar.gz
src-37224cd3fcb911d440e40dd8e1f31652e2452537.zip
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.
Notes
Notes: svn path=/head/; revision=131952
Diffstat (limited to 'sys/i386/include/db_machdep.h')
-rw-r--r--sys/i386/include/db_machdep.h17
1 files changed, 5 insertions, 12 deletions
diff --git a/sys/i386/include/db_machdep.h b/sys/i386/include/db_machdep.h
index ba84fc6834e8..6922908bc81e 100644
--- a/sys/i386/include/db_machdep.h
+++ b/sys/i386/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 i386_saved_state trapframe
-
typedef vm_offset_t db_addr_t; /* address - unsigned */
typedef int db_expr_t; /* expression - signed */
-typedef struct i386_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_eip)
+#define PC_REGS() ((db_addr_t)kdb_thrctx->pcb_eip)
#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_eip += 1
+#define BKPT_SKIP kdb_frame->tf_eip += 1
-#define FIXUP_PC_AFTER_BREAK ddb_regs.tf_eip -= 1;
+#define FIXUP_PC_AFTER_BREAK kdb_frame->tf_eip -= 1;
-#define db_clear_single_step(regs) ((regs)->tf_eflags &= ~PSL_T)
-#define db_set_single_step(regs) ((regs)->tf_eflags |= 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)
/*