gdbserver/linux-low: turn fast tracepoint ops into methods
authorTankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Thu, 2 Apr 2020 13:11:30 +0000 (15:11 +0200)
committerTankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Thu, 2 Apr 2020 13:11:30 +0000 (15:11 +0200)
gdbserver/ChangeLog:
2020-04-02  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>

Remove the 'install_fast_tracepoint_jump_pad' and
'get_min_fast_tracepoint_insn_len' linux target ops to let the
concrete linux target define the ops by overriding the declarations
of process_stratum_target.

* linux-low.h (struct linux_target_ops): Remove the ops.
(class linux_process_target) <supports_fast_tracepoints>
<install_fast_tracepoint_jump_pad>
<get_min_fast_tracepoint_insn_len>: Remove.
* linux-low.cc (linux_process_target::supports_fast_tracepoints)
(linux_process_target::install_fast_tracepoint_jump_pad)
(linux_process_target::get_min_fast_tracepoint_insn_len): Remove.
* linux-x86-low.cc (class x86_target) <supports_fast_tracepoints>
<install_fast_tracepoint_jump_pad>
<get_min_fast_tracepoint_insn_len>: Declare.
(x86_target::supports_fast_tracepoints): Define.
(x86_install_fast_tracepoint_jump_pad): Turn into...
(x86_target::install_fast_tracepoint_jump_pad): ...this.
(x86_get_min_fast_tracepoint_insn_len): Turn into...
(x86_target::get_min_fast_tracepoint_insn_len): ...this.
(the_low_target): Remove the op fields.
* linux-aarch64-low.cc (class aarch64_target)
<supports_fast_tracepoints>
<install_fast_tracepoint_jump_pad>
<get_min_fast_tracepoint_insn_len>: Declare.
(aarch64_target::supports_fast_tracepoints): Define.
(aarch64_install_fast_tracepoint_jump_pad): Turn into...
(aarch64_target::install_fast_tracepoint_jump_pad): ...this.
(aarch64_get_min_fast_tracepoint_insn_len): Turn into...
(aarch64_target::get_min_fast_tracepoint_insn_len): ...this.
(the_low_target): Remove the op fields.
* linux-ppc-low.cc (class ppc_target) <supports_fast_tracepoints>
<install_fast_tracepoint_jump_pad>
<get_min_fast_tracepoint_insn_len>: Declare.
(ppc_target::supports_fast_tracepoints): Define.
(ppc_install_fast_tracepoint_jump_pad): Turn into...
(ppc_target::install_fast_tracepoint_jump_pad): ...this.
(ppc_get_min_fast_tracepoint_insn_len): Turn into...
(ppc_target::get_min_fast_tracepoint_insn_len): ...this.
(the_low_target): Remove the op fields.
* linux-s390-low.cc (class s390_target) <supports_fast_tracepoints>
<install_fast_tracepoint_jump_pad>
<get_min_fast_tracepoint_insn_len>: Declare.
(s390_target::supports_fast_tracepoints): Define.
(s390_install_fast_tracepoint_jump_pad): Turn into...
(s390_target::install_fast_tracepoint_jump_pad): ...this.
(s390_get_min_fast_tracepoint_insn_len): Turn into...
(s390_target::get_min_fast_tracepoint_insn_len): ...this.
(the_low_target): Remove the op fields.
* linux-arm-low.cc (the_low_target): Remove the op fields.
* linux-bfin-low.cc (the_low_target): Ditto.
* linux-crisv32-low.cc (the_low_target): Ditto.
* linux-m32r-low.cc (the_low_target): Ditto.
* linux-m68k-low.cc (the_low_target): Ditto.
* linux-sh-low.cc (the_low_target): Ditto.
* linux-tic6x-low.cc (the_low_target): Ditto.
* linux-tile-low.cc (the_low_target): Ditto.
* linux-xtensa-low.cc (the_low_target): Ditto.

