gdbserver/linux-low: turn 'fetch_register' into a method
[deliverable/binutils-gdb.git] / gdbserver / linux-tile-low.cc
index 807a8976fd77b7cb47ba816f58d0ebe7be3bc2b6..a6138e78aa784eb67e4b5fc23260d5110645cc90 100644 (file)
@@ -29,6 +29,15 @@ class tile_target : public linux_process_target
 {
 public:
 
+  const regs_info *get_regs_info () override;
+
+protected:
+
+  void low_arch_setup () override;
+
+  bool low_cannot_fetch_register (int regno) override;
+
+  bool low_cannot_store_register (int regno) override;
 };
 
 /* The singleton target ops object.  */
@@ -58,26 +67,26 @@ static int tile_regmap[] =
   56
 };
 
-static int
-tile_cannot_fetch_register (int regno)
+bool
+tile_target::low_cannot_fetch_register (int regno)
 {
   if (regno >= 0 && regno < 56)
-    return 0;
+    return false;
   else if (regno == 64)
-    return 0;
+    return false;
   else
-    return 1;
+    return true;
 }
 
-static int
-tile_cannot_store_register (int regno)
+bool
+tile_target::low_cannot_store_register (int regno)
 {
   if (regno >= 0 && regno < 56)
-    return 0;
+    return false;
   else if (regno == 64)
-    return 0;
+    return false;
   else
-    return 1;
+    return true;
 }
 
 static uint64_t tile_breakpoint = 0x400b3cae70166000ULL;
@@ -146,21 +155,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;
@@ -187,11 +196,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,
   linux_get_pc_64bit,
   linux_set_pc_64bit,
   NULL, /* breakpoint_kind_from_pc */
This page took 0.024284 seconds and 4 git commands to generate.