gdbserver/linux-low: turn 'supports_z_point_type' into a method
[deliverable/binutils-gdb.git] / gdbserver / linux-ppc-low.cc
index 167c3b60f761542ed892b32e0d7dc3398a16f838..6874f0674e21530be8e40ad0fb6cb4a6ee7585a3 100644 (file)
@@ -52,6 +52,10 @@ public:
 
   const regs_info *get_regs_info () override;
 
+  const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
+
+  bool supports_z_point_type (char z_type) override;
+
 protected:
 
   void low_arch_setup () override;
@@ -65,6 +69,8 @@ protected:
   CORE_ADDR low_get_pc (regcache *regcache) override;
 
   void low_set_pc (regcache *regcache, CORE_ADDR newpc) override;
+
+  bool low_breakpoint_at (CORE_ADDR pc) override;
 };
 
 /* The singleton target ops object.  */
@@ -296,27 +302,27 @@ static int ppc_regmap_adjusted;
 static const unsigned int ppc_breakpoint = 0x7d821008;
 #define ppc_breakpoint_len 4
 
-/* Implementation of linux_target_ops method "sw_breakpoint_from_kind".  */
+/* Implementation of target ops method "sw_breakpoint_from_kind".  */
 
-static const gdb_byte *
-ppc_sw_breakpoint_from_kind (int kind, int *size)
+const gdb_byte *
+ppc_target::sw_breakpoint_from_kind (int kind, int *size)
 {
   *size = ppc_breakpoint_len;
   return (const gdb_byte *) &ppc_breakpoint;
 }
 
-static int
-ppc_breakpoint_at (CORE_ADDR where)
+bool
+ppc_target::low_breakpoint_at (CORE_ADDR where)
 {
   unsigned int insn;
 
-  the_target->read_memory (where, (unsigned char *) &insn, 4);
+  read_memory (where, (unsigned char *) &insn, 4);
   if (insn == ppc_breakpoint)
-    return 1;
+    return true;
   /* If necessary, recognize more trap instructions here.  GDB only uses
      the one.  */
 
-  return 0;
+  return false;
 }
 
 /* Implement supports_z_point_type target-ops.
@@ -325,18 +331,18 @@ ppc_breakpoint_at (CORE_ADDR where)
    Handling software breakpoint at server side, so tracepoints
    and breakpoints can be inserted at the same location.  */
 
-static int
-ppc_supports_z_point_type (char z_type)
+bool
+ppc_target::supports_z_point_type (char z_type)
 {
   switch (z_type)
     {
     case Z_PACKET_SW_BP:
-      return 1;
+      return true;
     case Z_PACKET_HW_BP:
     case Z_PACKET_WRITE_WP:
     case Z_PACKET_ACCESS_WP:
     default:
-      return 0;
+      return false;
     }
 }
 
@@ -3404,11 +3410,6 @@ ppc_get_ipa_tdesc_idx (void)
 }
 
 struct linux_target_ops the_low_target = {
-  ppc_sw_breakpoint_from_kind,
-  NULL,
-  0,
-  ppc_breakpoint_at,
-  ppc_supports_z_point_type,
   ppc_insert_point,
   ppc_remove_point,
   NULL,
This page took 0.025277 seconds and 4 git commands to generate.