16 files changed:
gdbserver/ChangeLog
gdbserver/linux-aarch64-low.cc
gdbserver/linux-arm-low.cc
gdbserver/linux-bfin-low.cc
gdbserver/linux-crisv32-low.cc
gdbserver/linux-low.cc
gdbserver/linux-low.h
gdbserver/linux-m32r-low.cc
gdbserver/linux-m68k-low.cc
gdbserver/linux-ppc-low.cc
gdbserver/linux-s390-low.cc
gdbserver/linux-sh-low.cc
gdbserver/linux-tic6x-low.cc
gdbserver/linux-tile-low.cc
gdbserver/linux-x86-low.cc
gdbserver/linux-xtensa-low.cc

index e0c1f20720ee16507c5a4f116fc23339cd7676c4..a7689caeea36bf924442574e66f3aae171cceb91 100644 (file)
@@ -1,3 +1,64 @@
+2020-04-02  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>
+
+       Remove the 'install_fast_tracepoint_jump_pad' and
+       'get_min_fast_tracepoint_insn_len' linux target ops to let the
+       concrete linux target define the ops by overriding the declarations
+       of process_stratum_target.
+
+       * linux-low.h (struct linux_target_ops): Remove the ops.
+       (class linux_process_target) <supports_fast_tracepoints>
+       <install_fast_tracepoint_jump_pad>
+       <get_min_fast_tracepoint_insn_len>: Remove.
+       * linux-low.cc (linux_process_target::supports_fast_tracepoints)
+       (linux_process_target::install_fast_tracepoint_jump_pad)
+       (linux_process_target::get_min_fast_tracepoint_insn_len): Remove.
+       * linux-x86-low.cc (class x86_target) <supports_fast_tracepoints>
+       <install_fast_tracepoint_jump_pad>
+       <get_min_fast_tracepoint_insn_len>: Declare.
+       (x86_target::supports_fast_tracepoints): Define.
+       (x86_install_fast_tracepoint_jump_pad): Turn into...
+       (x86_target::install_fast_tracepoint_jump_pad): ...this.
+       (x86_get_min_fast_tracepoint_insn_len): Turn into...
+       (x86_target::get_min_fast_tracepoint_insn_len): ...this.
+       (the_low_target): Remove the op fields.
+       * linux-aarch64-low.cc (class aarch64_target)
+       <supports_fast_tracepoints>
+       <install_fast_tracepoint_jump_pad>
+       <get_min_fast_tracepoint_insn_len>: Declare.
+       (aarch64_target::supports_fast_tracepoints): Define.
+       (aarch64_install_fast_tracepoint_jump_pad): Turn into...
+       (aarch64_target::install_fast_tracepoint_jump_pad): ...this.
+       (aarch64_get_min_fast_tracepoint_insn_len): Turn into...
+       (aarch64_target::get_min_fast_tracepoint_insn_len): ...this.
+       (the_low_target): Remove the op fields.
+       * linux-ppc-low.cc (class ppc_target) <supports_fast_tracepoints>
+       <install_fast_tracepoint_jump_pad>
+       <get_min_fast_tracepoint_insn_len>: Declare.
+       (ppc_target::supports_fast_tracepoints): Define.
+       (ppc_install_fast_tracepoint_jump_pad): Turn into...
+       (ppc_target::install_fast_tracepoint_jump_pad): ...this.
+       (ppc_get_min_fast_tracepoint_insn_len): Turn into...
+       (ppc_target::get_min_fast_tracepoint_insn_len): ...this.
+       (the_low_target): Remove the op fields.
+       * linux-s390-low.cc (class s390_target) <supports_fast_tracepoints>
+       <install_fast_tracepoint_jump_pad>
+       <get_min_fast_tracepoint_insn_len>: Declare.
+       (s390_target::supports_fast_tracepoints): Define.
+       (s390_install_fast_tracepoint_jump_pad): Turn into...
+       (s390_target::install_fast_tracepoint_jump_pad): ...this.
+       (s390_get_min_fast_tracepoint_insn_len): Turn into...
+       (s390_target::get_min_fast_tracepoint_insn_len): ...this.
+       (the_low_target): Remove the op fields.
+       * linux-arm-low.cc (the_low_target): Remove the op fields.
+       * linux-bfin-low.cc (the_low_target): Ditto.
+       * linux-crisv32-low.cc (the_low_target): Ditto.
+       * linux-m32r-low.cc (the_low_target): Ditto.
+       * linux-m68k-low.cc (the_low_target): Ditto.
+       * linux-sh-low.cc (the_low_target): Ditto.
+       * linux-tic6x-low.cc (the_low_target): Ditto.
+       * linux-tile-low.cc (the_low_target): Ditto.
+       * linux-xtensa-low.cc (the_low_target): Ditto.
+
 2020-04-02  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>
 
        Turn the 'get_thread_area' linux target op into a method of
