aboutsummaryrefslogtreecommitdiff
path: root/gdb/aarch64-linux-nat.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/aarch64-linux-nat.c')
-rw-r--r--gdb/aarch64-linux-nat.c32
1 files changed, 8 insertions, 24 deletions
diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c
index 4b2a0ba..2e6541f 100644
--- a/gdb/aarch64-linux-nat.c
+++ b/gdb/aarch64-linux-nat.c
@@ -78,12 +78,6 @@ public:
int can_do_single_step () override;
- /* Override the GNU/Linux inferior startup hook. */
- void post_startup_inferior (ptid_t) override;
-
- /* Override the GNU/Linux post attach hook. */
- void post_attach (int pid) override;
-
/* These three defer to common nat/ code. */
void low_new_thread (struct lwp_info *lp) override
{ aarch64_linux_new_thread (lp); }
@@ -93,6 +87,7 @@ public:
{ aarch64_linux_prepare_to_resume (lp); }
void low_new_fork (struct lwp_info *parent, pid_t child_pid) override;
+ void low_init_process (pid_t pid) override;
void low_forget_process (pid_t pid) override;
/* Add our siginfo layout converter. */
@@ -844,29 +839,18 @@ ps_get_thread_area (struct ps_prochandle *ph,
}
-/* Implement the virtual inf_ptrace_target::post_startup_inferior method. */
-
-void
-aarch64_linux_nat_target::post_startup_inferior (ptid_t ptid)
-{
- low_forget_process (ptid.pid ());
- aarch64_linux_get_debug_reg_capacity (ptid.pid ());
- linux_nat_target::post_startup_inferior (ptid);
-}
-
-/* Implement the "post_attach" target_ops method. */
+/* Implement the "low_init_process" target_ops method. */
void
-aarch64_linux_nat_target::post_attach (int pid)
+aarch64_linux_nat_target::low_init_process (pid_t pid)
{
low_forget_process (pid);
- /* Set the hardware debug register capacity. If
- aarch64_linux_get_debug_reg_capacity is not called
- (as it is in aarch64_linux_child_post_startup_inferior) then
- software watchpoints will be used instead of hardware
- watchpoints when attaching to a target. */
+ /* Set the hardware debug register capacity. This requires the process to be
+ ptrace-stopped, otherwise detection will fail and software watchpoints will
+ be used instead of hardware. If we allow this to be done lazily, we
+ cannot guarantee that it's called when the process is ptrace-stopped, so
+ do it now. */
aarch64_linux_get_debug_reg_capacity (pid);
- linux_nat_target::post_attach (pid);
}
/* Implement the "read_description" target_ops method. */