gdb: add target_ops::supports_displaced_step
[deliverable/binutils-gdb.git] / gdbserver / linux-s390-low.cc
index 36471fbea62e77b7aab0e4e4051716478a585cb0..f095181a23443b46cfa3460d142a3c88efd819d4 100644 (file)
@@ -63,6 +63,30 @@ public:
 
   bool supports_z_point_type (char z_type) override;
 
+  bool supports_tracepoints () override;
+
+  bool supports_fast_tracepoints () override;
+
+  int install_fast_tracepoint_jump_pad
+    (CORE_ADDR tpoint, CORE_ADDR tpaddr, CORE_ADDR collector,
+     CORE_ADDR lockaddr, ULONGEST orig_size, CORE_ADDR *jump_entry,
+     CORE_ADDR *trampoline, ULONGEST *trampoline_size,
+     unsigned char *jjump_pad_insn, ULONGEST *jjump_pad_insn_size,
+     CORE_ADDR *adjusted_insn_addr, CORE_ADDR *adjusted_insn_addr_end,
+     char *err) override;
+
+  int get_min_fast_tracepoint_insn_len () override;
+
+  void low_collect_ptrace_register (regcache *regcache, int regno,
+                                   char *buf) override;
+
+  void low_supply_ptrace_register (regcache *regcache, int regno,
+                                  const char *buf) override;
+
+  struct emit_ops *emit_ops () override;
+
+  int get_ipa_tdesc_idx () override;
+
 protected:
 
   void low_arch_setup () override;
@@ -80,6 +104,8 @@ protected:
   int low_decr_pc_after_break () override;
 
   bool low_breakpoint_at (CORE_ADDR pc) override;
+
+  int low_get_thread_area (int lwpid, CORE_ADDR *addrp) override;
 };
 
 /* The singleton target ops object.  */
@@ -187,11 +213,12 @@ s390_target::low_cannot_store_register (int regno)
   return false;
 }
 
-static void
-s390_collect_ptrace_register (struct regcache *regcache, int regno, char *buf)
+void
+s390_target::low_collect_ptrace_register (regcache *regcache, int regno,
+                                         char *buf)
 {
   int size = register_size (regcache->tdesc, regno);
-  const struct regs_info *regs_info = the_linux_target->get_regs_info ();
+  const struct regs_info *regs_info = get_regs_info ();
   struct usrregs_info *usr = regs_info->usrregs;
   int regaddr = usr->regmap[regno];
 
@@ -233,12 +260,12 @@ s390_collect_ptrace_register (struct regcache *regcache, int regno, char *buf)
     collect_register (regcache, regno, buf);
 }
 
-static void
-s390_supply_ptrace_register (struct regcache *regcache,
-                            int regno, const char *buf)
+void
+s390_target::low_supply_ptrace_register (regcache *regcache, int regno,
+                                        const char *buf)
 {
   int size = register_size (regcache->tdesc, regno);
-  const struct regs_info *regs_info = the_linux_target->get_regs_info ();
+  const struct regs_info *regs_info = get_regs_info ();
   struct usrregs_info *usr = regs_info->usrregs;
   int regaddr = usr->regmap[regno];
 
@@ -305,8 +332,8 @@ s390_fill_gregset (struct regcache *regcache, void *buf)
          || usr->regmap[i] > PT_ACR15)
        continue;
 
-      s390_collect_ptrace_register (regcache, i,
-                                   (char *) buf + usr->regmap[i]);
+      ((s390_target *) the_linux_target)->low_collect_ptrace_register
+       (regcache, i, (char *) buf + usr->regmap[i]);
     }
 }
 
@@ -698,14 +725,6 @@ s390_target::supports_z_point_type (char z_type)
     }
 }
 
-/* Support for hardware single step.  */
-
-static int
-s390_supports_hardware_single_step (void)
-{
-  return 1;
-}
-
 static struct usrregs_info s390_usrregs_info =
   {
     s390_num_regs,
@@ -763,18 +782,18 @@ s390_target::get_regs_info ()
   return &myregs_info;
 }
 
-/* The "supports_tracepoints" linux_target_ops method.  */
+/* The "supports_tracepoints" target ops method.  */
 
-static int
-s390_supports_tracepoints (void)
+bool
+s390_target::supports_tracepoints ()
 {
-  return 1;
+  return true;
 }
 
-/* Implementation of linux_target_ops method "get_thread_area".  */
+/* Implementation of linux target ops method "low_get_thread_area".  */
 
