{
struct gdbarch *gdbarch = regcache->arch ();
pid_t pid = regcache->ptid ().pid ();
+ int lwp = regcache->ptid ().lwp ();
if (regnum == -1 || getregs_supplies (gdbarch, regnum))
{
struct reg regs;
- if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1)
+ if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, lwp) == -1)
perror_with_name (_("Couldn't get registers"));
ppc_supply_gregset (&ppcnbsd_gregset, regcache,
{
struct fpreg fpregs;
- if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
+ if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, lwp) == -1)
perror_with_name (_("Couldn't get FP registers"));
ppc_supply_fpregset (&ppcnbsd_fpregset, regcache,
{
struct gdbarch *gdbarch = regcache->arch ();
pid_t pid = regcache->ptid ().pid ();
+ int lwp = regcache->ptid ().lwp ();
if (regnum == -1 || getregs_supplies (gdbarch, regnum))
{
struct reg regs;
- if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1)
+ if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, lwp) == -1)
perror_with_name (_("Couldn't get registers"));
ppc_collect_gregset (&ppcnbsd_gregset, regcache,
regnum, ®s, sizeof regs);
- if (ptrace (PT_SETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1)
+ if (ptrace (PT_SETREGS, pid, (PTRACE_TYPE_ARG3) ®s, lwp) == -1)
perror_with_name (_("Couldn't write registers"));
}
{
struct fpreg fpregs;
- if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
+ if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, lwp) == -1)
perror_with_name (_("Couldn't get FP registers"));
ppc_collect_fpregset (&ppcnbsd_fpregset, regcache,
regnum, &fpregs, sizeof fpregs);
- if (ptrace (PT_SETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
+ if (ptrace (PT_SETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, lwp) == -1)
perror_with_name (_("Couldn't set FP registers"));
}
}