Make print_command_trace varargs
[deliverable/binutils-gdb.git] / gdb / hppa-nbsd-nat.c
index 54c776cf59a023a42fe5a426941dc0eb1837b0a9..3547d655437ea75d231f86b48f1b735acee96930 100644 (file)
@@ -1,6 +1,6 @@
 /* Native-dependent code for NetBSD/hppa.
 
-   Copyright (C) 2008-2017 Free Software Foundation, Inc.
+   Copyright (C) 2008-2018 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 
 #include "nbsd-nat.h"
 
+class hppa_nbsd_nat_target final : public nbsd_nat_target
+{
+  void fetch_registers (struct regcache *, int) override;
+  void store_registers (struct regcache *, int) override;
+};
+
+static hppa_nbsd_nat_target the_hppa_nbsd_nat_target;
+
 static int
 hppanbsd_gregset_supplies_p (int regnum)
 {
@@ -158,9 +166,8 @@ hppanbsd_collect_fpregset (struct regcache *regcache,
 /* Fetch register REGNUM from the inferior.  If REGNUM is -1, do this
    for all registers (including the floating-point registers).  */
 
-static void
-hppanbsd_fetch_registers (struct target_ops *ops,
-                         struct regcache *regcache, int regnum)
+void
+hppa_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
 
 {
   pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
@@ -189,9 +196,8 @@ hppanbsd_fetch_registers (struct target_ops *ops,
 /* Store register REGNUM back into the inferior.  If REGNUM is -1, do
    this for all registers (including the floating-point registers).  */
 
-static void
-hppanbsd_store_registers (struct target_ops *ops,
-                         struct regcache *regcache, int regnum)
+void
+hppa_nbsd_nat_target::store_registers (struct regcache *regcache, int regnum)
 {
   pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
 
@@ -222,22 +228,8 @@ hppanbsd_store_registers (struct target_ops *ops,
     }
 }
 
-
-/* Provide a prototype to silence -Wmissing-prototypes.  */
-void _initialize_hppanbsd_nat (void);
-
 void
 _initialize_hppanbsd_nat (void)
 {
-  struct target_ops *t;
-
-  /* Add some extra features to the ptrace target.  */
-  t = inf_ptrace_target ();
-
-  t->to_fetch_registers = hppanbsd_fetch_registers;
-  t->to_store_registers = hppanbsd_store_registers;
-
-  t->to_pid_to_exec_file = nbsd_pid_to_exec_file;
-
-  add_target (t);
+  add_inf_child_target (&the_hppa_nbsd_nat_target);
 }
This page took 0.02558 seconds and 4 git commands to generate.