gdbserver/linux-low: turn 'get_pc' and 'set_pc' into methods
[deliverable/binutils-gdb.git] / gdbserver / linux-x86-low.cc
index a15d5314b2c413ebd45e9d5fbc17593924581972..9aa29f8152222999b7a143d7b2feff5ebaef76c3 100644 (file)
@@ -104,9 +104,21 @@ public:
      connected, and it may or not support xml target descriptions.  */
   void update_xmltarget ();
 
+  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;
+
+  bool low_supports_breakpoints () override;
+
+  CORE_ADDR low_get_pc (regcache *regcache) override;
+
+  void low_set_pc (regcache *regcache, CORE_ADDR newpc) override;
 };
 
 /* The singleton target ops object.  */
@@ -299,23 +311,23 @@ x86_get_thread_area (int lwpid, CORE_ADDR *addr)
 
 
 \f
-static int
-x86_cannot_store_register (int regno)
+bool
+x86_target::low_cannot_store_register (int regno)
 {
 #ifdef __x86_64__
   if (is_64bit_tdesc ())
-    return 0;
+    return false;
 #endif
 
   return regno >= I386_NUM_REGS;
 }
 
-static int
-x86_cannot_fetch_register (int regno)
+bool
+x86_target::low_cannot_fetch_register (int regno)
 {
 #ifdef __x86_64__
   if (is_64bit_tdesc ())
-    return 0;
+    return false;
 #endif
 
   return regno >= I386_NUM_REGS;
@@ -488,8 +500,14 @@ static struct regset_info x86_regsets[] =
   NULL_REGSET
 };
 
-static CORE_ADDR
-x86_get_pc (struct regcache *regcache)
+bool
+x86_target::low_supports_breakpoints ()
+{
+  return true;
+}
+
+CORE_ADDR
+x86_target::low_get_pc (regcache *regcache)
 {
   int use_64bit = register_size (regcache->tdesc, 0) == 8;
 
@@ -509,8 +527,8 @@ x86_get_pc (struct regcache *regcache)
     }
 }
 
-static void
-x86_set_pc (struct regcache *regcache, CORE_ADDR pc)
+void
+x86_target::low_set_pc (regcache *regcache, CORE_ADDR pc)
 {
   int use_64bit = register_size (regcache->tdesc, 0) == 8;
 
@@ -982,8 +1000,8 @@ static struct regs_info i386_linux_regs_info =
     &x86_regsets_info
   };
 
-static const struct regs_info *
-x86_linux_regs_info (void)
+const regs_info *
+x86_target::get_regs_info ()
 {
 #ifdef __x86_64__
   if (is_64bit_tdesc ())
@@ -2879,12 +2897,6 @@ x86_get_ipa_tdesc_idx (void)
 
 struct linux_target_ops the_low_target =
 {
-  x86_linux_regs_info,
-  x86_cannot_fetch_register,
-  x86_cannot_store_register,
-  NULL, /* fetch_register */
-  x86_get_pc,
-  x86_set_pc,
   NULL, /* breakpoint_kind_from_pc */
   x86_sw_breakpoint_from_kind,
   NULL,
This page took 0.025864 seconds and 4 git commands to generate.