This is the mail archive of the gdb-cvs@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]

[binutils-gdb] Pass ptid to aarch64_linux_get_debug_reg_capacity


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0f4576e3582f097cd257339d9395e88d07031002

commit 0f4576e3582f097cd257339d9395e88d07031002
Author: Yao Qi <yao.qi@linaro.org>
Date:   Thu Jul 9 12:55:45 2015 +0100

    Pass ptid to aarch64_linux_get_debug_reg_capacity
    
    This patch is to pass ptid to aarch64_linux_get_debug_reg_capacity,
    and stop using global variable inferior_ptid.
    
    gdb:
    
    2015-07-09  Yao Qi  <yao.qi@linaro.org>
    
    	* aarch64-linux-nat.c (aarch64_linux_get_debug_reg_capacity): Add
    	argument ptid.  Update comments.  Caller update.

Diff:
---
 gdb/ChangeLog           | 5 +++++
 gdb/aarch64-linux-nat.c | 9 +++++----
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 2e8de89..c7d0ddc 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2015-07-09  Yao Qi  <yao.qi@linaro.org>
+
+	* aarch64-linux-nat.c (aarch64_linux_get_debug_reg_capacity): Add
+	argument ptid.  Update comments.  Caller update.
+
 2015-07-09  Markus Metzger  <markus.t.metzger@intel.com>
 
 	* btrace.c (pt_print_packet): Print stop, vmcs, tma, mtc, cyc, and
diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c
index d48624f..c4ddad5 100644
--- a/gdb/aarch64-linux-nat.c
+++ b/gdb/aarch64-linux-nat.c
@@ -838,16 +838,17 @@ ps_get_thread_area (const struct ps_prochandle *ph,
 }
 
 
-/* Get the hardware debug register capacity information.  */
+/* Get the hardware debug register capacity information from the
+   inferior represented by PTID.  */
 
 static void
-aarch64_linux_get_debug_reg_capacity (void)
+aarch64_linux_get_debug_reg_capacity (ptid_t ptid)
 {
   int tid;
   struct iovec iov;
   struct user_hwdebug_state dreg_state;
 
-  tid = get_thread_id (inferior_ptid);
+  tid = get_thread_id (ptid);
   iov.iov_base = &dreg_state;
   iov.iov_len = sizeof (dreg_state);
 
@@ -902,7 +903,7 @@ aarch64_linux_child_post_startup_inferior (struct target_ops *self,
 					   ptid_t ptid)
 {
   aarch64_forget_process (ptid_get_pid (ptid));
-  aarch64_linux_get_debug_reg_capacity ();
+  aarch64_linux_get_debug_reg_capacity (ptid);
   super_post_startup_inferior (self, ptid);
 }


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