]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
i386-gnu-nat: Use ptid from regcache instead of inferior_ptid
authorSimon Marchi <simon.marchi@polymtl.ca>
Fri, 17 Mar 2017 17:55:57 +0000 (13:55 -0400)
committerSimon Marchi <simon.marchi@ericsson.com>
Fri, 17 Mar 2017 17:55:57 +0000 (13:55 -0400)
gdb/ChangeLog:

* i386-gnu-nat.c (gnu_fetch_registers, gnu_store_registers): Use
ptid from regcache.

gdb/ChangeLog
gdb/i386-gnu-nat.c

index 04bd708c6e3e44b56870b2e31af2cbae15325474..90613479671b63b458a52febb98a686031444988 100644 (file)
@@ -1,3 +1,8 @@
+2017-03-17  Simon Marchi  <simon.marchi@polymtl.ca>
+
+       * i386-gnu-nat.c (gnu_fetch_registers, gnu_store_registers): Use
+       ptid from regcache.
+
 2017-03-17  Simon Marchi  <simon.marchi@polymtl.ca>
 
        * i386-darwin-nat.c (i386_darwin_fetch_inferior_registers,
index 6953eeb78e1bc973337cc8d54a50a2c1424d7b0e..3bce88a20608c1c3575a03491112c389d8f71e99 100644 (file)
@@ -91,15 +91,15 @@ gnu_fetch_registers (struct target_ops *ops,
                     struct regcache *regcache, int regno)
 {
   struct proc *thread;
+  ptid_t ptid = regcache_get_ptid (regcache);
 
   /* Make sure we know about new threads.  */
   inf_update_procs (gnu_current_inf);
 
-  thread = inf_tid_to_thread (gnu_current_inf,
-                             ptid_get_lwp (inferior_ptid));
+  thread = inf_tid_to_thread (gnu_current_inf, ptid_get_lwp (ptid));
   if (!thread)
     error (_("Can't fetch registers from thread %s: No such thread"),
-          target_pid_to_str (inferior_ptid));
+          target_pid_to_str (ptid));
 
   if (regno < I386_NUM_GREGS || regno == -1)
     {
@@ -184,15 +184,15 @@ gnu_store_registers (struct target_ops *ops,
 {
   struct proc *thread;
   struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  ptid_t ptid = regcache_get_ptid (regcache);
 
   /* Make sure we know about new threads.  */
   inf_update_procs (gnu_current_inf);
 
-  thread = inf_tid_to_thread (gnu_current_inf,
-                             ptid_get_lwp (inferior_ptid));
+  thread = inf_tid_to_thread (gnu_current_inf, ptid_get_lwp (ptid));
   if (!thread)
     error (_("Couldn't store registers into thread %s: No such thread"),
-          target_pid_to_str (inferior_ptid));
+          target_pid_to_str (ptid));
 
   if (regno < I386_NUM_GREGS || regno == -1)
     {