-static int
-s390_get_thread_area (int lwpid, CORE_ADDR *addrp)
+int
+s390_target::low_get_thread_area (int lwpid, CORE_ADDR *addrp)
 {
   CORE_ADDR res = ptrace (PTRACE_PEEKUSER, lwpid, (long) PT_ACR0, (long) 0);
 #ifdef __s390x__
@@ -1244,23 +1263,23 @@ s390_relocate_instruction (CORE_ADDR *to, CORE_ADDR oldloc, int is_64)
   return 0;
 }
 
-/* Implementation of linux_target_ops method
+bool
+s390_target::supports_fast_tracepoints ()
+{
+  return true;
+}
+
+/* Implementation of target ops method
    "install_fast_tracepoint_jump_pad".  */
 
-static int
-s390_install_fast_tracepoint_jump_pad (CORE_ADDR tpoint,
-                                      CORE_ADDR tpaddr,
-                                      CORE_ADDR collector,
-                                      CORE_ADDR lockaddr,
-                                      ULONGEST orig_size,
-                                      CORE_ADDR *jump_entry,
-                                      CORE_ADDR *trampoline,
-                                      ULONGEST *trampoline_size,
-                                      unsigned char *jjump_pad_insn,
-                                      ULONGEST *jjump_pad_insn_size,
-                                      CORE_ADDR *adjusted_insn_addr,
-                                      CORE_ADDR *adjusted_insn_addr_end,
-                                      char *err)
+int
+s390_target::install_fast_tracepoint_jump_pad
+  (CORE_ADDR tpoint, CORE_ADDR tpaddr, CORE_ADDR collector,
+   CORE_ADDR lockaddr, ULONGEST orig_size, CORE_ADDR *jump_entry,
+   CORE_ADDR *trampoline, ULONGEST *trampoline_size,
+   unsigned char *jjump_pad_insn, ULONGEST *jjump_pad_insn_size,
+   CORE_ADDR *adjusted_insn_addr, CORE_ADDR *adjusted_insn_addr_end,
+   char *err)
 {
   int i;
   int64_t loffset;
@@ -1414,11 +1433,11 @@ s390_install_fast_tracepoint_jump_pad (CORE_ADDR tpoint,
   return 0;
 }
 
-/* Implementation of linux_target_ops method
+/* Implementation of target ops method
    "get_min_fast_tracepoint_insn_len".  */
 
-static int
-s390_get_min_fast_tracepoint_insn_len (void)
+int
+s390_target::get_min_fast_tracepoint_insn_len ()
 {
   /* We only support using 6-byte jumps to reach the tracepoint code.
      If the tracepoint buffer were allocated sufficiently close (64kiB)
@@ -1428,10 +1447,10 @@ s390_get_min_fast_tracepoint_insn_len (void)
   return 6;
 }
 
-/* Implementation of linux_target_ops method "get_ipa_tdesc_idx".  */
+/* Implementation of target ops method "get_ipa_tdesc_idx".  */
 
-static int
-s390_get_ipa_tdesc_idx (void)
+int
+s390_target::get_ipa_tdesc_idx ()
 {
   struct regcache *regcache = get_thread_regcache (current_thread, 0);
   const struct target_desc *tdesc = regcache->tdesc;
@@ -2822,10 +2841,10 @@ static struct emit_ops s390x_emit_ops =
   };
 #endif
 
-/* The "emit_ops" linux_target_ops method.  */
+/* The "emit_ops" target ops method.  */
 
-static struct emit_ops *
-s390_emit_ops (void)
+emit_ops *
+s390_target::emit_ops ()
 {
 #ifdef __s390x__
   struct regcache *regcache = get_thread_regcache (current_thread, 0);
@@ -2837,30 +2856,6 @@ s390_emit_ops (void)
     return &s390_emit_ops_impl;
 }
 
-struct linux_target_ops the_low_target = {
-  NULL,
-  NULL,
-  s390_collect_ptrace_register,
-  s390_supply_ptrace_register,
-  NULL, /* siginfo_fixup */
-  NULL, /* new_process */
-  NULL, /* delete_process */
-  NULL, /* new_thread */
-  NULL, /* delete_thread */
-  NULL, /* new_fork */
-  NULL, /* prepare_to_resume */
-  NULL, /* process_qsupported */
-  s390_supports_tracepoints,
-  s390_get_thread_area,
-  s390_install_fast_tracepoint_jump_pad,
-  s390_emit_ops,
-  s390_get_min_fast_tracepoint_insn_len,
-  NULL, /* supports_range_stepping */
-  s390_supports_hardware_single_step,
-  NULL, /* get_syscall_trapinfo */
-  s390_get_ipa_tdesc_idx,
-};
-
 /* The linux target ops object.  */
 
 linux_process_target *the_linux_target = &the_s390_target;
This page took 0.040543 seconds and 4 git commands to generate.