mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-24 12:23:31 +08:00
Add support for NetBSD threads in ppc-nbsd-nat.c
NetBSD ptrace(2) accepts thread id (LWP) as the 4th argument for threads. gdb/ChangeLog: * ppc-nbsd-nat.c (fetch_registers): New variable lwp and pass it to the ptrace call. * (store_registers): Likewise.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2020-03-12 Kamil Rytarowski <n54@gmx.com>
|
||||||
|
|
||||||
|
* ppc-nbsd-nat.c (fetch_registers): New variable lwp and pass
|
||||||
|
it to the ptrace call.
|
||||||
|
* (store_registers): Likewise.
|
||||||
|
|
||||||
2020-03-19 Luis Machado <luis.machado@linaro.org>
|
2020-03-19 Luis Machado <luis.machado@linaro.org>
|
||||||
|
|
||||||
* nat/aarch64-sve-linux-ptrace.c (aarch64_sve_set_vq): If vg is not
|
* nat/aarch64-sve-linux-ptrace.c (aarch64_sve_set_vq): If vg is not
|
||||||
|
@ -91,12 +91,13 @@ ppc_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
|
|||||||
{
|
{
|
||||||
struct gdbarch *gdbarch = regcache->arch ();
|
struct gdbarch *gdbarch = regcache->arch ();
|
||||||
pid_t pid = regcache->ptid ().pid ();
|
pid_t pid = regcache->ptid ().pid ();
|
||||||
|
int lwp = regcache->ptid ().lwp ();
|
||||||
|
|
||||||
if (regnum == -1 || getregs_supplies (gdbarch, regnum))
|
if (regnum == -1 || getregs_supplies (gdbarch, regnum))
|
||||||
{
|
{
|
||||||
struct reg regs;
|
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"));
|
perror_with_name (_("Couldn't get registers"));
|
||||||
|
|
||||||
ppc_supply_gregset (&ppcnbsd_gregset, regcache,
|
ppc_supply_gregset (&ppcnbsd_gregset, regcache,
|
||||||
@ -107,7 +108,7 @@ ppc_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
|
|||||||
{
|
{
|
||||||
struct fpreg fpregs;
|
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"));
|
perror_with_name (_("Couldn't get FP registers"));
|
||||||
|
|
||||||
ppc_supply_fpregset (&ppcnbsd_fpregset, regcache,
|
ppc_supply_fpregset (&ppcnbsd_fpregset, regcache,
|
||||||
@ -120,18 +121,19 @@ ppc_nbsd_nat_target::store_registers (struct regcache *regcache, int regnum)
|
|||||||
{
|
{
|
||||||
struct gdbarch *gdbarch = regcache->arch ();
|
struct gdbarch *gdbarch = regcache->arch ();
|
||||||
pid_t pid = regcache->ptid ().pid ();
|
pid_t pid = regcache->ptid ().pid ();
|
||||||
|
int lwp = regcache->ptid ().lwp ();
|
||||||
|
|
||||||
if (regnum == -1 || getregs_supplies (gdbarch, regnum))
|
if (regnum == -1 || getregs_supplies (gdbarch, regnum))
|
||||||
{
|
{
|
||||||
struct reg regs;
|
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"));
|
perror_with_name (_("Couldn't get registers"));
|
||||||
|
|
||||||
ppc_collect_gregset (&ppcnbsd_gregset, regcache,
|
ppc_collect_gregset (&ppcnbsd_gregset, regcache,
|
||||||
regnum, ®s, sizeof regs);
|
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"));
|
perror_with_name (_("Couldn't write registers"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -139,13 +141,13 @@ ppc_nbsd_nat_target::store_registers (struct regcache *regcache, int regnum)
|
|||||||
{
|
{
|
||||||
struct fpreg fpregs;
|
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"));
|
perror_with_name (_("Couldn't get FP registers"));
|
||||||
|
|
||||||
ppc_collect_fpregset (&ppcnbsd_fpregset, regcache,
|
ppc_collect_fpregset (&ppcnbsd_fpregset, regcache,
|
||||||
regnum, &fpregs, sizeof fpregs);
|
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"));
|
perror_with_name (_("Couldn't set FP registers"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user