summaryrefslogtreecommitdiff
path: root/gdb/mips64-obsd-nat.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/mips64-obsd-nat.c')
-rw-r--r--gdb/mips64-obsd-nat.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/gdb/mips64-obsd-nat.c b/gdb/mips64-obsd-nat.c
index 97af421981a..d32af80da09 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) &regs, 0) == -1)
+ if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) &regs, 0) == -1)
perror_with_name (_("Couldn't get registers"));
mips64obsd_supply_gregset (regcache, &regs);
@@ -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) &regs, 0) == -1)
+ if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) &regs, 0) == -1)
perror_with_name (_("Couldn't get registers"));
mips64obsd_collect_gregset (regcache, &regs, regnum);
- if (ptrace (PT_SETREGS, ptid_get_pid (inferior_ptid),
- (PTRACE_TYPE_ARG3) &regs, 0) == -1)
+ if (ptrace (PT_SETREGS, pid, (PTRACE_TYPE_ARG3) &regs, 0) == -1)
perror_with_name (_("Couldn't write registers"));
}