aboutsummaryrefslogtreecommitdiff
path: root/gdb/m68k-linux-nat.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/m68k-linux-nat.c')
-rw-r--r--gdb/m68k-linux-nat.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/gdb/m68k-linux-nat.c b/gdb/m68k-linux-nat.c
index 754051b..0b6651d 100644
--- a/gdb/m68k-linux-nat.c
+++ b/gdb/m68k-linux-nat.c
@@ -57,6 +57,17 @@
#define PTRACE_GET_THREAD_AREA 25
#endif
+
+class m68k_linux_nat_target final : public linux_nat_target
+{
+public:
+ /* Add our register access methods. */
+ void fetch_registers (struct regcache *, int) override;
+ void store_registers (struct regcache *, int) override;
+};
+
+static m68k_linux_nat_target the_m68k_linux_nat_target;
+
/* This table must line up with gdbarch_register_name in "m68k-tdep.c". */
static const int regmap[] =
{
@@ -392,9 +403,8 @@ static void store_fpregs (const struct regcache *regcache, int tid, int regno)
this for all registers (including the floating point and SSE
registers). */
-static void
-m68k_linux_fetch_inferior_registers (struct target_ops *ops,
- struct regcache *regcache, int regno)
+void
+m68k_linux_nat_target::fetch_registers (struct regcache *regcache, int regno)
{
pid_t tid;
@@ -446,9 +456,8 @@ m68k_linux_fetch_inferior_registers (struct target_ops *ops,
/* Store register REGNO back into the child process. If REGNO is -1,
do this for all registers (including the floating point and SSE
registers). */
-static void
-m68k_linux_store_inferior_registers (struct target_ops *ops,
- struct regcache *regcache, int regno)
+void
+m68k_linux_nat_target::store_registers (struct regcache *regcache, int regno)
{
pid_t tid;
@@ -509,15 +518,7 @@ ps_get_thread_area (struct ps_prochandle *ph,
void
_initialize_m68k_linux_nat (void)
{
- struct target_ops *t;
-
- /* Fill in the generic GNU/Linux methods. */
- t = linux_target ();
-
- /* Add our register access methods. */
- t->to_fetch_registers = m68k_linux_fetch_inferior_registers;
- t->to_store_registers = m68k_linux_store_inferior_registers;
-
/* Register the target. */
- linux_nat_add_target (t);
+ linux_target = &the_m68k_linux_nat_target;
+ add_target (&the_m68k_linux_nat_target);
}