27#include "elf/common.h"
30#include <sys/ptrace.h>
31#include <machine/armreg.h>
32#include <machine/reg.h>
40#if __FreeBSD_version >= 1400005
43#include <unordered_set>
136static std::unordered_set<lwpid_t> aarch64_debug_pending_threads;
215 switch (reg.db_debug_ver)
231 warning (
_(
"Unexpected number of hardware breakpoint registers"
232 " reported by ptrace, got %d, expected %d."),
239 warning (
_(
"Unexpected number of hardware watchpoint registers"
240 " reported by ptrace, got %d, expected %d."),
301 if (tp->
ptid.lwp_p ())
302 aarch64_debug_pending_threads.emplace (tp->
ptid.lwp ());
330 memset (®, 0,
sizeof(reg));
333 reg.db_breakregs[i].dbr_addr = state->
dr_addr_bp[i];
334 reg.db_breakregs[i].dbr_ctrl = state->
dr_ctrl_bp[i];
338 reg.db_watchregs[i].dbw_addr = state->
dr_addr_wp[i];
339 reg.db_watchregs[i].dbw_ctrl = state->
dr_ctrl_wp[i];
342 error (
_(
"Failed to set hardware debug registers"));
static aarch64_fbsd_nat_target the_aarch64_fbsd_nat_target
void aarch64_notify_debug_reg_change(ptid_t ptid, int is_watchpoint, unsigned int idx)
void _initialize_aarch64_fbsd_nat()
const struct regset aarch64_fbsd_fpregset
const struct regset aarch64_fbsd_gregset
const struct regset aarch64_fbsd_tls_regset
#define AARCH64_HBP_MAX_NUM
#define AARCH64_DEBUG_ARCH_V8_1
#define AARCH64_DEBUG_ARCH_V8_4
#define AARCH64_DEBUG_ARCH_V8
#define AARCH64_HWP_MAX_NUM
#define AARCH64_DEBUG_ARCH_V8_9
#define AARCH64_DEBUG_ARCH_V8_2
#define AARCH64_DEBUG_ARCH_V8_8
void aarch64_initialize_hw_point()
struct aarch64_debug_reg_state * aarch64_lookup_debug_reg_state(pid_t pid)
struct aarch64_debug_reg_state * aarch64_get_debug_reg_state(pid_t pid)
bool aarch64_stopped_data_address(const struct aarch64_debug_reg_state *state, CORE_ADDR addr_trap, CORE_ADDR *addr_p)
void aarch64_remove_debug_reg_state(pid_t pid)
const target_desc * aarch64_read_description(const aarch64_features &features)
bool is_watchpoint(const struct breakpoint *bpt)
size_t have_regset(ptid_t ptid, int note)
bool fetch_register_set(struct regcache *regcache, int regnum, int fetch_op, const struct regset *regset, int regbase, void *regs, size_t size)
virtual void low_new_fork(ptid_t parent, pid_t child)
void post_startup_inferior(ptid_t) override
virtual void low_delete_thread(thread_info *)
virtual void low_prepare_to_resume(thread_info *)
void post_attach(int) override
bool fbsd_nat_get_siginfo(ptid_t ptid, siginfo_t *siginfo)
#define ptrace(request, pid, addr, data)
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int int rusage_t pid_t pid
void add_inf_child_target(inf_child_target *target)
struct inferior * current_inferior(void)
CORE_ADDR dr_addr_bp[AARCH64_HBP_MAX_NUM]
unsigned int dr_ctrl_wp[AARCH64_HWP_MAX_NUM]
CORE_ADDR dr_addr_wp[AARCH64_HWP_MAX_NUM]
unsigned int dr_ctrl_bp[AARCH64_HBP_MAX_NUM]
void store_registers(struct regcache *, int) override
void fetch_registers(struct regcache *, int) override
const struct target_desc * read_description() override
virtual bool stopped_by_watchpoint() TARGET_DEFAULT_RETURN(false)
target_ops * beneath() const
virtual bool stopped_data_address(CORE_ADDR *) TARGET_DEFAULT_RETURN(false)
virtual bool stopped_by_hw_breakpoint() TARGET_DEFAULT_RETURN(false)
virtual bool supports_stopped_by_hw_breakpoint() TARGET_DEFAULT_RETURN(false)
virtual const struct target_desc * read_description() TARGET_DEFAULT_RETURN(NULL)