36 #include "elf/external.h" 37 #include "elf/common.h" 40 #include <sys/utsname.h> 41 #include <asm/ptrace.h> 49 #define TRAP_HWBKPT 0x0004 168 iovec.iov_base = ®s;
170 iovec.iov_len = 18 * 4;
172 iovec.iov_len =
sizeof (regs);
205 iovec.iov_base = ®s;
207 iovec.iov_len = 18 * 4;
209 iovec.iov_len =
sizeof (regs);
249 iovec.iov_base = ®s;
265 iovec.iov_len =
sizeof (regs);
296 iovec.iov_base = ®s;
312 iovec.iov_len =
sizeof (regs);
325 (
char *) ®s.fpsr);
328 (
char *) ®s.fpcr);
452 *child_state = *parent_state;
461 lwpid_t lwpid,
int idx,
void **base)
497 iovec.iov_base = regbuf;
548 int cnt,
int othertype)
593 "insert_hw_breakpoint on entry (addr=0x%08lx, len=%d))\n",
594 (
unsigned long) addr, len);
601 "insert_hw_breakpoint", addr, len,
type);
626 (
gdb_stdlog,
"remove_hw_breakpoint on entry (addr=0x%08lx, len=%d))\n",
627 (
unsigned long) addr, len);
634 "remove_hw_watchpoint", addr, len,
type);
658 "insert_watchpoint on entry (addr=0x%08lx, len=%d)\n",
659 (
unsigned long) addr, len);
668 "insert_watchpoint", addr, len,
type);
691 "remove_watchpoint on entry (addr=0x%08lx, len=%d)\n",
692 (
unsigned long) addr, len);
701 "remove_watchpoint", addr, len,
type);
730 if (siginfo.si_signo != SIGTRAP
744 && addr_trap >= addr_watch
745 && addr_trap < addr_watch + len)
772 return start <= addr && start + length - 1 >= addr;
792 Set whether to show variables that mirror the AArch64 debug registers."),
_(
"\ 793 Show whether to show variables that mirror the AArch64 debug registers."),
_(
"\ 794 Use \"on\" to enable, \"off\" to disable.\n\ 795 If enabled, the debug registers values are shown when GDB inserts\n\ 796 or removes a hardware breakpoint or watchpoint, and when the inferior\n\ 797 triggers a breakpoint or watchpoint."),
struct gdbarch * target_gdbarch(void)
static const struct target_desc * aarch64_linux_read_description(struct target_ops *ops)
struct arch_lwp_info * arch_private
void aarch64_linux_new_thread(struct lwp_info *lwp)
static constexpr ptid_t tid
const struct target_desc *(* to_read_description)(struct target_ops *ops) TARGET_DEFAULT_RETURN(NULL)
static int aarch64_linux_siginfo_fixup(siginfo_t *native, gdb_byte *inf, int direction)
int aarch64_handle_breakpoint(enum target_hw_bp_type type, CORE_ADDR addr, int len, int is_insert, struct aarch64_debug_reg_state *state)
struct frame_info * get_current_frame(void)
static void fetch_fpregs_from_thread(struct regcache *regcache)
const target_desc * aarch64_read_description()
static void store_gregs_to_thread(const struct regcache *regcache)
ps_err_e ps_get_thread_area(struct ps_prochandle *ph, lwpid_t lwpid, int idx, void **base)
int ptid_get_pid(const ptid_t &ptid)
void fill_gregset(const struct regcache *regcache, gdb_gregset_t *gregsetp, int regno)
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 linux_nat_set_new_thread(struct target_ops *t, void(*new_thread)(struct lwp_info *))
static int aarch64_linux_remove_watchpoint(struct target_ops *self, CORE_ADDR addr, int len, enum target_hw_bp_type type, struct expression *cond)
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 aarch32_gp_regcache_collect(const struct regcache *regcache, uint32_t *regs, int arm_apcs_32)
unsigned int dr_ref_count_wp[AARCH64_HWP_MAX_NUM]
static void aarch64_linux_child_post_startup_inferior(struct target_ops *self, ptid_t ptid)
ptid_t regcache_get_ptid(const struct regcache *regcache)
static int aarch64_linux_can_use_hw_breakpoint(struct target_ops *self, enum bptype type, int cnt, int othertype)
void regcache_supply_regset(const struct regset *regset, struct regcache *regcache, int regnum, const void *buf, size_t size)
static void add_show_debug_regs_command(void)
struct target_desc * tdesc_arm_with_neon
void aarch64_linux_delete_thread(struct arch_lwp_info *arch_lwp)
int(* to_remove_watchpoint)(struct target_ops *, CORE_ADDR, int, enum target_hw_bp_type, struct expression *) TARGET_DEFAULT_RETURN(-1)
int(* to_region_ok_for_hw_watchpoint)(struct target_ops *, CORE_ADDR, int) TARGET_DEFAULT_FUNC(default_region_ok_for_hw_watchpoint)
int(* to_can_use_hw_breakpoint)(struct target_ops *, enum bptype, int, int) TARGET_DEFAULT_RETURN(0)
int linux_nat_get_siginfo(ptid_t ptid, siginfo_t *siginfo)
void linux_nat_set_new_fork(struct target_ops *t, linux_nat_new_fork_ftype *new_fork)
void fill_fpregset(const struct regcache *regcache, gdb_fpregset_t *fpregsetp, int regno)
struct cmd_list_element * maintenance_set_cmdlist
static int aarch64_linux_stopped_data_address(struct target_ops *target, CORE_ADDR *addr_p)
int(* to_can_do_single_step)(struct target_ops *) TARGET_DEFAULT_RETURN(-1)
unsigned int aarch64_watchpoint_length(unsigned int ctrl)
static int aarch64_linux_region_ok_for_hw_watchpoint(struct target_ops *self, CORE_ADDR addr, int len)
void aarch64_linux_get_debug_reg_capacity(int tid)
void aarch32_vfp_regcache_supply(struct regcache *regcache, gdb_byte *regs, const int vfp_register_count)
int(* to_watchpoint_addr_within_range)(struct target_ops *, CORE_ADDR, CORE_ADDR, int) TARGET_DEFAULT_FUNC(default_watchpoint_addr_within_range)
static int aarch64_linux_insert_hw_breakpoint(struct target_ops *self, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
GDB_GREGSET_T gdb_gregset_t
void aarch64_compat_siginfo_from_siginfo(compat_siginfo_t *to, siginfo_t *from)
static struct aarch64_process_info * aarch64_add_process(pid_t pid)
static int aarch64_linux_can_do_single_step(struct target_ops *target)
static void store_fpregs_to_thread(const struct regcache *regcache)
void fprintf_unfiltered(struct ui_file *stream, const char *format,...)
static int aarch64_linux_insert_watchpoint(struct target_ops *self, CORE_ADDR addr, int len, enum target_hw_bp_type type, struct expression *cond)
#define gdb_assert_not_reached(message)
GDB_FPREGSET_T gdb_fpregset_t
void aarch64_linux_prepare_to_resume(struct lwp_info *lwp)
void supply_gregset(struct regcache *regcache, const gdb_gregset_t *gregsetp)
void linux_nat_set_prepare_to_resume(struct target_ops *t, void(*prepare_to_resume)(struct lwp_info *))
void regcache_collect_regset(const struct regset *regset, const struct regcache *regcache, int regnum, void *buf, size_t size)
static void aarch64_linux_store_inferior_registers(struct target_ops *ops, struct regcache *regcache, int regno)
void linux_nat_add_target(struct target_ops *t)
int(* to_insert_watchpoint)(struct target_ops *, CORE_ADDR, int, enum target_hw_bp_type, struct expression *) TARGET_DEFAULT_RETURN(-1)
static int aarch64_linux_watchpoint_addr_within_range(struct target_ops *target, CORE_ADDR addr, CORE_ADDR start, int length)
void _initialize_aarch64_linux_nat(void)
struct aarch64_process_info * next
struct target_ops * linux_target(void)
long ptid_get_lwp(const ptid_t &ptid)
int(* to_insert_hw_breakpoint)(struct target_ops *, struct gdbarch *, struct bp_target_info *) TARGET_DEFAULT_RETURN(-1)
static void aarch64_forget_process(pid_t pid)
void linux_nat_set_siginfo_fixup(struct target_ops *t, int(*siginfo_fixup)(siginfo_t *, gdb_byte *, int))
static struct aarch64_process_info * aarch64_process_info_get(pid_t pid)
const struct regset aarch64_linux_gregset
#define gdb_static_assert(expr)
struct aarch64_debug_reg_state * aarch64_get_debug_reg_state(pid_t pid)
int(* to_remove_hw_breakpoint)(struct target_ops *, struct gdbarch *, struct bp_target_info *) TARGET_DEFAULT_RETURN(-1)
static struct aarch64_process_info * aarch64_process_list
ps_err_e aarch64_ps_get_thread_area(struct ps_prochandle *ph, lwpid_t lwpid, int idx, void **base, int is_64bit_p)
void(* to_fetch_registers)(struct target_ops *, struct regcache *, int) TARGET_DEFAULT_IGNORE()
static void fetch_gregs_from_thread(struct regcache *regcache)
void void void void void void void void void perror_with_name(const char *string) ATTRIBUTE_NORETURN
enum register_status regcache_register_status(const struct regcache *regcache, int regnum)
static void aarch64_linux_fetch_inferior_registers(struct target_ops *ops, struct regcache *regcache, int regno)
#define AARCH64_LINUX_SIZEOF_FPREGSET
const gdb_byte * gdbarch_breakpoint_from_pc(struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
void add_setshow_boolean_cmd(const char *name, enum command_class theclass, int *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_const_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
static struct aarch64_process_info * aarch64_find_process_pid(pid_t pid)
int(* to_stopped_by_watchpoint)(struct target_ops *) TARGET_DEFAULT_RETURN(0)
int aarch64_linux_region_ok_for_watchpoint(CORE_ADDR addr, int len)
#define AARCH64_LINUX_SIZEOF_GREGSET
unsigned int dr_ctrl_wp[AARCH64_HWP_MAX_NUM]
void regcache_raw_supply(struct regcache *regcache, int regnum, const void *buf)
#define DR_CONTROL_ENABLED(ctrl)
void aarch32_vfp_regcache_collect(const struct regcache *regcache, gdb_byte *regs, const int vfp_register_count)
void aarch32_gp_regcache_supply(struct regcache *regcache, uint32_t *regs, int arm_apcs_32)
const struct bfd_arch_info * gdbarch_bfd_arch_info(struct gdbarch *gdbarch)
void regcache_raw_collect(const struct regcache *regcache, int regnum, void *buf)
struct aarch64_debug_reg_state state
static int aarch64_linux_stopped_by_watchpoint(struct target_ops *ops)
void linux_nat_set_forget_process(struct target_ops *t, linux_nat_forget_process_ftype *fn)
static int aarch64_linux_remove_hw_breakpoint(struct target_ops *self, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
int(* to_stopped_data_address)(struct target_ops *, CORE_ADDR *) TARGET_DEFAULT_RETURN(0)
static void(* super_post_startup_inferior)(struct target_ops *self, ptid_t ptid)
void(* to_store_registers)(struct target_ops *, struct regcache *, int) TARGET_DEFAULT_NORETURN(noprocess())
struct cmd_list_element * maintenance_show_cmdlist
void linux_nat_set_delete_thread(struct target_ops *t, void(*delete_thread)(struct arch_lwp_info *))
static void aarch64_linux_new_fork(struct lwp_info *parent, pid_t child_pid)
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)
const struct regset aarch64_linux_fpregset
void aarch64_siginfo_from_compat_siginfo(siginfo_t *to, compat_siginfo_t *from)
struct gdbarch * get_frame_arch(struct frame_info *this_frame)
void(* to_post_startup_inferior)(struct target_ops *, ptid_t) TARGET_DEFAULT_IGNORE()
void supply_fpregset(struct regcache *regcache, const gdb_fpregset_t *fpregsetp)
CORE_ADDR dr_addr_wp[AARCH64_HWP_MAX_NUM]