X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fhppa-nbsd-nat.c;h=c35f30daa8ea8e822d08677c6767b860be95acb4;hb=d2d1ea20aef6ed97232280b5e15a52b8d7dc7b7d;hp=2a1149086f605e7ec4c843f4d85ae15d6bd33a14;hpb=e99b03dcf42606425eab8bd12eadb8aa4007f35a;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/hppa-nbsd-nat.c b/gdb/hppa-nbsd-nat.c index 2a1149086f..c35f30daa8 100644 --- a/gdb/hppa-nbsd-nat.c +++ b/gdb/hppa-nbsd-nat.c @@ -1,6 +1,6 @@ /* Native-dependent code for NetBSD/hppa. - Copyright (C) 2008-2018 Free Software Foundation, Inc. + Copyright (C) 2008-2020 Free Software Foundation, Inc. This file is part of GDB. @@ -171,12 +171,13 @@ hppa_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum) { pid_t pid = regcache->ptid ().pid (); + int lwp = regcache->ptid ().lwp (); if (regnum == -1 || hppanbsd_gregset_supplies_p (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")); hppanbsd_supply_gregset (regcache, ®s); @@ -186,7 +187,7 @@ hppa_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum) { 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 floating point status")); hppanbsd_supply_fpregset (regcache, &fpregs); @@ -200,17 +201,18 @@ void hppa_nbsd_nat_target::store_registers (struct regcache *regcache, int regnum) { pid_t pid = regcache->ptid ().pid (); + int lwp = regcache->ptid ().lwp (); if (regnum == -1 || hppanbsd_gregset_supplies_p (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")); hppanbsd_collect_gregset (regcache, ®s, regnum); - 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")); } @@ -218,18 +220,19 @@ hppa_nbsd_nat_target::store_registers (struct regcache *regcache, int regnum) { 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 floating point status")); hppanbsd_collect_fpregset (regcache, &fpregs, regnum); - 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 write floating point status")); } } +void _initialize_hppanbsd_nat (); void -_initialize_hppanbsd_nat (void) +_initialize_hppanbsd_nat () { add_inf_child_target (&the_hppa_nbsd_nat_target); }