GDBserver

Classes | Macros | Typedefs | Functions | Variables
aarch64-linux-hw-point.h File Reference
`#include "break-common.h"`

Go to the source code of this file.

## Classes
struct | aarch64_debug_reg_state
struct | arch_lwp_info

## Macros
#define | AARCH64_HBP_MAX_NUM 16
#define | AARCH64_HWP_MAX_NUM 16
#define | AARCH64_HBP_ALIGNMENT 4
#define | AARCH64_HWP_ALIGNMENT 8
#define | AARCH64_HWP_MAX_LEN_PER_REG 8
#define | AARCH64_DEBUG_NUM_SLOTS(x) ((x) & 0xff)
#define | AARCH64_DEBUG_ARCH(x) (((x) >> 8) & 0xff)
#define | AARCH64_DEBUG_ARCH_V8 0x6
#define | AARCH64_DEBUG_ARCH_V8_1 0x7
#define | AARCH64_DEBUG_ARCH_V8_2 0x8
#define | DR_CONTROL_ENABLED(ctrl) (((ctrl) & 0x1) == 1)
#define | DR_CONTROL_LENGTH(ctrl) (((ctrl) >> 5) & 0xff)
#define | DR_MARK_ALL_CHANGED(x, m)
#define | DR_MARK_N_CHANGED(x, n)
#define | DR_CLEAR_CHANGED(x)
#define | DR_HAS_CHANGED(x) ((x) != 0)
#define | DR_N_HAS_CHANGED(x, n) ((x) & ((dr_changed_t)1 << (n)))

## Typedefs
typedef ULONGEST | dr_changed_t

## Functions
unsigned int | aarch64_watchpoint_length (unsigned int ctrl)
int | aarch64_handle_breakpoint (enum target_hw_bp_type type, CORE_ADDR addr, int len, int is_insert, struct aarch64_debug_reg_state *state)
int | aarch64_handle_watchpoint (enum target_hw_bp_type type, CORE_ADDR addr, int len, int is_insert, struct aarch64_debug_reg_state *state)
void | aarch64_linux_set_debug_regs (const struct aarch64_debug_reg_state *state, int tid, int watchpoint)
void | aarch64_show_debug_reg_state (struct aarch64_debug_reg_state *state, const char *func, CORE_ADDR addr, int len, enum target_hw_bp_type type)
void | aarch64_linux_get_debug_reg_capacity (int tid)
struct aarch64_debug_reg_state * | aarch64_get_debug_reg_state (pid_t pid)
int | aarch64_linux_region_ok_for_watchpoint (CORE_ADDR addr, int len)

## Variables
int | aarch64_num_bp_regs
int | aarch64_num_wp_regs

## Macro Definition Documentation

## ◆ AARCH64_DEBUG_ARCH

#define AARCH64_DEBUG_ARCH | ( |  | x | ) | (((x) >> 8) & 0xff)

Definition at line 69 of file aarch64-linux-hw-point.h.

Referenced by aarch64_linux_get_debug_reg_capacity().

## ◆ AARCH64_DEBUG_ARCH_V8

#define AARCH64_DEBUG_ARCH_V8 0x6

Definition at line 72 of file aarch64-linux-hw-point.h.

Referenced by aarch64_linux_get_debug_reg_capacity().

## ◆ AARCH64_DEBUG_ARCH_V8_1

#define AARCH64_DEBUG_ARCH_V8_1 0x7

Definition at line 73 of file aarch64-linux-hw-point.h.

Referenced by aarch64_linux_get_debug_reg_capacity().

## ◆ AARCH64_DEBUG_ARCH_V8_2

#define AARCH64_DEBUG_ARCH_V8_2 0x8

Definition at line 74 of file aarch64-linux-hw-point.h.

Referenced by aarch64_linux_get_debug_reg_capacity().

## ◆ AARCH64_DEBUG_NUM_SLOTS

#define AARCH64_DEBUG_NUM_SLOTS | ( |  | x | ) | ((x) & 0xff)

Definition at line 68 of file aarch64-linux-hw-point.h.

Referenced by aarch64_linux_get_debug_reg_capacity().

## ◆ AARCH64_HBP_ALIGNMENT

#define AARCH64_HBP_ALIGNMENT 4

Definition at line 51 of file aarch64-linux-hw-point.h.

Referenced by aarch64_point_is_aligned().

## ◆ AARCH64_HBP_MAX_NUM

#define AARCH64_HBP_MAX_NUM 16

Definition at line 36 of file aarch64-linux-hw-point.h.

Referenced by aarch64_init_debug_reg_state(), and aarch64_linux_get_debug_reg_capacity().

