GDBserver
|
Go to the source code of this file.
Defines | |
#define | TARGET_HAS_DR_LEN_8 (sizeof (void *) == 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 | I386_DR_CONTROL_MASK (~DR_CONTROL_RESERVED) |
#define | I386_DR_VACANT(state, i) (((state)->dr_control_mirror & (3 << (DR_ENABLE_SIZE * (i)))) == 0) |
#define | I386_DR_LOCAL_ENABLE(state, i) |
#define | I386_DR_GLOBAL_ENABLE(state, i) |
#define | I386_DR_DISABLE(state, i) |
#define | I386_DR_SET_RW_LEN(state, i, rwlen) |
#define | I386_DR_GET_RW_LEN(dr7, i) |
#define | I386_DR_WATCH_HIT(dr6, i) ((dr6) & (1 << (i))) |
#define | ALL_DEBUG_REGISTERS(i) for (i = 0; i < DR_NADDR; i++) |
#define | Z_PACKET_HW_BP '1' |
#define | Z_PACKET_WRITE_WP '2' |
#define | Z_PACKET_READ_WP '3' |
#define | Z_PACKET_ACCESS_WP '4' |
Enumerations | |
enum | i386_wp_op_t { WP_INSERT, WP_REMOVE, WP_COUNT } |
Functions | |
void | i386_low_init_dregs (struct i386_debug_reg_state *state) |
static void | i386_show_dr (struct i386_debug_reg_state *state, const char *func, CORE_ADDR addr, int len, enum target_hw_bp_type type) |
static unsigned | i386_length_and_rw_bits (int len, enum target_hw_bp_type type) |
static int | i386_insert_aligned_watchpoint (struct i386_debug_reg_state *state, CORE_ADDR addr, unsigned len_rw_bits) |
static int | i386_remove_aligned_watchpoint (struct i386_debug_reg_state *state, CORE_ADDR addr, unsigned len_rw_bits) |
static int | i386_handle_nonaligned_watchpoint (struct i386_debug_reg_state *state, i386_wp_op_t what, CORE_ADDR addr, int len, enum target_hw_bp_type type) |
static enum target_hw_bp_type | Z_packet_to_hw_type (char type) |
static void | i386_update_inferior_debug_regs (struct i386_debug_reg_state *inf_state, struct i386_debug_reg_state *new_state) |
int | i386_low_insert_watchpoint (struct i386_debug_reg_state *state, char type_from_packet, CORE_ADDR addr, int len) |
int | i386_low_remove_watchpoint (struct i386_debug_reg_state *state, char type_from_packet, CORE_ADDR addr, int len) |
int | i386_low_region_ok_for_watchpoint (struct i386_debug_reg_state *state, CORE_ADDR addr, int len) |
int | i386_low_stopped_data_address (struct i386_debug_reg_state *state, CORE_ADDR *addr_p) |
int | i386_low_stopped_by_watchpoint (struct i386_debug_reg_state *state) |
#define ALL_DEBUG_REGISTERS | ( | i | ) | for (i = 0; i < DR_NADDR; i++) |
Definition at line 136 of file i386-low.c.
Referenced by i386_insert_aligned_watchpoint(), i386_low_init_dregs(), i386_low_stopped_data_address(), i386_remove_aligned_watchpoint(), i386_show_dr(), and i386_update_inferior_debug_regs().
#define DR_CONTROL_RESERVED (0xFC00) |
Definition at line 85 of file i386-low.c.
#define DR_CONTROL_SHIFT 16 |
Definition at line 34 of file i386-low.c.
#define DR_CONTROL_SIZE 4 |
Definition at line 36 of file i386-low.c.
#define DR_ENABLE_SIZE 2 /* Two enable bits per debug register. */ |
Definition at line 70 of file i386-low.c.
#define DR_GLOBAL_ENABLE_SHIFT 1 /* Extra shift to the global enable bit. */ |
Definition at line 69 of file i386-low.c.
#define DR_GLOBAL_SLOWDOWN (0x200) |
Definition at line 78 of file i386-low.c.
#define DR_LEN_1 (0x0 << 2) /* 1-byte region watch or breakpoint. */ |
Definition at line 52 of file i386-low.c.
Referenced by i386_length_and_rw_bits().
#define DR_LEN_2 (0x1 << 2) /* 2-byte region watch. */ |
Definition at line 53 of file i386-low.c.
Referenced by i386_length_and_rw_bits().
#define DR_LEN_4 (0x3 << 2) /* 4-byte region watch. */ |
Definition at line 54 of file i386-low.c.
Referenced by i386_length_and_rw_bits().
#define DR_LEN_8 (0x2 << 2) /* 8-byte region watch (AMD64). */ |
Definition at line 55 of file i386-low.c.
Referenced by i386_length_and_rw_bits().
#define DR_LOCAL_ENABLE_SHIFT 0 /* Extra shift to the local enable bit. */ |
Definition at line 68 of file i386-low.c.
#define DR_LOCAL_SLOWDOWN (0x100) |
Definition at line 77 of file i386-low.c.
Referenced by i386_insert_aligned_watchpoint().
#define DR_RW_EXECUTE (0x0) /* Break on instruction execution. */ |
Definition at line 39 of file i386-low.c.
Referenced by i386_length_and_rw_bits().
#define DR_RW_IORW (0x2) /* Break on I/O reads or writes. */ |
Definition at line 47 of file i386-low.c.
Referenced by i386_length_and_rw_bits().
#define DR_RW_READ (0x3) /* Break on data reads or writes. */ |
Definition at line 41 of file i386-low.c.
Referenced by i386_length_and_rw_bits().
#define DR_RW_WRITE (0x1) /* Break on data writes. */ |
Definition at line 40 of file i386-low.c.
Referenced by i386_length_and_rw_bits().
#define I386_DR_CONTROL_MASK (~DR_CONTROL_RESERVED) |
Definition at line 90 of file i386-low.c.
Referenced by i386_insert_aligned_watchpoint().
#define I386_DR_DISABLE | ( | state, | |
i | |||
) |
do { \ (state)->dr_control_mirror &= \ ~(3 << (DR_ENABLE_SIZE * (i))); \ } while (0)
Definition at line 112 of file i386-low.c.
Referenced by i386_remove_aligned_watchpoint().
#define I386_DR_GET_RW_LEN | ( | dr7, | |
i | |||
) |
(((dr7) \ >> (DR_CONTROL_SHIFT + DR_CONTROL_SIZE * (i))) & 0x0f)
Definition at line 128 of file i386-low.c.
Referenced by i386_insert_aligned_watchpoint(), i386_low_stopped_data_address(), and i386_remove_aligned_watchpoint().
#define I386_DR_GLOBAL_ENABLE | ( | state, | |
i | |||
) |
do { \ (state)->dr_control_mirror |= \ (1 << (DR_GLOBAL_ENABLE_SHIFT + DR_ENABLE_SIZE * (i))); \ } while (0)
Definition at line 105 of file i386-low.c.
#define I386_DR_LOCAL_ENABLE | ( | state, | |
i | |||
) |
do { \ (state)->dr_control_mirror |= \ (1 << (DR_LOCAL_ENABLE_SHIFT + DR_ENABLE_SIZE * (i))); \ } while (0)
Definition at line 98 of file i386-low.c.
Referenced by i386_insert_aligned_watchpoint().
#define I386_DR_SET_RW_LEN | ( | state, | |
i, | |||
rwlen | |||
) |
do { \ (state)->dr_control_mirror &= \ ~(0x0f << (DR_CONTROL_SHIFT + DR_CONTROL_SIZE * (i))); \ (state)->dr_control_mirror |= \ ((rwlen) << (DR_CONTROL_SHIFT + DR_CONTROL_SIZE * (i))); \ } while (0)
Definition at line 119 of file i386-low.c.
Referenced by i386_insert_aligned_watchpoint().
#define I386_DR_VACANT | ( | state, | |
i | |||
) | (((state)->dr_control_mirror & (3 << (DR_ENABLE_SIZE * (i)))) == 0) |
Definition at line 94 of file i386-low.c.
Referenced by i386_insert_aligned_watchpoint(), i386_remove_aligned_watchpoint(), and i386_update_inferior_debug_regs().
#define I386_DR_WATCH_HIT | ( | dr6, | |
i | |||
) | ((dr6) & (1 << (i))) |
Definition at line 133 of file i386-low.c.
Referenced by i386_low_stopped_data_address().
#define TARGET_HAS_DR_LEN_8 (sizeof (void *) == 8) |
Definition at line 28 of file i386-low.c.
Referenced by i386_handle_nonaligned_watchpoint(), i386_length_and_rw_bits(), i386_low_insert_watchpoint(), and i386_low_remove_watchpoint().
#define Z_PACKET_ACCESS_WP '4' |
Definition at line 409 of file i386-low.c.
Referenced by Z_packet_to_hw_type().
#define Z_PACKET_HW_BP '1' |
Definition at line 406 of file i386-low.c.
Referenced by Z_packet_to_hw_type().
#define Z_PACKET_READ_WP '3' |
Definition at line 408 of file i386-low.c.
Referenced by Z_packet_to_hw_type().
#define Z_PACKET_WRITE_WP '2' |
Definition at line 407 of file i386-low.c.
Referenced by Z_packet_to_hw_type().
enum i386_wp_op_t |
Definition at line 139 of file i386-low.c.
static int i386_handle_nonaligned_watchpoint | ( | struct i386_debug_reg_state * | state, |
i386_wp_op_t | what, | ||
CORE_ADDR | addr, | ||
int | len, | ||
enum target_hw_bp_type | type | ||
) | [static] |
Definition at line 345 of file i386-low.c.
References fatal(), i386_insert_aligned_watchpoint(), i386_length_and_rw_bits(), i386_remove_aligned_watchpoint(), TARGET_HAS_DR_LEN_8, WP_COUNT, WP_INSERT, and WP_REMOVE.
Referenced by i386_low_insert_watchpoint(), i386_low_region_ok_for_watchpoint(), and i386_low_remove_watchpoint().
static int i386_insert_aligned_watchpoint | ( | struct i386_debug_reg_state * | state, |
CORE_ADDR | addr, | ||
unsigned | len_rw_bits | ||
) | [static] |
Definition at line 256 of file i386-low.c.
References ALL_DEBUG_REGISTERS, i386_debug_reg_state::dr_control_mirror, DR_LOCAL_SLOWDOWN, i386_debug_reg_state::dr_mirror, DR_NADDR, i386_debug_reg_state::dr_ref_count, I386_DR_CONTROL_MASK, I386_DR_GET_RW_LEN, I386_DR_LOCAL_ENABLE, I386_DR_SET_RW_LEN, and I386_DR_VACANT.
Referenced by i386_handle_nonaligned_watchpoint(), and i386_low_insert_watchpoint().
static unsigned i386_length_and_rw_bits | ( | int | len, |
enum target_hw_bp_type | type | ||
) | [static] |
Definition at line 202 of file i386-low.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, error(), fatal(), hw_access, hw_execute, hw_read, hw_write, and TARGET_HAS_DR_LEN_8.
Referenced by i386_handle_nonaligned_watchpoint(), i386_low_insert_watchpoint(), and i386_low_remove_watchpoint().
void i386_low_init_dregs | ( | struct i386_debug_reg_state * | state | ) |
Definition at line 147 of file i386-low.c.
References ALL_DEBUG_REGISTERS, i386_debug_reg_state::dr_control_mirror, i386_debug_reg_state::dr_mirror, i386_debug_reg_state::dr_ref_count, and i386_debug_reg_state::dr_status_mirror.
Referenced by i386_initial_stuff(), and x86_linux_new_process().
int i386_low_insert_watchpoint | ( | struct i386_debug_reg_state * | state, |
char | type_from_packet, | ||
CORE_ADDR | addr, | ||
int | len | ||
) |
Definition at line 459 of file i386-low.c.
References debug_hw_points, hw_read, i386_handle_nonaligned_watchpoint(), i386_insert_aligned_watchpoint(), i386_length_and_rw_bits(), i386_show_dr(), i386_update_inferior_debug_regs(), TARGET_HAS_DR_LEN_8, WP_INSERT, and Z_packet_to_hw_type().
Referenced by i386_insert_point(), and x86_insert_point().
int i386_low_region_ok_for_watchpoint | ( | struct i386_debug_reg_state * | state, |
CORE_ADDR | addr, | ||
int | len | ||
) |
Definition at line 535 of file i386-low.c.
References DR_NADDR, hw_write, i386_handle_nonaligned_watchpoint(), and WP_COUNT.
int i386_low_remove_watchpoint | ( | struct i386_debug_reg_state * | state, |
char | type_from_packet, | ||
CORE_ADDR | addr, | ||
int | len | ||
) |
Definition at line 499 of file i386-low.c.
References debug_hw_points, i386_handle_nonaligned_watchpoint(), i386_length_and_rw_bits(), i386_remove_aligned_watchpoint(), i386_show_dr(), i386_update_inferior_debug_regs(), TARGET_HAS_DR_LEN_8, WP_REMOVE, and Z_packet_to_hw_type().
Referenced by i386_remove_point(), and x86_remove_point().
int i386_low_stopped_by_watchpoint | ( | struct i386_debug_reg_state * | state | ) |
Definition at line 632 of file i386-low.c.
References i386_low_stopped_data_address().
Referenced by i386_stopped_by_watchpoint(), and x86_stopped_by_watchpoint().
int i386_low_stopped_data_address | ( | struct i386_debug_reg_state * | state, |
CORE_ADDR * | addr_p | ||
) |
Definition at line 552 of file i386-low.c.
References ALL_DEBUG_REGISTERS, debug_hw_points, hw_write, I386_DR_GET_RW_LEN, i386_dr_low_get_addr(), i386_dr_low_get_control(), i386_dr_low_get_status(), I386_DR_WATCH_HIT, and i386_show_dr().
Referenced by i386_low_stopped_by_watchpoint(), i386_stopped_data_address(), and x86_stopped_data_address().
static int i386_remove_aligned_watchpoint | ( | struct i386_debug_reg_state * | state, |
CORE_ADDR | addr, | ||
unsigned | len_rw_bits | ||
) | [static] |
Definition at line 313 of file i386-low.c.
References ALL_DEBUG_REGISTERS, i386_debug_reg_state::dr_control_mirror, i386_debug_reg_state::dr_mirror, i386_debug_reg_state::dr_ref_count, I386_DR_DISABLE, I386_DR_GET_RW_LEN, and I386_DR_VACANT.
Referenced by i386_handle_nonaligned_watchpoint(), and i386_low_remove_watchpoint().
static void i386_show_dr | ( | struct i386_debug_reg_state * | state, |
const char * | func, | ||
CORE_ADDR | addr, | ||
int | len, | ||
enum target_hw_bp_type | type | ||
) | [static] |
Definition at line 164 of file i386-low.c.
References ALL_DEBUG_REGISTERS, i386_debug_reg_state::dr_control_mirror, i386_debug_reg_state::dr_mirror, i386_debug_reg_state::dr_ref_count, i386_debug_reg_state::dr_status_mirror, hw_access, hw_execute, hw_read, hw_write, and paddress().
Referenced by i386_low_insert_watchpoint(), i386_low_remove_watchpoint(), and i386_low_stopped_data_address().
static void i386_update_inferior_debug_regs | ( | struct i386_debug_reg_state * | inf_state, |
struct i386_debug_reg_state * | new_state | ||
) | [static] |
Definition at line 435 of file i386-low.c.
References ALL_DEBUG_REGISTERS, i386_debug_reg_state::dr_control_mirror, i386_debug_reg_state::dr_mirror, gdb_assert, i386_dr_low_set_addr(), i386_dr_low_set_control(), and I386_DR_VACANT.
Referenced by i386_low_insert_watchpoint(), and i386_low_remove_watchpoint().
static enum target_hw_bp_type Z_packet_to_hw_type | ( | char | type | ) | [static] |
Definition at line 414 of file i386-low.c.
References fatal(), hw_access, hw_execute, hw_read, hw_write, Z_PACKET_ACCESS_WP, Z_PACKET_HW_BP, Z_PACKET_READ_WP, and Z_PACKET_WRITE_WP.
Referenced by i386_low_insert_watchpoint(), and i386_low_remove_watchpoint().