diff options
Diffstat (limited to 'gdb/ppc-linux-nat.c')
-rw-r--r-- | gdb/ppc-linux-nat.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c index a56d154..142fa31 100644 --- a/gdb/ppc-linux-nat.c +++ b/gdb/ppc-linux-nat.c @@ -34,6 +34,7 @@ #include <fcntl.h> #include <sys/procfs.h> #include "nat/gdb_ptrace.h" +#include "inf-ptrace.h" /* Prototypes for supply_gregset etc. */ #include "gregset.h" @@ -809,12 +810,7 @@ static void ppc_linux_fetch_inferior_registers (struct target_ops *ops, struct regcache *regcache, int regno) { - /* Overload thread id onto process id. */ - int tid = ptid_get_lwp (inferior_ptid); - - /* No thread id, just use process id. */ - if (tid == 0) - tid = ptid_get_pid (inferior_ptid); + pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache)); if (regno == -1) fetch_ppc_registers (regcache, tid); @@ -2291,12 +2287,7 @@ static void ppc_linux_store_inferior_registers (struct target_ops *ops, struct regcache *regcache, int regno) { - /* Overload thread id onto process id. */ - int tid = ptid_get_lwp (inferior_ptid); - - /* No thread id, just use process id. */ - if (tid == 0) - tid = ptid_get_pid (inferior_ptid); + pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache)); if (regno >= 0) store_register (regcache, tid, regno); |