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] amd64-linux-nat: Use ptid from regcache instead of inferior_ptid


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

commit 6a06fbb7b73fe55d6b9057f8154652e1ae8f883c
Author: Simon Marchi <simon.marchi@polymtl.ca>
Date:   Mon Mar 13 18:51:39 2017 -0400

    amd64-linux-nat: Use ptid from regcache instead of inferior_ptid
    
    gdb/ChangeLog:
    
    	* amd64-linux-nat.c (amd64_linux_fetch_inferior_registers,
    	amd64_linux_fetch_inferior_registers): Use regcache->ptid
    	instead of inferior_ptid.

Diff:
---
 gdb/ChangeLog         | 6 ++++++
 gdb/amd64-linux-nat.c | 8 ++++----
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index f8cb947..6f25b87 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
 2017-03-13  Simon Marchi  <simon.marchi@polymtl.ca>
 
+	* amd64-linux-nat.c (amd64_linux_fetch_inferior_registers,
+	amd64_linux_fetch_inferior_registers): Use regcache->ptid
+	instead of inferior_ptid.
+
+2017-03-13  Simon Marchi  <simon.marchi@polymtl.ca>
+
 	* target.c (target_fetch_registers, target_store_registers): Add
 	assert.
 
diff --git a/gdb/amd64-linux-nat.c b/gdb/amd64-linux-nat.c
index 4a429ec..d24c028 100644
--- a/gdb/amd64-linux-nat.c
+++ b/gdb/amd64-linux-nat.c
@@ -138,9 +138,9 @@ amd64_linux_fetch_inferior_registers (struct target_ops *ops,
   int tid;
 
   /* GNU/Linux LWP ID's are process ID's.  */
-  tid = ptid_get_lwp (inferior_ptid);
+  tid = ptid_get_lwp (regcache_get_ptid (regcache));
   if (tid == 0)
-    tid = ptid_get_pid (inferior_ptid); /* Not a threaded program.  */
+    tid = ptid_get_pid (regcache_get_ptid (regcache)); /* Not a threaded program.  */
 
   if (regnum == -1 || amd64_native_gregset_supplies_p (gdbarch, regnum))
     {
@@ -217,9 +217,9 @@ amd64_linux_store_inferior_registers (struct target_ops *ops,
   int tid;
 
   /* GNU/Linux LWP ID's are process ID's.  */
-  tid = ptid_get_lwp (inferior_ptid);
+  tid = ptid_get_lwp (regcache_get_ptid (regcache));
   if (tid == 0)
-    tid = ptid_get_pid (inferior_ptid); /* Not a threaded program.  */
+    tid = ptid_get_pid (regcache_get_ptid (regcache)); /* Not a threaded program.  */
 
   if (regnum == -1 || amd64_native_gregset_supplies_p (gdbarch, regnum))
     {


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