diff options
Diffstat (limited to 'gdb/mips64-obsd-nat.c')
-rw-r--r-- | gdb/mips64-obsd-nat.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/gdb/mips64-obsd-nat.c b/gdb/mips64-obsd-nat.c index 97af421..d32af80 100644 --- a/gdb/mips64-obsd-nat.c +++ b/gdb/mips64-obsd-nat.c @@ -82,9 +82,9 @@ mips64obsd_fetch_inferior_registers (struct target_ops *ops, struct regcache *regcache, int regnum) { struct reg regs; + pid_t pid = ptid_get_pid (regcache_get_ptid (regcache)); - if (ptrace (PT_GETREGS, ptid_get_pid (inferior_ptid), - (PTRACE_TYPE_ARG3) ®s, 0) == -1) + if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name (_("Couldn't get registers")); mips64obsd_supply_gregset (regcache, ®s); @@ -98,15 +98,14 @@ mips64obsd_store_inferior_registers (struct target_ops *ops, struct regcache *regcache, int regnum) { struct reg regs; + pid_t pid = ptid_get_pid (regcache_get_ptid (regcache)); - if (ptrace (PT_GETREGS, ptid_get_pid (inferior_ptid), - (PTRACE_TYPE_ARG3) ®s, 0) == -1) + if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name (_("Couldn't get registers")); mips64obsd_collect_gregset (regcache, ®s, regnum); - if (ptrace (PT_SETREGS, ptid_get_pid (inferior_ptid), - (PTRACE_TYPE_ARG3) ®s, 0) == -1) + if (ptrace (PT_SETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name (_("Couldn't write registers")); } |