X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Fsh-nbsd-nat.c;h=b4f9db691ce0869bccf1cbba14aea71472946bf6;hb=refs%2Fheads%2Fconcurrent-displaced-stepping-2020-04-01;hp=6bd089e32b31f332ccaec8a958734498fbb4cd19;hpb=d9f719f1adb653ab40a55e4c1b8c300215b400ff;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/sh-nbsd-nat.c b/gdb/sh-nbsd-nat.c index 6bd089e32b..b4f9db691c 100644 --- a/gdb/sh-nbsd-nat.c +++ b/gdb/sh-nbsd-nat.c @@ -1,6 +1,6 @@ /* Native-dependent code for NetBSD/sh. - Copyright (C) 2002-2018 Free Software Foundation, Inc. + Copyright (C) 2002-2020 Free Software Foundation, Inc. Contributed by Wasabi Systems, Inc. @@ -28,9 +28,10 @@ #include "sh-tdep.h" #include "inf-ptrace.h" +#include "nbsd-nat.h" #include "regcache.h" -struct sh_nbsd_nat_target final : public inf_ptrace_target +struct sh_nbsd_nat_target final : public nbsd_nat_target { void fetch_registers (struct regcache *, int) override; void store_registers (struct regcache *, int) override; @@ -51,14 +52,15 @@ static sh_nbsd_nat_target the_sh_nbsd_nat_target; void sh_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regno) { - pid_t pid = ptid_get_pid (regcache_get_ptid (regcache)); + pid_t pid = regcache->ptid ().pid (); + int lwp = regcache->ptid ().lwp (); if (regno == -1 || GETREGS_SUPPLIES (regcache->arch (), regno)) { struct reg inferior_registers; if (ptrace (PT_GETREGS, pid, - (PTRACE_TYPE_ARG3) &inferior_registers, 0) == -1) + (PTRACE_TYPE_ARG3) &inferior_registers, lwp) == -1) perror_with_name (_("Couldn't get registers")); sh_corefile_supply_regset (&sh_corefile_gregset, regcache, regno, @@ -73,14 +75,15 @@ sh_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regno) void sh_nbsd_nat_target::store_registers (struct regcache *regcache, int regno) { - pid_t pid = ptid_get_pid (regcache_get_ptid (regcache)); + pid_t pid = regcache->ptid ().pid (); + int lwp = regcache->ptid ().lwp (); if (regno == -1 || GETREGS_SUPPLIES (regcache->arch (), regno)) { struct reg inferior_registers; if (ptrace (PT_GETREGS, pid, - (PTRACE_TYPE_ARG3) &inferior_registers, 0) == -1) + (PTRACE_TYPE_ARG3) &inferior_registers, lwp) == -1) perror_with_name (_("Couldn't get registers")); sh_corefile_collect_regset (&sh_corefile_gregset, regcache, regno, @@ -88,7 +91,7 @@ sh_nbsd_nat_target::store_registers (struct regcache *regcache, int regno) SHNBSD_SIZEOF_GREGS); if (ptrace (PT_SETREGS, pid, - (PTRACE_TYPE_ARG3) &inferior_registers, 0) == -1) + (PTRACE_TYPE_ARG3) &inferior_registers, lwp) == -1) perror_with_name (_("Couldn't set registers")); if (regno != -1) @@ -96,8 +99,9 @@ sh_nbsd_nat_target::store_registers (struct regcache *regcache, int regno) } } +void _initialize_shnbsd_nat (); void -_initialize_shnbsd_nat (void) +_initialize_shnbsd_nat () { add_inf_child_target (&the_sh_nbsd_nat_target); }