index c58fb44ec8a689ed4c0fe83eca037c9675b26b23..37fe93c89591799748a20a0ec6b29198f6d9e2b8 100644 (file)
@@ -67,6 +67,18 @@ public:
 
   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;
+
 protected:
 
   void low_arch_setup () override;
@@ -1962,23 +1974,23 @@ static const struct aarch64_insn_visitor visitor =
   aarch64_ftrace_insn_reloc_others,
 };
 
-/* Implementation of linux_target_ops method
+bool
+aarch64_target::supports_fast_tracepoints ()
+{
+  return true;
+}
+
+/* Implementation of target ops method
    "install_fast_tracepoint_jump_pad".  */
 
-static int
-aarch64_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
+aarch64_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)
 {
   uint32_t buf[256];
   uint32_t *p = buf;
@@ -3087,11 +3099,11 @@ aarch64_emit_ops (void)
   return &aarch64_emit_ops_impl;
 }
 
-/* Implementation of linux_target_ops method
+/* Implementation of target ops method
    "get_min_fast_tracepoint_insn_len".  */
 
-static int
-aarch64_get_min_fast_tracepoint_insn_len (void)
+int
+aarch64_target::get_min_fast_tracepoint_insn_len ()
 {
   return 4;
 }
@@ -3151,9 +3163,7 @@ aarch64_supports_hardware_single_step (void)
 
 struct linux_target_ops the_low_target =
 {
-  aarch64_install_fast_tracepoint_jump_pad,
   aarch64_emit_ops,
-  aarch64_get_min_fast_tracepoint_insn_len,
   aarch64_supports_range_stepping,
   aarch64_supports_hardware_single_step,
   aarch64_get_syscall_trapinfo,
index e52341da63a614778313c54044b2ce01e402a6c5..942f26302365944e7bce36f90cdf20a7965af507 100644 (file)
@@ -1117,9 +1117,7 @@ arm_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* install_fast_tracepoint_jump_pad */
   NULL, /* emit_ops */
-  NULL, /* get_min_fast_tracepoint_insn_len */
   NULL, /* supports_range_stepping */
   arm_supports_hardware_single_step,
   arm_get_syscall_trapinfo,
index 7a11c5b7b096619b4af86ef23c1955c826b6a9ef..4eaa19ebf3dbce5de849ae9d47da415a0111751e 100644 (file)
@@ -171,9 +171,7 @@ bfin_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* install_fast_tracepoint_jump_pad */
   NULL, /* emit_ops */
-  NULL, /* get_min_fast_tracepoint_insn_len */
   NULL, /* supports_range_stepping */
   bfin_supports_hardware_single_step,
 };
index 1aecd252ce75a202b0ebc0455da6ab17d41838ed..25816cc381289a2f0c89c19646071b392e8c6e91 100644 (file)
@@ -468,9 +468,7 @@ crisv32_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* install_fast_tracepoint_jump_pad */
   NULL, /* emit_ops */
-  NULL, /* get_min_fast_tracepoint_insn_len */
   NULL, /* supports_range_stepping */
   cris_supports_hardware_single_step,
 };
index 7172194610889fc31d23ecedea3c3414929e6cc6..f93d495daabce200a282e644125ef517de3b0b72 100644 (file)
@@ -6496,29 +6496,6 @@ linux_process_target::done_accessing_memory ()
     target_unpause_all (true);
 }
 