## ◆ AARCH64_HWP_ALIGNMENT

#define AARCH64_HWP_ALIGNMENT 8

Definition at line 52 of file aarch64-linux-hw-point.h.

Referenced by aarch64_align_watchpoint(), and aarch64_point_is_aligned().

## ◆ AARCH64_HWP_MAX_LEN_PER_REG

#define AARCH64_HWP_MAX_LEN_PER_REG 8

Definition at line 57 of file aarch64-linux-hw-point.h.

Referenced by aarch64_align_watchpoint(), and aarch64_linux_region_ok_for_watchpoint().

## ◆ AARCH64_HWP_MAX_NUM

#define AARCH64_HWP_MAX_NUM 16

Definition at line 37 of file aarch64-linux-hw-point.h.

Referenced by aarch64_init_debug_reg_state(), and aarch64_linux_get_debug_reg_capacity().

## ◆ DR_CLEAR_CHANGED

#define DR_CLEAR_CHANGED | ( |  | x | ) |

Value:
do \
{ \
(x) = 0; \
} while (0)

Definition at line 126 of file aarch64-linux-hw-point.h.

Referenced by aarch64_linux_prepare_to_resume().

## ◆ DR_CONTROL_ENABLED

#define DR_CONTROL_ENABLED | ( |  | ctrl | ) | (((ctrl) & 0x1) == 1)

Definition at line 85 of file aarch64-linux-hw-point.h.

Referenced by aarch64_stopped_data_address().

## ◆ DR_CONTROL_LENGTH

#define DR_CONTROL_LENGTH | ( |  | ctrl | ) | (((ctrl) >> 5) & 0xff)

Definition at line 86 of file aarch64-linux-hw-point.h.

Referenced by aarch64_watchpoint_length().

## ◆ DR_HAS_CHANGED

#define DR_HAS_CHANGED | ( |  | x | ) | ((x) != 0)

Definition at line 132 of file aarch64-linux-hw-point.h.

Referenced by aarch64_linux_prepare_to_resume().

## ◆ DR_MARK_ALL_CHANGED

#define DR_MARK_ALL_CHANGED | ( |  | x,
|  |  | m
| ) |  |

Value:
do \
{ \
gdb_assert (sizeof ((x)) * 8 >= (m)); \
(x) = (((dr_changed_t)1 << (m)) - 1); \
} while (0)
dr_changed_t
ULONGEST dr_changed_t
Definition: aarch64-linux-hw-point.h:109

Definition at line 113 of file aarch64-linux-hw-point.h.

Referenced by aarch64_linux_new_thread().

## ◆ DR_MARK_N_CHANGED

#define DR_MARK_N_CHANGED | ( |  | x,
|  |  | n
| ) |  |

Value:
do \
{ \
(x) |= ((dr_changed_t)1 << (n)); \
} while (0)
dr_changed_t
ULONGEST dr_changed_t
Definition: aarch64-linux-hw-point.h:109

Definition at line 120 of file aarch64-linux-hw-point.h.

Referenced by debug_reg_change_callback().

## ◆ DR_N_HAS_CHANGED

#define DR_N_HAS_CHANGED | ( |  | x,
|  |  | n
| ) |  | ((x) & ((dr_changed_t)1 << (n)))

Definition at line 133 of file aarch64-linux-hw-point.h.

## Typedef Documentation

## ◆ dr_changed_t

typedef ULONGEST dr_changed_t

Definition at line 109 of file aarch64-linux-hw-point.h.

## Function Documentation

## ◆ aarch64_get_debug_reg_state()

struct aarch64_debug_reg_state* aarch64_get_debug_reg_state | ( | pid_t | pid | ) |

Definition at line 219 of file linux-aarch64-low.c.

References process_info_private::arch_private, arch_process_info::debug_reg_state, find_process_pid(), process_info::pid, and process_info::priv.

Referenced by aarch64_insert_point(), aarch64_linux_prepare_to_resume(), aarch64_remove_point(), and aarch64_stopped_data_address().

## ◆ aarch64_handle_breakpoint()

int aarch64_handle_breakpoint | ( | enum target_hw_bp_type | type,
|  | CORE_ADDR | addr,
|  | int | len,
|  | int | is_insert,
|  | struct aarch64_debug_reg_state * | state
| ) |  |

Definition at line 458 of file aarch64-linux-hw-point.c.

References aarch64_dr_state_insert_one_point(), aarch64_dr_state_remove_one_point(), and aarch64_point_is_aligned().

Referenced by aarch64_insert_point(), and aarch64_remove_point().

## ◆ aarch64_handle_watchpoint()

