aboutsummaryrefslogtreecommitdiff
path: root/gdb/mips-fbsd-nat.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/mips-fbsd-nat.c')
-rw-r--r--gdb/mips-fbsd-nat.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/gdb/mips-fbsd-nat.c b/gdb/mips-fbsd-nat.c
index 0472df8..078df52 100644
--- a/gdb/mips-fbsd-nat.c
+++ b/gdb/mips-fbsd-nat.c
@@ -47,13 +47,14 @@ static void
mips_fbsd_fetch_inferior_registers (struct target_ops *ops,
struct regcache *regcache, int regnum)
{
+ pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache));
+
struct gdbarch *gdbarch = get_regcache_arch (regcache);
if (regnum == -1 || getregs_supplies (gdbarch, regnum))
{
struct reg regs;
- if (ptrace (PT_GETREGS, get_ptrace_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"));
mips_fbsd_supply_gregs (regcache, regnum, &regs, sizeof (register_t));
@@ -66,8 +67,7 @@ mips_fbsd_fetch_inferior_registers (struct target_ops *ops,
{
struct fpreg fpregs;
- if (ptrace (PT_GETFPREGS, get_ptrace_pid (inferior_ptid),
- (PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
+ if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
perror_with_name (_("Couldn't get floating point status"));
mips_fbsd_supply_fpregs (regcache, regnum, &fpregs,
@@ -82,20 +82,20 @@ static void
mips_fbsd_store_inferior_registers (struct target_ops *ops,
struct regcache *regcache, int regnum)
{
+ pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache));
+
struct gdbarch *gdbarch = get_regcache_arch (regcache);
if (regnum == -1 || getregs_supplies (gdbarch, regnum))
{
struct reg regs;
- if (ptrace (PT_GETREGS, get_ptrace_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"));
mips_fbsd_collect_gregs (regcache, regnum, (char *) &regs,
sizeof (register_t));
- if (ptrace (PT_SETREGS, get_ptrace_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"));
if (regnum != -1)
@@ -107,15 +107,13 @@ mips_fbsd_store_inferior_registers (struct target_ops *ops,
{
struct fpreg fpregs;
- if (ptrace (PT_GETFPREGS, get_ptrace_pid (inferior_ptid),
- (PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
+ if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
perror_with_name (_("Couldn't get floating point status"));
mips_fbsd_collect_fpregs (regcache, regnum, (char *) &fpregs,
sizeof (f_register_t));
- if (ptrace (PT_SETFPREGS, get_ptrace_pid (inferior_ptid),
- (PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
+ if (ptrace (PT_SETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
perror_with_name (_("Couldn't write floating point status"));
}
}