-bool
-linux_process_target::supports_fast_tracepoints ()
-{
-  return the_low_target.install_fast_tracepoint_jump_pad != nullptr;
-}
-
-int
-linux_process_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)
-{
-  return (*the_low_target.install_fast_tracepoint_jump_pad)
-    (tpoint, tpaddr, collector, lockaddr, orig_size,
-     jump_entry, trampoline, trampoline_size,
-     jjump_pad_insn, jjump_pad_insn_size,
-     adjusted_insn_addr, adjusted_insn_addr_end,
-     err);
-}
-
 emit_ops *
 linux_process_target::emit_ops ()
 {
@@ -6528,12 +6505,6 @@ linux_process_target::emit_ops ()
     return NULL;
 }
 
-int
-linux_process_target::get_min_fast_tracepoint_insn_len ()
-{
-  return (*the_low_target.get_min_fast_tracepoint_insn_len) ();
-}
-
 /* Extract &phdr and num_phdr in the inferior.  Return 0 on success.  */
 
 static int
index 58e5e67c1982e9247f62b82cd65a6355318c0dfe..7c0e358b5b45ff283675587ef35400030fc91fe1 100644 (file)
@@ -131,29 +131,10 @@ struct lwp_info;
 
 struct linux_target_ops
 {
-  /* Install a fast tracepoint jump pad.  See target.h for
-     comments.  */
-  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);
-
   /* Return the bytecode operations vector for the current inferior.
      Returns NULL if bytecode compilation is not supported.  */
   struct emit_ops *(*emit_ops) (void);
 
-  /* Return the minimum length of an instruction that can be safely overwritten
-     for use as a fast tracepoint.  */
-  int (*get_min_fast_tracepoint_insn_len) (void);
-
   /* Returns true if the low target supports range stepping.  */
   int (*supports_range_stepping) (void);
 
@@ -303,24 +284,6 @@ public:
 
   void stabilize_threads () 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;
-
   struct emit_ops *emit_ops () override;
 
   bool supports_disable_randomization () override;
index 48dadd69f7ec057b294bd29970ebc86461762218..8ce65dac8497eb1194e7a316a6a0ce819d7427ac 100644 (file)
@@ -161,9 +161,7 @@ m32r_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* install_fast_tracepoint_jump_pad */
   NULL, /* emit_ops */
-  NULL, /* get_min_fast_tracepoint_insn_len */
   NULL, /* supports_range_stepping */
   m32r_supports_hardware_single_step,
 };
index acbb6dde1d7e86da334347f6db28c6e2c1165368..017b26bca817a7bb19abf6bd59270c6ba3423033 100644 (file)
@@ -265,9 +265,7 @@ m68k_supports_hardware_single_step (void)
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* install_fast_tracepoint_jump_pad */
   NULL, /* emit_ops */
-  NULL, /* get_min_fast_tracepoint_insn_len */
   NULL, /* supports_range_stepping */
   m68k_supports_hardware_single_step,
 };
index 5935c42a7764f9e8200edb19ee995cbda81a4c01..09a9be306f01af32c3eb84e41e125a7802f707e6 100644 (file)
@@ -65,6 +65,18 @@ public:
 
   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;
+
 protected:
 
   void low_arch_setup () override;
@@ -1570,22 +1582,29 @@ ppc_relocate_instruction (CORE_ADDR *to, CORE_ADDR oldloc)
   *to += 4;
 }
 
+bool
+ppc_target::supports_fast_tracepoints ()
+{
+  return true;
+}
+
 /* Implement install_fast_tracepoint_jump_pad of target_ops.
    See target.h for details.  */
 
