GDBserver
|
Go to the source code of this file.
Macros | |
#define | TARGET_HAS_DR_LEN_8 (x86_get_debug_register_length () == 8) |
#define | DR_CONTROL_SHIFT 16 |
#define | DR_CONTROL_SIZE 4 |
#define | DR_RW_EXECUTE (0x0) /* Break on instruction execution. */ |
#define | DR_RW_WRITE (0x1) /* Break on data writes. */ |
#define | DR_RW_READ (0x3) /* Break on data reads or writes. */ |
#define | DR_RW_IORW (0x2) /* Break on I/O reads or writes. */ |
#define | DR_LEN_1 (0x0 << 2) /* 1-byte region watch or breakpoint. */ |
#define | DR_LEN_2 (0x1 << 2) /* 2-byte region watch. */ |
#define | DR_LEN_4 (0x3 << 2) /* 4-byte region watch. */ |
#define | DR_LEN_8 (0x2 << 2) /* 8-byte region watch (AMD64). */ |
#define | DR_LOCAL_ENABLE_SHIFT 0 /* Extra shift to the local enable bit. */ |
#define | DR_GLOBAL_ENABLE_SHIFT 1 /* Extra shift to the global enable bit. */ |
#define | DR_ENABLE_SIZE 2 /* Two enable bits per debug register. */ |
#define | DR_LOCAL_SLOWDOWN (0x100) |
#define | DR_GLOBAL_SLOWDOWN (0x200) |
#define | DR_CONTROL_RESERVED (0xFC00) |
#define | X86_DR_CONTROL_MASK (~DR_CONTROL_RESERVED) |
#define | X86_DR_VACANT(state, i) (((state)->dr_control_mirror & (3 << (DR_ENABLE_SIZE * (i)))) == 0) |
#define | X86_DR_LOCAL_ENABLE(state, i) |
#define | X86_DR_GLOBAL_ENABLE(state, i) |
#define | X86_DR_DISABLE(state, i) |
#define | X86_DR_SET_RW_LEN(state, i, rwlen) |
#define | X86_DR_GET_RW_LEN(dr7, i) |
#define | X86_DR_WATCH_HIT(dr6, i) ((dr6) & (1 << (i))) |
Enumerations | |
enum | x86_wp_op_t { WP_INSERT , WP_REMOVE , WP_COUNT } |
Functions | |
static bool | x86_dr_low_can_set_addr () |
static void | x86_dr_low_set_addr (struct x86_debug_reg_state *new_state, int i) |
static CORE_ADDR | x86_dr_low_get_addr (int i) |
static bool | x86_dr_low_can_set_control () |
static void | x86_dr_low_set_control (struct x86_debug_reg_state *new_state) |
static unsigned long | x86_dr_low_get_control () |
static unsigned long | x86_dr_low_get_status () |
static int | x86_get_debug_register_length () |
static void | x86_show_dr (struct x86_debug_reg_state *state, const char *func, CORE_ADDR addr, int len, enum target_hw_bp_type type) |
static unsigned | x86_length_and_rw_bits (int len, enum target_hw_bp_type type) |
static int | x86_insert_aligned_watchpoint (struct x86_debug_reg_state *state, CORE_ADDR addr, unsigned len_rw_bits) |
static int | x86_remove_aligned_watchpoint (struct x86_debug_reg_state *state, CORE_ADDR addr, unsigned len_rw_bits) |
static int | x86_handle_nonaligned_watchpoint (struct x86_debug_reg_state *state, x86_wp_op_t what, CORE_ADDR addr, int len, enum target_hw_bp_type type) |
static void | x86_update_inferior_debug_regs (struct x86_debug_reg_state *state, struct x86_debug_reg_state *new_state) |
int | x86_dr_insert_watchpoint (struct x86_debug_reg_state *state, enum target_hw_bp_type type, CORE_ADDR addr, int len) |
int | x86_dr_remove_watchpoint (struct x86_debug_reg_state *state, enum target_hw_bp_type type, CORE_ADDR addr, int len) |
int | x86_dr_region_ok_for_watchpoint (struct x86_debug_reg_state *state, CORE_ADDR addr, int len) |
int | x86_dr_stopped_data_address (struct x86_debug_reg_state *state, CORE_ADDR *addr_p) |
int | x86_dr_stopped_by_watchpoint (struct x86_debug_reg_state *state) |
int | x86_dr_stopped_by_hw_breakpoint (struct x86_debug_reg_state *state) |
#define DR_CONTROL_RESERVED (0xFC00) |
Definition at line 158 of file x86-dregs.c.
#define DR_CONTROL_SHIFT 16 |
Definition at line 107 of file x86-dregs.c.
#define DR_CONTROL_SIZE 4 |
Definition at line 109 of file x86-dregs.c.
#define DR_ENABLE_SIZE 2 /* Two enable bits per debug register. */ |
Definition at line 143 of file x86-dregs.c.
#define DR_GLOBAL_ENABLE_SHIFT 1 /* Extra shift to the global enable bit. */ |
Definition at line 142 of file x86-dregs.c.
#define DR_GLOBAL_SLOWDOWN (0x200) |
Definition at line 151 of file x86-dregs.c.
#define DR_LEN_1 (0x0 << 2) /* 1-byte region watch or breakpoint. */ |
Definition at line 125 of file x86-dregs.c.
Referenced by x86_length_and_rw_bits().
#define DR_LEN_2 (0x1 << 2) /* 2-byte region watch. */ |
Definition at line 126 of file x86-dregs.c.
Referenced by x86_length_and_rw_bits().
#define DR_LEN_4 (0x3 << 2) /* 4-byte region watch. */ |
Definition at line 127 of file x86-dregs.c.
Referenced by x86_length_and_rw_bits().
#define DR_LEN_8 (0x2 << 2) /* 8-byte region watch (AMD64). */ |
Definition at line 128 of file x86-dregs.c.
Referenced by x86_length_and_rw_bits().
#define DR_LOCAL_ENABLE_SHIFT 0 /* Extra shift to the local enable bit. */ |
Definition at line 141 of file x86-dregs.c.
#define DR_LOCAL_SLOWDOWN (0x100) |
Definition at line 150 of file x86-dregs.c.
Referenced by x86_insert_aligned_watchpoint().
#define DR_RW_EXECUTE (0x0) /* Break on instruction execution. */ |
Definition at line 112 of file x86-dregs.c.
Referenced by x86_length_and_rw_bits().
#define DR_RW_IORW (0x2) /* Break on I/O reads or writes. */ |
Definition at line 120 of file x86-dregs.c.
Referenced by x86_length_and_rw_bits().
#define DR_RW_READ (0x3) /* Break on data reads or writes. */ |
Definition at line 114 of file x86-dregs.c.
Referenced by x86_length_and_rw_bits().
#define DR_RW_WRITE (0x1) /* Break on data writes. */ |
Definition at line 113 of file x86-dregs.c.
Referenced by x86_length_and_rw_bits().
#define TARGET_HAS_DR_LEN_8 (x86_get_debug_register_length () == 8) |
Definition at line 102 of file x86-dregs.c.
Referenced by x86_dr_insert_watchpoint(), x86_dr_remove_watchpoint(), x86_handle_nonaligned_watchpoint(), and x86_length_and_rw_bits().
#define X86_DR_CONTROL_MASK (~DR_CONTROL_RESERVED) |
Definition at line 163 of file x86-dregs.c.
Referenced by x86_insert_aligned_watchpoint().
#define X86_DR_DISABLE | ( | state, | |
i ) |
Definition at line 185 of file x86-dregs.c.
Referenced by x86_remove_aligned_watchpoint().
#define X86_DR_GET_RW_LEN | ( | dr7, | |
i ) |
Definition at line 201 of file x86-dregs.c.
Referenced by x86_dr_stopped_by_hw_breakpoint(), x86_dr_stopped_data_address(), x86_insert_aligned_watchpoint(), and x86_remove_aligned_watchpoint().
#define X86_DR_GLOBAL_ENABLE | ( | state, | |
i ) |
Definition at line 178 of file x86-dregs.c.
#define X86_DR_LOCAL_ENABLE | ( | state, | |
i ) |
Definition at line 171 of file x86-dregs.c.
Referenced by x86_insert_aligned_watchpoint().
#define X86_DR_SET_RW_LEN | ( | state, | |
i, | |||
rwlen ) |
Definition at line 192 of file x86-dregs.c.
Referenced by x86_insert_aligned_watchpoint(), and x86_remove_aligned_watchpoint().
#define X86_DR_VACANT | ( | state, | |
i ) (((state)->dr_control_mirror & (3 << (DR_ENABLE_SIZE * (i)))) == 0) |
Definition at line 167 of file x86-dregs.c.
Referenced by x86_insert_aligned_watchpoint(), x86_remove_aligned_watchpoint(), and x86_update_inferior_debug_regs().
#define X86_DR_WATCH_HIT | ( | dr6, | |
i ) ((dr6) & (1 << (i))) |
Definition at line 206 of file x86-dregs.c.
Referenced by x86_dr_stopped_by_hw_breakpoint(), and x86_dr_stopped_data_address().
enum x86_wp_op_t |
Enumerator | |
---|---|
WP_INSERT | |
WP_REMOVE | |
WP_COUNT |
Definition at line 209 of file x86-dregs.c.
int x86_dr_insert_watchpoint | ( | struct x86_debug_reg_state * | state, |
enum target_hw_bp_type | type, | ||
CORE_ADDR | addr, | ||
int | len ) |
Definition at line 506 of file x86-dregs.c.
References TARGET_HAS_DR_LEN_8, WP_INSERT, x86_handle_nonaligned_watchpoint(), x86_insert_aligned_watchpoint(), x86_length_and_rw_bits(), x86_show_dr(), and x86_update_inferior_debug_regs().
|
static |
Definition at line 40 of file x86-dregs.c.
References x86_dr_low_type::set_addr, and x86_dr_low.
Referenced by x86_insert_aligned_watchpoint().
|
static |
Definition at line 64 of file x86-dregs.c.
References x86_dr_low_type::set_control, and x86_dr_low.
Referenced by x86_insert_aligned_watchpoint().
|
static |
Definition at line 56 of file x86-dregs.c.
References x86_dr_low_type::get_addr, and x86_dr_low.
Referenced by x86_dr_stopped_by_hw_breakpoint(), and x86_dr_stopped_data_address().
|
static |
Definition at line 80 of file x86-dregs.c.
References x86_dr_low_type::get_control, and x86_dr_low.
Referenced by x86_dr_stopped_by_hw_breakpoint(), and x86_dr_stopped_data_address().
|
static |
Definition at line 88 of file x86-dregs.c.
References x86_dr_low_type::get_status, and x86_dr_low.
Referenced by x86_dr_stopped_by_hw_breakpoint(), and x86_dr_stopped_data_address().
|
static |
Definition at line 48 of file x86-dregs.c.
References x86_debug_reg_state::dr_mirror, x86_dr_low_type::set_addr, and x86_dr_low.
Referenced by x86_update_inferior_debug_regs().
|
static |
Definition at line 72 of file x86-dregs.c.
References x86_debug_reg_state::dr_control_mirror, x86_dr_low_type::set_control, and x86_dr_low.
Referenced by x86_update_inferior_debug_regs().
int x86_dr_region_ok_for_watchpoint | ( | struct x86_debug_reg_state * | state, |
CORE_ADDR | addr, | ||
int | len ) |
Definition at line 586 of file x86-dregs.c.
References DR_NADDR, WP_COUNT, and x86_handle_nonaligned_watchpoint().
int x86_dr_remove_watchpoint | ( | struct x86_debug_reg_state * | state, |
enum target_hw_bp_type | type, | ||
CORE_ADDR | addr, | ||
int | len ) |
Definition at line 548 of file x86-dregs.c.
References TARGET_HAS_DR_LEN_8, WP_REMOVE, x86_handle_nonaligned_watchpoint(), x86_length_and_rw_bits(), x86_remove_aligned_watchpoint(), x86_show_dr(), and x86_update_inferior_debug_regs().
int x86_dr_stopped_by_hw_breakpoint | ( | struct x86_debug_reg_state * | state | ) |
Definition at line 693 of file x86-dregs.c.
References ALL_DEBUG_ADDRESS_REGISTERS, X86_DR_GET_RW_LEN, x86_dr_low_get_addr(), x86_dr_low_get_control(), x86_dr_low_get_status(), X86_DR_WATCH_HIT, and x86_show_dr().
int x86_dr_stopped_by_watchpoint | ( | struct x86_debug_reg_state * | state | ) |
Definition at line 683 of file x86-dregs.c.
References x86_dr_stopped_data_address().
int x86_dr_stopped_data_address | ( | struct x86_debug_reg_state * | state, |
CORE_ADDR * | addr_p ) |
Definition at line 603 of file x86-dregs.c.
References ALL_DEBUG_ADDRESS_REGISTERS, X86_DR_GET_RW_LEN, x86_dr_low_get_addr(), x86_dr_low_get_control(), x86_dr_low_get_status(), X86_DR_WATCH_HIT, and x86_show_dr().
Referenced by x86_dr_stopped_by_watchpoint().
|
static |
Definition at line 96 of file x86-dregs.c.
References x86_dr_low_type::debug_register_length, and x86_dr_low.
Referenced by x86_show_dr().
|
static |
Definition at line 418 of file x86-dregs.c.
References TARGET_HAS_DR_LEN_8, WP_COUNT, WP_INSERT, WP_REMOVE, x86_insert_aligned_watchpoint(), x86_length_and_rw_bits(), and x86_remove_aligned_watchpoint().
Referenced by x86_dr_insert_watchpoint(), x86_dr_region_ok_for_watchpoint(), and x86_dr_remove_watchpoint().
|
static |
Definition at line 306 of file x86-dregs.c.
References ALL_DEBUG_ADDRESS_REGISTERS, x86_debug_reg_state::dr_control_mirror, DR_LOCAL_SLOWDOWN, x86_debug_reg_state::dr_mirror, DR_NADDR, x86_debug_reg_state::dr_ref_count, X86_DR_CONTROL_MASK, X86_DR_GET_RW_LEN, X86_DR_LOCAL_ENABLE, x86_dr_low_can_set_addr(), x86_dr_low_can_set_control(), X86_DR_SET_RW_LEN, and X86_DR_VACANT.
Referenced by x86_dr_insert_watchpoint(), and x86_handle_nonaligned_watchpoint().
|
static |
Definition at line 251 of file x86-dregs.c.
References DR_LEN_1, DR_LEN_2, DR_LEN_4, DR_LEN_8, DR_RW_EXECUTE, DR_RW_IORW, DR_RW_READ, DR_RW_WRITE, and TARGET_HAS_DR_LEN_8.
Referenced by x86_dr_insert_watchpoint(), x86_dr_remove_watchpoint(), and x86_handle_nonaligned_watchpoint().
|
static |
Definition at line 366 of file x86-dregs.c.
References ALL_DEBUG_ADDRESS_REGISTERS, x86_debug_reg_state::dr_control_mirror, x86_debug_reg_state::dr_mirror, x86_debug_reg_state::dr_ref_count, X86_DR_DISABLE, X86_DR_GET_RW_LEN, X86_DR_SET_RW_LEN, and X86_DR_VACANT.
Referenced by x86_dr_remove_watchpoint(), and x86_handle_nonaligned_watchpoint().
|
static |
Definition at line 214 of file x86-dregs.c.
References ALL_DEBUG_ADDRESS_REGISTERS, x86_debug_reg_state::dr_control_mirror, x86_debug_reg_state::dr_mirror, x86_debug_reg_state::dr_ref_count, x86_debug_reg_state::dr_status_mirror, and x86_get_debug_register_length().
Referenced by x86_dr_insert_watchpoint(), x86_dr_remove_watchpoint(), x86_dr_stopped_by_hw_breakpoint(), and x86_dr_stopped_data_address().
|
static |
Definition at line 482 of file x86-dregs.c.
References ALL_DEBUG_ADDRESS_REGISTERS, x86_debug_reg_state::dr_control_mirror, x86_debug_reg_state::dr_mirror, x86_dr_low_set_addr(), x86_dr_low_set_control(), and X86_DR_VACANT.
Referenced by x86_dr_insert_watchpoint(), and x86_dr_remove_watchpoint().