Enable hardware watchpoints on attach for aarch64
[deliverable/binutils-gdb.git] / gdb / aarch64-linux-nat.c
index 1e7db2920b9119dc925bc5fcf4642def85748446..c9fd062cd9d9f0bafe7fb50c142ced5a6eac0911 100644 (file)
@@ -77,6 +77,9 @@ public:
   /* 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); }
@@ -568,6 +571,21 @@ aarch64_linux_nat_target::post_startup_inferior (ptid_t ptid)
   linux_nat_target::post_startup_inferior (ptid);
 }
 
+/* Implement the "post_attach" target_ops method.  */
+
+void
+aarch64_linux_nat_target::post_attach (int 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.  */
+  aarch64_linux_get_debug_reg_capacity (pid);
+  linux_nat_target::post_attach (pid);
+}
+
 extern struct target_desc *tdesc_arm_with_neon;
 
 /* Implement the "read_description" target_ops method.  */
This page took 0.031754 seconds and 4 git commands to generate.