This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] i386-gnu-nat: Use ptid from regcache instead of inferior_ptid
- From: Simon Marchi <simark at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 17 Mar 2017 17:57:47 -0000
- Subject: [binutils-gdb] i386-gnu-nat: Use ptid from regcache instead of inferior_ptid
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d9cb6cdcfa12368f2f639f8cd06d18b94bd98a39
commit d9cb6cdcfa12368f2f639f8cd06d18b94bd98a39
Author: Simon Marchi <simon.marchi@polymtl.ca>
Date: Fri Mar 17 13:55:57 2017 -0400
i386-gnu-nat: Use ptid from regcache instead of inferior_ptid
gdb/ChangeLog:
* i386-gnu-nat.c (gnu_fetch_registers, gnu_store_registers): Use
ptid from regcache.
Diff:
---
gdb/ChangeLog | 5 +++++
gdb/i386-gnu-nat.c | 12 ++++++------
2 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 04bd708..9061347 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
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,
i386_darwin_store_inferior_registers): Use ptid from regcache.
diff --git a/gdb/i386-gnu-nat.c b/gdb/i386-gnu-nat.c
index 6953eeb..3bce88a 100644
--- a/gdb/i386-gnu-nat.c
+++ b/gdb/i386-gnu-nat.c
@@ -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)
{