diff options
Diffstat (limited to 'gdb/sh-nbsd-nat.c')
-rw-r--r-- | gdb/sh-nbsd-nat.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/gdb/sh-nbsd-nat.c b/gdb/sh-nbsd-nat.c index d923e197990..f776e1c07bb 100644 --- a/gdb/sh-nbsd-nat.c +++ b/gdb/sh-nbsd-nat.c @@ -30,6 +30,13 @@ #include "inf-ptrace.h" #include "regcache.h" +struct sh_nbsd_nat_target final : public inf_ptrace_target +{ + void fetch_registers (struct regcache *, int) override; + void store_registers (struct regcache *, int) override; +}; + +static sh_nbsd_nat_target the_sh_nbsd_nat_target; /* Determine if PT_GETREGS fetches this register. */ #define GETREGS_SUPPLIES(gdbarch, regno) \ @@ -41,9 +48,8 @@ /* Sizeof `struct reg' in <machine/reg.h>. */ #define SHNBSD_SIZEOF_GREGS (21 * 4) -static void -shnbsd_fetch_inferior_registers (struct target_ops *ops, - struct regcache *regcache, int regno) +void +sh_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regno) { pid_t pid = ptid_get_pid (regcache_get_ptid (regcache)); @@ -64,9 +70,8 @@ shnbsd_fetch_inferior_registers (struct target_ops *ops, } } -static void -shnbsd_store_inferior_registers (struct target_ops *ops, - 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)); @@ -94,10 +99,5 @@ shnbsd_store_inferior_registers (struct target_ops *ops, void _initialize_shnbsd_nat (void) { - struct target_ops *t; - - t = inf_ptrace_target (); - t->to_fetch_registers = shnbsd_fetch_inferior_registers; - t->to_store_registers = shnbsd_store_inferior_registers; - add_target (t); + add_target (&the_sh_nbsd_nat_target); } |