gdbserver/linux-low: turn 'get_pc' and 'set_pc' into methods
[deliverable/binutils-gdb.git] / gdbserver / linux-arm-low.cc
index 17f9549a8875199f824f93aa65c8a1300a333f13..7b9ef8999f605fc22d961b585137290fc89518e9 100644 (file)
@@ -60,15 +60,45 @@ class arm_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;
+
+  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.  */
 
 static arm_target the_arm_target;
 
+bool
+arm_target::low_supports_breakpoints ()
+{
+  return true;
+}
+
+CORE_ADDR
+arm_target::low_get_pc (regcache *regcache)
+{
+  return linux_get_pc_32bit (regcache);
+}
+
+void
+arm_target::low_set_pc (regcache *regcache, CORE_ADDR pc)
+{
+  linux_set_pc_32bit (regcache, pc);
+}
+
 /* Information describing the hardware breakpoint capabilities.  */
 static struct
 {
@@ -164,14 +194,14 @@ static struct arm_get_next_pcs_ops get_next_pcs_ops = {
   arm_linux_get_next_pcs_fixup,
 };
 
-static int
-arm_cannot_store_register (int regno)
+bool
+arm_target::low_cannot_store_register (int regno)
 {
   return (regno >= arm_num_regs);
 }
 
-static int
-arm_cannot_fetch_register (int regno)
+bool
+arm_target::low_cannot_fetch_register (int regno)
 {
   return (regno >= arm_num_regs);
 }
@@ -1007,8 +1037,8 @@ static struct regs_info regs_info_arm =
     &arm_regsets_info
   };
 
-static const struct regs_info *
-arm_regs_info (void)
+const regs_info *
+arm_target::get_regs_info ()
 {
   const struct target_desc *tdesc = current_process ()->tdesc;
 
@@ -1021,12 +1051,6 @@ arm_regs_info (void)
 }
 
 struct linux_target_ops the_low_target = {
-  arm_regs_info,
-  arm_cannot_fetch_register,
-  arm_cannot_store_register,
-  NULL, /* fetch_register */
-  linux_get_pc_32bit,
-  linux_set_pc_32bit,
   arm_breakpoint_kind_from_pc,
   arm_sw_breakpoint_from_kind,
   arm_gdbserver_get_next_pcs,
This page took 0.025471 seconds and 4 git commands to generate.