diff options
author | cognet <cognet@FreeBSD.org> | 2004-11-21 18:11:39 +0000 |
---|---|---|
committer | cognet <cognet@FreeBSD.org> | 2004-11-21 18:11:39 +0000 |
commit | 22b168ab2449334b15b55b276945245bb1660a9d (patch) | |
tree | df736a61622aa96c6e0acdf37b6a2125c736826d /sys/arm/include | |
parent | 774795721abcc723b01400a6ab6a346139fcd6b8 (diff) | |
download | FreeBSD-src-22b168ab2449334b15b55b276945245bb1660a9d.zip FreeBSD-src-22b168ab2449334b15b55b276945245bb1660a9d.tar.gz |
Implement breakpoints and single stepping on arm.
Obtained from: NetBSD
Diffstat (limited to 'sys/arm/include')
-rw-r--r-- | sys/arm/include/db_machdep.h | 17 | ||||
-rw-r--r-- | sys/arm/include/kdb.h | 2 |
2 files changed, 13 insertions, 6 deletions
diff --git a/sys/arm/include/db_machdep.h b/sys/arm/include/db_machdep.h index f40daa5..0682311 100644 --- a/sys/arm/include/db_machdep.h +++ b/sys/arm/include/db_machdep.h @@ -34,8 +34,6 @@ #include <machine/trap.h> #include <machine/armreg.h> -#define BYTE_MSF (1) - #define T_BREAKPOINT (1) typedef vm_offset_t db_addr_t; typedef int db_expr_t; @@ -50,8 +48,7 @@ typedef int db_expr_t; kdb_frame->tf_pc += BKPT_SIZE; \ } while (0) -#define db_clear_single_step(regs) -#define db_set_single_step(regs) +#define SOFTWARE_SSTEP 1 #define IS_BREAKPOINT_TRAP(type, code) (type == T_BREAKPOINT) #define IS_WATCHPOINT_TRAP(type, code) (0) @@ -65,7 +62,8 @@ typedef int db_expr_t; /* mov pc, reg 0000000f register */ #define inst_return(ins) (((ins) & 0x0e108000) == 0x08108000 || \ - ((ins) & 0x0ff0fff0) == 0x01a0f000) + ((ins) & 0x0ff0fff0) == 0x01a0f000 || \ + ((ins) & 0x0ffffff0) == 0x012fff10) /* bx */ /* bl ... 00ffffff offset>>2 */ #define inst_call(ins) (((ins) & 0x0f000000) == 0x0b000000) @@ -74,14 +72,21 @@ typedef int db_expr_t; /* ldr pc, [pc, reg, lsl #2] 0000000f register */ +#define inst_branch(ins) (((ins) & 0x0f000000) == 0x0a000000 || \ + ((ins) & 0x0fdffff0) == 0x079ff100) #define inst_load(ins) (0) #define inst_store(ins) (0) +#define next_instr_address(pc, bd) ((bd) ? (pc) : ((pc) + INSN_SIZE)) + #define DB_SMALL_VALUE_MAX (0x7fffffff) #define DB_SMALL_VALUE_MIN (-0x40001) -#define DB_ELFSIZE 64 +#define DB_ELFSIZE 32 int db_validate_address(vm_offset_t); + +u_int branch_taken (u_int insn, u_int pc); + #endif /* !_MACHINE_DB_MACHDEP_H_ */ diff --git a/sys/arm/include/kdb.h b/sys/arm/include/kdb.h index ba8b3b9..0adf7e1 100644 --- a/sys/arm/include/kdb.h +++ b/sys/arm/include/kdb.h @@ -31,6 +31,7 @@ #include <machine/frame.h> #include <machine/psl.h> +#include <machine/cpufunc.h> static __inline void kdb_cpu_clear_singlestep(void) @@ -45,6 +46,7 @@ kdb_cpu_set_singlestep(void) static __inline void kdb_cpu_trap(int type, int code) { + cpu_idcache_wbinv_all(); } #endif /* _MACHINE_KDB_H_ */ |