This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [native AAarch64 GNU/Linux] Access debug register mirror from the corresponding process.


On 02/13/13 16:01, Pedro Alves wrote:
On 02/13/2013 03:21 PM, Marcus Shawcroft wrote:
I'll send you an aarch64 version of this patch, unless you've
already started porting the necessary bits over.

We were just about to get started... but if you have a patch in hand that would be great!

Here it is. Completely untested, of course. But hopefully not too far off.

Not far off at all; thanks! I have tested your patch and made some further changes; please find the attached patch. The two patches together seem to be working.


Thanks,
Yufeng
diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c
index 89055f4..846f156 100644
--- a/gdb/aarch64-linux-nat.c
+++ b/gdb/aarch64-linux-nat.c
@@ -336,7 +336,7 @@ struct aarch64_dr_update_callback_param
   unsigned int idx;
 };
 
-/* Callback for linux_nat_iterate_watchpoint_lwps.  Records the
+/* Callback for iterate_over_lwps.  Records the
    information about the change of one hardware breakpoint/watchpoint
    setting for the thread LWP.
    The information is passed in via PTR.
@@ -410,12 +410,12 @@ aarch64_notify_debug_reg_change (const struct aarch64_debug_reg_state *state,
 				 int is_watchpoint, unsigned int idx)
 {
   struct aarch64_dr_update_callback_param param;
+  ptid_t pid_ptid = pid_to_ptid (ptid_get_pid (inferior_ptid));
 
   param.is_watchpoint = is_watchpoint;
   param.idx = idx;
 
-  linux_nat_iterate_watchpoint_lwps (debug_reg_change_callback,
-				     (void *) &param);
+  iterate_over_lwps (pid_ptid, debug_reg_change_callback, (void *) &param);
 }
 
 /* Print the values of the cached breakpoint/watchpoint registers.  */
@@ -739,8 +739,8 @@ aarch64_linux_new_fork (struct lwp_info *parent, pid_t child_pid)
      removed together.  */
 
   parent_pid = ptid_get_pid (parent->ptid);
-  parent_state = i386_debug_reg_state (parent_pid);
-  child_state = i386_debug_reg_state (child_pid);
+  parent_state = aarch64_get_debug_reg_state (parent_pid);
+  child_state = aarch64_get_debug_reg_state (child_pid);
   *child_state = *parent_state;
 }
 
@@ -1540,10 +1540,6 @@ _initialize_aarch64_linux_nat (void)
   t->to_stopped_data_address = aarch64_linux_stopped_data_address;
   t->to_watchpoint_addr_within_range =
     aarch64_linux_watchpoint_addr_within_range;
-  if (aarch64_inferior_data == NULL)
-    aarch64_inferior_data
-      = register_inferior_data_with_cleanup (NULL,
-					     aarch64_inferior_data_cleanup);
 
   /* Override the GNU/Linux inferior startup hook.  */
   super_post_startup_inferior = t->to_post_startup_inferior;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]