X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=gdb%2Falpha-bsd-nat.c;h=234dac9500232a27e44f7f43793b871404f90fc7;hb=f6ac5f3d63e03a81c4ff3749aba234961cc9090e;hp=80139b66e4a2b4f19ac7c6877f85eebdb9b6b995;hpb=3fffc0701a26bc0baa563fdc793cafb3d3f02a93;p=thirdparty%2Fbinutils-gdb.git diff --git a/gdb/alpha-bsd-nat.c b/gdb/alpha-bsd-nat.c index 80139b66e4a..234dac95002 100644 --- a/gdb/alpha-bsd-nat.c +++ b/gdb/alpha-bsd-nat.c @@ -43,6 +43,14 @@ typedef struct fpreg fpregset_t; #include "gregset.h" +struct alpha_bsd_nat_target final : public inf_ptrace_target +{ + void fetch_registers (struct regcache *, int) override; + void store_registers (struct regcache *, int) override; +}; + +static alpha_bsd_nat_target the_alpha_bsd_nat_target; + /* Provide *regset() wrappers around the generic Alpha BSD register supply/fill routines. */ @@ -83,9 +91,8 @@ getregs_supplies (int regno) /* Fetch register REGNO from the inferior. If REGNO is -1, do this for all registers (including the floating point registers). */ -static void -alphabsd_fetch_inferior_registers (struct target_ops *ops, - struct regcache *regcache, int regno) +void +alpha_bsd_nat_target::fetch_registers (struct regcache *regcache, int regno) { if (regno == -1 || getregs_supplies (regno)) { @@ -116,9 +123,8 @@ alphabsd_fetch_inferior_registers (struct target_ops *ops, /* Store register REGNO back into the inferior. If REGNO is -1, do this for all registers (including the floating point registers). */ -static void -alphabsd_store_inferior_registers (struct target_ops *ops, - struct regcache *regcache, int regno) +void +alpha_bsd_nat_target::store_registers (struct regcache *regcache, int regno) { if (regno == -1 || getregs_supplies (regno)) { @@ -190,12 +196,7 @@ alphabsd_supply_pcb (struct regcache *regcache, struct pcb *pcb) void _initialize_alphabsd_nat (void) { - struct target_ops *t; - - t = inf_ptrace_target (); - t->to_fetch_registers = alphabsd_fetch_inferior_registers; - t->to_store_registers = alphabsd_store_inferior_registers; - add_target (t); + add_target (&the_alpha_bsd_nat_target); /* Support debugging kernel virtual memory images. */ bsd_kvm_add_target (alphabsd_supply_pcb);