-static int
-ppc_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
+ppc_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)
 {
   uint32_t buf[256];
   uint32_t *p = buf;
@@ -1779,8 +1798,8 @@ ppc_install_fast_tracepoint_jump_pad (CORE_ADDR tpoint, CORE_ADDR tpaddr,
 
 /* Returns the minimum instruction length for installing a tracepoint.  */
 
-static int
-ppc_get_min_fast_tracepoint_insn_len (void)
+int
+ppc_target::get_min_fast_tracepoint_insn_len ()
 {
   return 4;
 }
@@ -3433,9 +3452,7 @@ ppc_get_ipa_tdesc_idx (void)
 }
 
 struct linux_target_ops the_low_target = {
-  ppc_install_fast_tracepoint_jump_pad,
   ppc_emit_ops,
-  ppc_get_min_fast_tracepoint_insn_len,
   NULL, /* supports_range_stepping */
   ppc_supports_hardware_single_step,
   NULL, /* get_syscall_trapinfo */
index 28a0a8b449f1834f5966ca07212823197b90f23d..2b093b898bdc9342e464ae152a010e90effb19c7 100644 (file)
@@ -65,6 +65,18 @@ public:
 
   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;
 
@@ -1255,23 +1267,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;
@@ -1425,11 +1437,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)
@@ -2849,9 +2861,7 @@ s390_emit_ops (void)
 }
 
 struct linux_target_ops the_low_target = {
-  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 */
index 30a966d5b4f34bb746d8c31f15e0ec92d025d11a..847f686380caff8b3d6fbfa04330ca8df8caf0b4 100644 (file)
@@ -192,9 +192,7 @@ sh_target::low_arch_setup ()
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* install_fast_tracepoint_jump_pad */
   NULL, /* emit_ops */
-  NULL, /* get_min_fast_tracepoint_insn_len */
   NULL, /* supports_range_stepping */
   sh_supports_hardware_single_step,
 };
index f0f9917c6f079c63d24b4a904c7d01da981bbe77..220681e9cece5ae2a0cf54171aba74f648dc26ef 100644 (file)
@@ -423,9 +423,7 @@ tic6x_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* install_fast_tracepoint_jump_pad */
   NULL, /* emit_ops */
-  NULL, /* get_min_fast_tracepoint_insn_len */
   NULL, /* supports_range_stepping */
   tic6x_supports_hardware_single_step,
 };
index d64d63bdeae0840e6dc618973bd908644b6d9394..7a840c4dbd68e0b5dff763d893ee362bc6882d49 100644 (file)
@@ -224,9 +224,7 @@ tile_supports_hardware_single_step (void)
 
 struct linux_target_ops the_low_target =
 {
-  NULL, /* install_fast_tracepoint_jump_pad */
   NULL, /* emit_ops */
-  NULL, /* get_min_fast_tracepoint_insn_len */
   NULL, /* supports_range_stepping */
   tile_supports_hardware_single_step,
 };
index 664d0d9f19912cf924eebaf6a44f5d540e82cfc3..de992fc062eea3660ea28052ac88fdef706edf81 100644 (file)
@@ -110,6 +110,18 @@ public:
 
   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;
+
 protected:
 
   void low_arch_setup () override;
@@ -1525,19 +1537,26 @@ i386_install_fast_tracepoint_jump_pad (CORE_ADDR tpoint, CORE_ADDR tpaddr,
   return 0;
 }
 
-static int
-x86_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)
+bool
+x86_target::supports_fast_tracepoints ()
+{
+  return true;
+}
+
+int
+x86_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)
 {
 #ifdef __x86_64__
   if (is_64bit_tdesc ())
@@ -1566,8 +1585,8 @@ x86_install_fast_tracepoint_jump_pad (CORE_ADDR tpoint, CORE_ADDR tpaddr,
 /* Return the minimum instruction length for fast tracepoints on x86/x86-64
    architectures.  */
 
-static int
-x86_get_min_fast_tracepoint_insn_len (void)
+int
+x86_target::get_min_fast_tracepoint_insn_len ()
 {
   static int warned_about_fast_tracepoints = 0;
 
@@ -2971,9 +2990,7 @@ x86_get_ipa_tdesc_idx (void)
 
 struct linux_target_ops the_low_target =
 {
-  x86_install_fast_tracepoint_jump_pad,
   x86_emit_ops,
-  x86_get_min_fast_tracepoint_insn_len,
   x86_supports_range_stepping,
   x86_supports_hardware_single_step,
   x86_get_syscall_trapinfo,
index 7bef61ac32994813404027b09497bf654459273f..94501216e0c8b46485c40de1e10720a83958d46a 100644 (file)
@@ -329,9 +329,7 @@ xtensa_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* install_fast_tracepoint_jump_pad */
   NULL, /* emit_ops */
-  NULL, /* get_min_fast_tracepoint_insn_len */
   NULL, /* supports_range_stepping */
   xtensa_supports_hardware_single_step,
 };