1 /* Native-dependent code for GNU/Linux AArch64.
3 Copyright (C) 2011-2015 Free Software Foundation, Inc.
4 Contributed by ARM Ltd.
6 This file is part of GDB.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
26 #include "linux-nat.h"
27 #include "target-descriptions.h"
30 #include "aarch64-tdep.h"
31 #include "aarch64-linux-tdep.h"
32 #include "aarch32-linux-nat.h"
33 #include "nat/aarch64-linux.h"
34 #include "nat/aarch64-linux-hw-point.h"
36 #include "elf/external.h"
37 #include "elf/common.h"
39 #include "nat/gdb_ptrace.h"
40 #include <sys/utsname.h>
41 #include <asm/ptrace.h>
45 /* Defines ps_err_e, struct ps_prochandle. */
46 #include "gdb_proc_service.h"
49 #define TRAP_HWBKPT 0x0004
52 /* Per-process data. We don't bind this to a per-inferior registry
53 because of targets like x86 GNU/Linux that need to keep track of
54 processes that aren't bound to any inferior (e.g., fork children,
57 struct aarch64_process_info
60 struct aarch64_process_info *next;
62 /* The process identifier. */
65 /* Copy of aarch64 hardware debug registers. */
66 struct aarch64_debug_reg_state state;
69 static struct aarch64_process_info *aarch64_process_list = NULL;
71 /* Find process data for process PID. */
73 static struct aarch64_process_info *
74 aarch64_find_process_pid (pid_t pid)
76 struct aarch64_process_info *proc;
78 for (proc = aarch64_process_list; proc; proc = proc->next)
85 /* Add process data for process PID. Returns newly allocated info
88 static struct aarch64_process_info *
89 aarch64_add_process (pid_t pid)
91 struct aarch64_process_info *proc;
93 proc = XCNEW (struct aarch64_process_info);
96 proc->next = aarch64_process_list;
97 aarch64_process_list = proc;
102 /* Get data specific info for process PID, creating it if necessary.
103 Never returns NULL. */
105 static struct aarch64_process_info *
106 aarch64_process_info_get (pid_t pid)
108 struct aarch64_process_info *proc;
110 proc = aarch64_find_process_pid (pid);
112 proc = aarch64_add_process (pid);
117 /* Called whenever GDB is no longer debugging process PID. It deletes
118 data structures that keep track of debug register state. */
121 aarch64_forget_process (pid_t pid)
123 struct aarch64_process_info *proc, **proc_link;
125 proc = aarch64_process_list;
126 proc_link = &aarch64_process_list;
130 if (proc->pid == pid)
132 *proc_link = proc->next;
138 proc_link = &proc->next;
143 /* Get debug registers state for process PID. */
145 struct aarch64_debug_reg_state *
146 aarch64_get_debug_reg_state (pid_t pid)
148 return &aarch64_process_info_get (pid)->state;
151 /* Fill GDB's register array with the general-purpose register values
152 from the current thread. */
155 fetch_gregs_from_thread (struct regcache *regcache)
158 struct gdbarch *gdbarch = get_regcache_arch (regcache);
162 /* Make sure REGS can hold all registers contents on both aarch64
164 gdb_static_assert (sizeof (regs) >= 18 * 4);
166 tid = ptid_get_lwp (inferior_ptid);
168 iovec.iov_base = ®s;
169 if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 32)
170 iovec.iov_len = 18 * 4;
172 iovec.iov_len = sizeof (regs);
174 ret = ptrace (PTRACE_GETREGSET, tid, NT_PRSTATUS, &iovec);
176 perror_with_name (_("Unable to fetch general registers."));
178 if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 32)
179 aarch32_gp_regcache_supply (regcache, (uint32_t *) regs, 1);
184 for (regno = AARCH64_X0_REGNUM; regno <= AARCH64_CPSR_REGNUM; regno++)
185 regcache_raw_supply (regcache, regno, ®s[regno - AARCH64_X0_REGNUM]);
189 /* Store to the current thread the valid general-purpose register
190 values in the GDB's register array. */
193 store_gregs_to_thread (const struct regcache *regcache)
198 struct gdbarch *gdbarch = get_regcache_arch (regcache);
200 /* Make sure REGS can hold all registers contents on both aarch64
202 gdb_static_assert (sizeof (regs) >= 18 * 4);
203 tid = ptid_get_lwp (inferior_ptid);
205 iovec.iov_base = ®s;
206 if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 32)
207 iovec.iov_len = 18 * 4;
209 iovec.iov_len = sizeof (regs);
211 ret = ptrace (PTRACE_GETREGSET, tid, NT_PRSTATUS, &iovec);
213 perror_with_name (_("Unable to fetch general registers."));
215 if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 32)
216 aarch32_gp_regcache_collect (regcache, (uint32_t *) regs, 1);
221 for (regno = AARCH64_X0_REGNUM; regno <= AARCH64_CPSR_REGNUM; regno++)
222 if (REG_VALID == regcache_register_status (regcache, regno))
223 regcache_raw_collect (regcache, regno,
224 ®s[regno - AARCH64_X0_REGNUM]);
227 ret = ptrace (PTRACE_SETREGSET, tid, NT_PRSTATUS, &iovec);
229 perror_with_name (_("Unable to store general registers."));
232 /* Fill GDB's register array with the fp/simd register values
233 from the current thread. */
236 fetch_fpregs_from_thread (struct regcache *regcache)
241 struct gdbarch *gdbarch = get_regcache_arch (regcache);
243 /* Make sure REGS can hold all VFP registers contents on both aarch64
245 gdb_static_assert (sizeof regs >= VFP_REGS_SIZE);
247 tid = ptid_get_lwp (inferior_ptid);
249 iovec.iov_base = ®s;
251 if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 32)
253 iovec.iov_len = VFP_REGS_SIZE;
255 ret = ptrace (PTRACE_GETREGSET, tid, NT_ARM_VFP, &iovec);
257 perror_with_name (_("Unable to fetch VFP registers."));
259 aarch32_vfp_regcache_supply (regcache, (gdb_byte *) ®s, 32);
265 iovec.iov_len = sizeof (regs);
267 ret = ptrace (PTRACE_GETREGSET, tid, NT_FPREGSET, &iovec);
269 perror_with_name (_("Unable to fetch vFP/SIMD registers."));
271 for (regno = AARCH64_V0_REGNUM; regno <= AARCH64_V31_REGNUM; regno++)
272 regcache_raw_supply (regcache, regno,
273 ®s.vregs[regno - AARCH64_V0_REGNUM]);
275 regcache_raw_supply (regcache, AARCH64_FPSR_REGNUM, ®s.fpsr);
276 regcache_raw_supply (regcache, AARCH64_FPCR_REGNUM, ®s.fpcr);
280 /* Store to the current thread the valid fp/simd register
281 values in the GDB's register array. */
284 store_fpregs_to_thread (const struct regcache *regcache)
289 struct gdbarch *gdbarch = get_regcache_arch (regcache);
291 /* Make sure REGS can hold all VFP registers contents on both aarch64
293 gdb_static_assert (sizeof regs >= VFP_REGS_SIZE);
294 tid = ptid_get_lwp (inferior_ptid);
296 iovec.iov_base = ®s;
298 if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 32)
300 iovec.iov_len = VFP_REGS_SIZE;
302 ret = ptrace (PTRACE_GETREGSET, tid, NT_ARM_VFP, &iovec);
304 perror_with_name (_("Unable to fetch VFP registers."));
306 aarch32_vfp_regcache_collect (regcache, (gdb_byte *) ®s, 32);
312 iovec.iov_len = sizeof (regs);
314 ret = ptrace (PTRACE_GETREGSET, tid, NT_FPREGSET, &iovec);
316 perror_with_name (_("Unable to fetch FP/SIMD registers."));
318 for (regno = AARCH64_V0_REGNUM; regno <= AARCH64_V31_REGNUM; regno++)
319 if (REG_VALID == regcache_register_status (regcache, regno))
320 regcache_raw_collect (regcache, regno,
321 (char *) ®s.vregs[regno - AARCH64_V0_REGNUM]);
323 if (REG_VALID == regcache_register_status (regcache, AARCH64_FPSR_REGNUM))
324 regcache_raw_collect (regcache, AARCH64_FPSR_REGNUM,
325 (char *) ®s.fpsr);
326 if (REG_VALID == regcache_register_status (regcache, AARCH64_FPCR_REGNUM))
327 regcache_raw_collect (regcache, AARCH64_FPCR_REGNUM,
328 (char *) ®s.fpcr);
331 if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 32)
333 ret = ptrace (PTRACE_SETREGSET, tid, NT_ARM_VFP, &iovec);
335 perror_with_name (_("Unable to store VFP registers."));
339 ret = ptrace (PTRACE_SETREGSET, tid, NT_FPREGSET, &iovec);
341 perror_with_name (_("Unable to store FP/SIMD registers."));
345 /* Implement the "to_fetch_register" target_ops method. */
348 aarch64_linux_fetch_inferior_registers (struct target_ops *ops,
349 struct regcache *regcache,
354 fetch_gregs_from_thread (regcache);
355 fetch_fpregs_from_thread (regcache);
357 else if (regno < AARCH64_V0_REGNUM)
358 fetch_gregs_from_thread (regcache);
360 fetch_fpregs_from_thread (regcache);
363 /* Implement the "to_store_register" target_ops method. */
366 aarch64_linux_store_inferior_registers (struct target_ops *ops,
367 struct regcache *regcache,
372 store_gregs_to_thread (regcache);
373 store_fpregs_to_thread (regcache);
375 else if (regno < AARCH64_V0_REGNUM)
376 store_gregs_to_thread (regcache);
378 store_fpregs_to_thread (regcache);
381 /* Fill register REGNO (if it is a general-purpose register) in
382 *GREGSETPS with the value in GDB's register array. If REGNO is -1,
383 do this for all registers. */
386 fill_gregset (const struct regcache *regcache,
387 gdb_gregset_t *gregsetp, int regno)
389 regcache_collect_regset (&aarch64_linux_gregset, regcache,
390 regno, (gdb_byte *) gregsetp,
391 AARCH64_LINUX_SIZEOF_GREGSET);
394 /* Fill GDB's register array with the general-purpose register values
398 supply_gregset (struct regcache *regcache, const gdb_gregset_t *gregsetp)
400 regcache_supply_regset (&aarch64_linux_gregset, regcache, -1,
401 (const gdb_byte *) gregsetp,
402 AARCH64_LINUX_SIZEOF_GREGSET);
405 /* Fill register REGNO (if it is a floating-point register) in
406 *FPREGSETP with the value in GDB's register array. If REGNO is -1,
407 do this for all registers. */
410 fill_fpregset (const struct regcache *regcache,
411 gdb_fpregset_t *fpregsetp, int regno)
413 regcache_collect_regset (&aarch64_linux_fpregset, regcache,
414 regno, (gdb_byte *) fpregsetp,
415 AARCH64_LINUX_SIZEOF_FPREGSET);
418 /* Fill GDB's register array with the floating-point register values
422 supply_fpregset (struct regcache *regcache, const gdb_fpregset_t *fpregsetp)
424 regcache_supply_regset (&aarch64_linux_fpregset, regcache, -1,
425 (const gdb_byte *) fpregsetp,
426 AARCH64_LINUX_SIZEOF_FPREGSET);
429 /* linux_nat_new_fork hook. */
432 aarch64_linux_new_fork (struct lwp_info *parent, pid_t child_pid)
435 struct aarch64_debug_reg_state *parent_state;
436 struct aarch64_debug_reg_state *child_state;
438 /* NULL means no watchpoint has ever been set in the parent. In
439 that case, there's nothing to do. */
440 if (parent->arch_private == NULL)
443 /* GDB core assumes the child inherits the watchpoints/hw
444 breakpoints of the parent, and will remove them all from the
445 forked off process. Copy the debug registers mirrors into the
446 new process so that all breakpoints and watchpoints can be
449 parent_pid = ptid_get_pid (parent->ptid);
450 parent_state = aarch64_get_debug_reg_state (parent_pid);
451 child_state = aarch64_get_debug_reg_state (child_pid);
452 *child_state = *parent_state;
456 /* Called by libthread_db. Returns a pointer to the thread local
457 storage (or its descriptor). */
460 ps_get_thread_area (const struct ps_prochandle *ph,
461 lwpid_t lwpid, int idx, void **base)
466 iovec.iov_base = ®
467 iovec.iov_len = sizeof (reg);
469 if (ptrace (PTRACE_GETREGSET, lwpid, NT_ARM_TLS, &iovec) != 0)
472 /* IDX is the bias from the thread pointer to the beginning of the
473 thread descriptor. It has to be subtracted due to implementation
474 quirks in libthread_db. */
475 *base = (void *) (reg - idx);
481 static void (*super_post_startup_inferior) (struct target_ops *self,
484 /* Implement the "to_post_startup_inferior" target_ops method. */
487 aarch64_linux_child_post_startup_inferior (struct target_ops *self,
490 aarch64_forget_process (ptid_get_pid (ptid));
491 aarch64_linux_get_debug_reg_capacity (ptid_get_pid (ptid));
492 super_post_startup_inferior (self, ptid);
495 extern struct target_desc *tdesc_arm_with_vfpv3;
496 extern struct target_desc *tdesc_arm_with_neon;
498 /* Implement the "to_read_description" target_ops method. */
500 static const struct target_desc *
501 aarch64_linux_read_description (struct target_ops *ops)
505 if (target_auxv_search (ops, AT_PHENT, &at_phent) == 1)
507 if (at_phent == sizeof (Elf64_External_Phdr))
508 return tdesc_aarch64;
511 CORE_ADDR arm_hwcap = 0;
513 if (target_auxv_search (ops, AT_HWCAP, &arm_hwcap) != 1)
514 return ops->beneath->to_read_description (ops->beneath);
516 #ifndef COMPAT_HWCAP_VFP
517 #define COMPAT_HWCAP_VFP (1 << 6)
519 #ifndef COMPAT_HWCAP_NEON
520 #define COMPAT_HWCAP_NEON (1 << 12)
522 #ifndef COMPAT_HWCAP_VFPv3
523 #define COMPAT_HWCAP_VFPv3 (1 << 13)
526 if (arm_hwcap & COMPAT_HWCAP_VFP)
529 const struct target_desc *result = NULL;
531 if (arm_hwcap & COMPAT_HWCAP_NEON)
532 result = tdesc_arm_with_neon;
533 else if (arm_hwcap & COMPAT_HWCAP_VFPv3)
534 result = tdesc_arm_with_vfpv3;
543 return tdesc_aarch64;
546 /* Convert a native/host siginfo object, into/from the siginfo in the
547 layout of the inferiors' architecture. Returns true if any
548 conversion was done; false otherwise. If DIRECTION is 1, then copy
549 from INF to NATIVE. If DIRECTION is 0, copy from NATIVE to
553 aarch64_linux_siginfo_fixup (siginfo_t *native, gdb_byte *inf, int direction)
555 struct gdbarch *gdbarch = get_frame_arch (get_current_frame ());
557 /* Is the inferior 32-bit? If so, then do fixup the siginfo
559 if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 32)
562 aarch64_compat_siginfo_from_siginfo ((struct compat_siginfo *) inf,
565 aarch64_siginfo_from_compat_siginfo (native,
566 (struct compat_siginfo *) inf);
574 /* Returns the number of hardware watchpoints of type TYPE that we can
575 set. Value is positive if we can set CNT watchpoints, zero if
576 setting watchpoints of type TYPE is not supported, and negative if
577 CNT is more than the maximum number of watchpoints of type TYPE
578 that we can support. TYPE is one of bp_hardware_watchpoint,
579 bp_read_watchpoint, bp_write_watchpoint, or bp_hardware_breakpoint.
580 CNT is the number of such watchpoints used so far (including this
581 one). OTHERTYPE is non-zero if other types of watchpoints are
582 currently enabled. */
585 aarch64_linux_can_use_hw_breakpoint (struct target_ops *self,
587 int cnt, int othertype)
589 if (type == bp_hardware_watchpoint || type == bp_read_watchpoint
590 || type == bp_access_watchpoint || type == bp_watchpoint)
592 if (aarch64_num_wp_regs == 0)
595 else if (type == bp_hardware_breakpoint)
597 if (aarch64_num_bp_regs == 0)
601 gdb_assert_not_reached ("unexpected breakpoint type");
603 /* We always return 1 here because we don't have enough information
604 about possible overlap of addresses that they want to watch. As an
605 extreme example, consider the case where all the watchpoints watch
606 the same address and the same region length: then we can handle a
607 virtually unlimited number of watchpoints, due to debug register
608 sharing implemented via reference counts. */
612 /* Insert a hardware-assisted breakpoint at BP_TGT->reqstd_address.
613 Return 0 on success, -1 on failure. */
616 aarch64_linux_insert_hw_breakpoint (struct target_ops *self,
617 struct gdbarch *gdbarch,
618 struct bp_target_info *bp_tgt)
621 CORE_ADDR addr = bp_tgt->placed_address = bp_tgt->reqstd_address;
623 const enum target_hw_bp_type type = hw_execute;
624 struct aarch64_debug_reg_state *state
625 = aarch64_get_debug_reg_state (ptid_get_pid (inferior_ptid));
630 "insert_hw_breakpoint on entry (addr=0x%08lx, len=%d))\n",
631 (unsigned long) addr, len);
633 ret = aarch64_handle_breakpoint (type, addr, len, 1 /* is_insert */, state);
637 aarch64_show_debug_reg_state (state,
638 "insert_hw_breakpoint", addr, len, type);
644 /* Remove a hardware-assisted breakpoint at BP_TGT->placed_address.
645 Return 0 on success, -1 on failure. */
648 aarch64_linux_remove_hw_breakpoint (struct target_ops *self,
649 struct gdbarch *gdbarch,
650 struct bp_target_info *bp_tgt)
653 CORE_ADDR addr = bp_tgt->placed_address;
655 const enum target_hw_bp_type type = hw_execute;
656 struct aarch64_debug_reg_state *state
657 = aarch64_get_debug_reg_state (ptid_get_pid (inferior_ptid));
661 (gdb_stdlog, "remove_hw_breakpoint on entry (addr=0x%08lx, len=%d))\n",
662 (unsigned long) addr, len);
664 ret = aarch64_handle_breakpoint (type, addr, len, 0 /* is_insert */, state);
668 aarch64_show_debug_reg_state (state,
669 "remove_hw_watchpoint", addr, len, type);
675 /* Implement the "to_insert_watchpoint" target_ops method.
677 Insert a watchpoint to watch a memory region which starts at
678 address ADDR and whose length is LEN bytes. Watch memory accesses
679 of the type TYPE. Return 0 on success, -1 on failure. */
682 aarch64_linux_insert_watchpoint (struct target_ops *self,
683 CORE_ADDR addr, int len,
684 enum target_hw_bp_type type,
685 struct expression *cond)
688 struct aarch64_debug_reg_state *state
689 = aarch64_get_debug_reg_state (ptid_get_pid (inferior_ptid));
692 fprintf_unfiltered (gdb_stdlog,
693 "insert_watchpoint on entry (addr=0x%08lx, len=%d)\n",
694 (unsigned long) addr, len);
696 gdb_assert (type != hw_execute);
698 ret = aarch64_handle_watchpoint (type, addr, len, 1 /* is_insert */, state);
702 aarch64_show_debug_reg_state (state,
703 "insert_watchpoint", addr, len, type);
709 /* Implement the "to_remove_watchpoint" target_ops method.
710 Remove a watchpoint that watched the memory region which starts at
711 address ADDR, whose length is LEN bytes, and for accesses of the
712 type TYPE. Return 0 on success, -1 on failure. */
715 aarch64_linux_remove_watchpoint (struct target_ops *self,
716 CORE_ADDR addr, int len,
717 enum target_hw_bp_type type,
718 struct expression *cond)
721 struct aarch64_debug_reg_state *state
722 = aarch64_get_debug_reg_state (ptid_get_pid (inferior_ptid));
725 fprintf_unfiltered (gdb_stdlog,
726 "remove_watchpoint on entry (addr=0x%08lx, len=%d)\n",
727 (unsigned long) addr, len);
729 gdb_assert (type != hw_execute);
731 ret = aarch64_handle_watchpoint (type, addr, len, 0 /* is_insert */, state);
735 aarch64_show_debug_reg_state (state,
736 "remove_watchpoint", addr, len, type);
742 /* Implement the "to_region_ok_for_hw_watchpoint" target_ops method. */
745 aarch64_linux_region_ok_for_hw_watchpoint (struct target_ops *self,
746 CORE_ADDR addr, int len)
748 return aarch64_linux_region_ok_for_watchpoint (addr, len);
751 /* Implement the "to_stopped_data_address" target_ops method. */
754 aarch64_linux_stopped_data_address (struct target_ops *target,
759 struct aarch64_debug_reg_state *state;
761 if (!linux_nat_get_siginfo (inferior_ptid, &siginfo))
764 /* This must be a hardware breakpoint. */
765 if (siginfo.si_signo != SIGTRAP
766 || (siginfo.si_code & 0xffff) != TRAP_HWBKPT)
769 /* Check if the address matches any watched address. */
770 state = aarch64_get_debug_reg_state (ptid_get_pid (inferior_ptid));
771 for (i = aarch64_num_wp_regs - 1; i >= 0; --i)
773 const unsigned int len = aarch64_watchpoint_length (state->dr_ctrl_wp[i]);
774 const CORE_ADDR addr_trap = (CORE_ADDR) siginfo.si_addr;
775 const CORE_ADDR addr_watch = state->dr_addr_wp[i];
777 if (state->dr_ref_count_wp[i]
778 && DR_CONTROL_ENABLED (state->dr_ctrl_wp[i])
779 && addr_trap >= addr_watch
780 && addr_trap < addr_watch + len)
790 /* Implement the "to_stopped_by_watchpoint" target_ops method. */
793 aarch64_linux_stopped_by_watchpoint (struct target_ops *ops)
797 return aarch64_linux_stopped_data_address (ops, &addr);
800 /* Implement the "to_watchpoint_addr_within_range" target_ops method. */
803 aarch64_linux_watchpoint_addr_within_range (struct target_ops *target,
805 CORE_ADDR start, int length)
807 return start <= addr && start + length - 1 >= addr;
810 /* Define AArch64 maintenance commands. */
813 add_show_debug_regs_command (void)
815 /* A maintenance command to enable printing the internal DRi mirror
817 add_setshow_boolean_cmd ("show-debug-regs", class_maintenance,
818 &show_debug_regs, _("\
819 Set whether to show variables that mirror the AArch64 debug registers."), _("\
820 Show whether to show variables that mirror the AArch64 debug registers."), _("\
821 Use \"on\" to enable, \"off\" to disable.\n\
822 If enabled, the debug registers values are shown when GDB inserts\n\
823 or removes a hardware breakpoint or watchpoint, and when the inferior\n\
824 triggers a breakpoint or watchpoint."),
827 &maintenance_set_cmdlist,
828 &maintenance_show_cmdlist);
831 /* -Wmissing-prototypes. */
832 void _initialize_aarch64_linux_nat (void);
835 _initialize_aarch64_linux_nat (void)
837 struct target_ops *t;
839 /* Fill in the generic GNU/Linux methods. */
842 add_show_debug_regs_command ();
844 /* Add our register access methods. */
845 t->to_fetch_registers = aarch64_linux_fetch_inferior_registers;
846 t->to_store_registers = aarch64_linux_store_inferior_registers;
848 t->to_read_description = aarch64_linux_read_description;
850 t->to_can_use_hw_breakpoint = aarch64_linux_can_use_hw_breakpoint;
851 t->to_insert_hw_breakpoint = aarch64_linux_insert_hw_breakpoint;
852 t->to_remove_hw_breakpoint = aarch64_linux_remove_hw_breakpoint;
853 t->to_region_ok_for_hw_watchpoint =
854 aarch64_linux_region_ok_for_hw_watchpoint;
855 t->to_insert_watchpoint = aarch64_linux_insert_watchpoint;
856 t->to_remove_watchpoint = aarch64_linux_remove_watchpoint;
857 t->to_stopped_by_watchpoint = aarch64_linux_stopped_by_watchpoint;
858 t->to_stopped_data_address = aarch64_linux_stopped_data_address;
859 t->to_watchpoint_addr_within_range =
860 aarch64_linux_watchpoint_addr_within_range;
862 /* Override the GNU/Linux inferior startup hook. */
863 super_post_startup_inferior = t->to_post_startup_inferior;
864 t->to_post_startup_inferior = aarch64_linux_child_post_startup_inferior;
866 /* Register the target. */
867 linux_nat_add_target (t);
868 linux_nat_set_new_thread (t, aarch64_linux_new_thread);
869 linux_nat_set_new_fork (t, aarch64_linux_new_fork);
870 linux_nat_set_forget_process (t, aarch64_forget_process);
871 linux_nat_set_prepare_to_resume (t, aarch64_linux_prepare_to_resume);
873 /* Add our siginfo layout converter. */
874 linux_nat_set_siginfo_fixup (t, aarch64_linux_siginfo_fixup);