gdbserver/linux-low: turn 'regs_info' into a method
[deliverable/binutils-gdb.git] / gdbserver / linux-tile-low.cc
index cd85e945a46e3b422402a286aa36115f87201832..6f173ccdf83d85b392998d79d76a4ddff8d60f82 100644 (file)
 #include <arch/abi.h>
 #include "nat/gdb_ptrace.h"
 
+/* Linux target op definitions for the TILE-Gx architecture.  */
+
+class tile_target : public linux_process_target
+{
+public:
+
+  const regs_info *get_regs_info () override;
+
+protected:
+
+  void low_arch_setup () override;
+};
+
+/* The singleton target ops object.  */
+
+static tile_target the_tile_target;
+
 /* Defined in auto-generated file reg-tilegx.c.  */
 void init_registers_tilegx (void);
 extern const struct target_desc *tdesc_tilegx;
@@ -85,7 +102,7 @@ tile_breakpoint_at (CORE_ADDR where)
 {
   uint64_t insn;
 
-  (*the_target->read_memory) (where, (unsigned char *) &insn, 8);
+  the_target->read_memory (where, (unsigned char *) &insn, 8);
   if (insn == tile_breakpoint)
     return 1;
 
@@ -134,21 +151,21 @@ static struct usrregs_info tile_usrregs_info =
     tile_regmap,
   };
 
-static struct regs_info regs_info =
+static struct regs_info myregs_info =
   {
     NULL, /* regset_bitmap */
     &tile_usrregs_info,
     &tile_regsets_info,
   };
 
-static const struct regs_info *
-tile_regs_info (void)
+const regs_info *
+tile_target::get_regs_info ()
 {
-  return &regs_info;
+  return &myregs_info;
 }
 
-static void
-tile_arch_setup (void)
+void
+tile_target::low_arch_setup ()
 {
   int pid = pid_of (current_thread);
   unsigned int machine;
@@ -175,8 +192,6 @@ tile_supports_hardware_single_step (void)
 
 struct linux_target_ops the_low_target =
 {
-  tile_arch_setup,
-  tile_regs_info,
   tile_cannot_fetch_register,
   tile_cannot_store_register,
   NULL,
@@ -212,6 +227,10 @@ struct linux_target_ops the_low_target =
   tile_supports_hardware_single_step,
 };
 
+/* The linux target ops object.  */
+
+linux_process_target *the_linux_target = &the_tile_target;
+
 void
 initialize_low_arch (void)
 {
This page took 0.023511 seconds and 4 git commands to generate.