int aarch64_handle_watchpoint | ( | enum target_hw_bp_type | type,
|  | CORE_ADDR | addr,
|  | int | len,
|  | int | is_insert,
|  | struct aarch64_debug_reg_state * | state
| ) |  |

Definition at line 539 of file aarch64-linux-hw-point.c.

References aarch64_handle_aligned_watchpoint(), aarch64_handle_unaligned_watchpoint(), and aarch64_point_is_aligned().

Referenced by aarch64_insert_point(), and aarch64_remove_point().

## ◆ aarch64_linux_get_debug_reg_capacity()

void aarch64_linux_get_debug_reg_capacity | ( | int | tid | ) |

Definition at line 623 of file aarch64-linux-hw-point.c.

References _, AARCH64_DEBUG_ARCH, AARCH64_DEBUG_ARCH_V8, AARCH64_DEBUG_ARCH_V8_1, AARCH64_DEBUG_ARCH_V8_2, AARCH64_DEBUG_NUM_SLOTS, AARCH64_HBP_MAX_NUM, AARCH64_HWP_MAX_NUM, aarch64_num_bp_regs, aarch64_num_wp_regs, ptrace(), PTRACE_GETREGSET, and warning().

Referenced by aarch64_arch_setup().

## ◆ aarch64_linux_region_ok_for_watchpoint()

int aarch64_linux_region_ok_for_watchpoint | ( | CORE_ADDR | addr,
|  | int | len
| ) |  |

Definition at line 680 of file aarch64-linux-hw-point.c.

References AARCH64_HWP_MAX_LEN_PER_REG, and aarch64_num_wp_regs.

Referenced by aarch64_insert_point().

## ◆ aarch64_linux_set_debug_regs()

void aarch64_linux_set_debug_regs | ( | const struct aarch64_debug_reg_state * | state,
|  | int | tid,
|  | int | watchpoint
| ) |  |

Definition at line 555 of file aarch64-linux-hw-point.c.

References _, aarch64_num_bp_regs, aarch64_num_wp_regs, aarch64_debug_reg_state::dr_addr_bp, aarch64_debug_reg_state::dr_addr_wp, aarch64_debug_reg_state::dr_ctrl_bp, aarch64_debug_reg_state::dr_ctrl_wp, error(), memset(), ptrace(), and PTRACE_SETREGSET.

Referenced by aarch64_linux_prepare_to_resume().

## ◆ aarch64_show_debug_reg_state()

void aarch64_show_debug_reg_state | ( | struct aarch64_debug_reg_state * | state,
|  | const char * | func,
|  | CORE_ADDR | addr,
|  | int | len,
|  | enum target_hw_bp_type | type
| ) |  |

Definition at line 589 of file aarch64-linux-hw-point.c.

References aarch64_num_bp_regs, aarch64_num_wp_regs, core_addr_to_string_nz(), debug_printf(), aarch64_debug_reg_state::dr_addr_bp, aarch64_debug_reg_state::dr_addr_wp, aarch64_debug_reg_state::dr_ctrl_bp, aarch64_debug_reg_state::dr_ctrl_wp, aarch64_debug_reg_state::dr_ref_count_bp, aarch64_debug_reg_state::dr_ref_count_wp, hw_access, hw_execute, hw_read, and hw_write.

Referenced by aarch64_insert_point(), and aarch64_remove_point().

## ◆ aarch64_watchpoint_length()

unsigned int aarch64_watchpoint_length | ( | unsigned int | ctrl | ) |

Definition at line 45 of file aarch64-linux-hw-point.c.

References DR_CONTROL_LENGTH.

Referenced by aarch64_stopped_data_address().

## Variable Documentation

## ◆ aarch64_num_bp_regs

int aarch64_num_bp_regs

Definition at line 34 of file aarch64-linux-hw-point.c.

Referenced by aarch64_dr_state_insert_one_point(), aarch64_dr_state_remove_one_point(), aarch64_linux_get_debug_reg_capacity(), aarch64_linux_new_thread(), aarch64_linux_set_debug_regs(), aarch64_show_debug_reg_state(), and debug_reg_change_callback().

## ◆ aarch64_num_wp_regs

int aarch64_num_wp_regs

Definition at line 35 of file aarch64-linux-hw-point.c.

Referenced by aarch64_dr_state_insert_one_point(), aarch64_dr_state_remove_one_point(), aarch64_linux_get_debug_reg_capacity(), aarch64_linux_new_thread(), aarch64_linux_region_ok_for_watchpoint(), aarch64_linux_set_debug_regs(), aarch64_show_debug_reg_state(), aarch64_stopped_data_address(), and debug_reg_change_callback().