gdbserver/linux-low: turn 'siginfo_fixup' into a method
[deliverable/binutils-gdb.git] / gdbserver / linux-sparc-low.cc
index 4e0d930f800d96f8608fe02eb64e893346cba9a1..e77ebe52805aeb13b8829963e43e81670f81fb69 100644 (file)
@@ -50,6 +50,8 @@ public:
 
   const regs_info *get_regs_info () override;
 
+  const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
+
 protected:
 
   void low_arch_setup () override;
@@ -57,12 +59,32 @@ protected:
   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;
+
+  /* No low_set_pc is needed.  */
+
+  bool low_breakpoint_at (CORE_ADDR pc) override;
 };
 
 /* The singleton target ops object.  */
 
 static sparc_target the_sparc_target;
 
+bool
+sparc_target::low_supports_breakpoints ()
+{
+  return true;
+}
+
+CORE_ADDR
+sparc_target::low_get_pc (regcache *regcache)
+{
+  return linux_get_pc_64bit (regcache);
+}
+
 /* Each offset is multiplied by 8, because of the register size.
    These offsets apply to the buffer sent/filled by ptrace.
    Additionally, the array elements order corresponds to the .dat file, and the
@@ -249,29 +271,29 @@ static const gdb_byte sparc_breakpoint[INSN_SIZE] = {
 };
 #define sparc_breakpoint_len INSN_SIZE
 
-/* Implementation of linux_target_ops method "sw_breakpoint_from_kind".  */
+/* Implementation of target ops method "sw_breakpoint_from_kind".  */
 
-static const unsigned char *
-sparc_sw_breakpoint_from_kind (int kind, int *size)
+const gdb_byte *
+sparc_target::sw_breakpoint_from_kind (int kind, int *size)
 {
   *size = sparc_breakpoint_len;
   return sparc_breakpoint;
 }
 
-static int
-sparc_breakpoint_at (CORE_ADDR where)
+bool
+sparc_target::low_breakpoint_at (CORE_ADDR where)
 {
   unsigned char insn[INSN_SIZE];
 
-  the_target->read_memory (where, (unsigned char *) insn, sizeof (insn));
+  read_memory (where, (unsigned char *) insn, sizeof (insn));
 
   if (memcmp (sparc_breakpoint, insn, sizeof (insn)) == 0)
-    return 1;
+    return true;
 
   /* If necessary, recognize more trap instructions here.  GDB only
      uses TRAP Always.  */
 
-  return 0;
+  return false;
 }
 
 void
@@ -319,18 +341,6 @@ sparc_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* fetch_register */
-  linux_get_pc_64bit,
-  /* No sparc_set_pc is needed.  */
-  NULL,
-  NULL, /* breakpoint_kind_from_pc */
-  sparc_sw_breakpoint_from_kind,
-  NULL, /* get_next_pcs */
-  0,
-  sparc_breakpoint_at,
-  NULL,  /* supports_z_point_type */
-  NULL, NULL, NULL, NULL,
-  NULL, NULL
 };
 
 /* The linux target ops object.  */
This page took 0.024346 seconds and 4 git commands to generate.