gdbserver/linux-low: turn 'supports_tracepoints' into a method
authorTankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Thu, 2 Apr 2020 13:11:29 +0000 (15:11 +0200)
committerTankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Thu, 2 Apr 2020 13:11:29 +0000 (15:11 +0200)
gdbserver/ChangeLog:
2020-04-02  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>

Remote the 'supports_tracepoints' linux target op and let the
concrete linux target define it by overriding the op declared in
process_stratum_target.

* linux-low.h (struct linux_target_ops): Remove the op.
(class linux_process_target) <supports_tracepoints>: Remove.
* linux-low.cc (linux_process_target::supports_tracepoints): Remove.
* linux-x86-low.cc (class x86_target) <supports_tracepoints>:
Declare.
(x86_supports_tracepoints): Turn into...
(x86_target::supports_tracepoints): ...this.
(the_low_target): Remove the op field.
* linux-aarch64-low.cc (class aarch64_target)
<supports_tracepoints>: Declare.
(aarch64_supports_tracepoints): Turn into...
(aarch64_target::supports_tracepoints): ...this.
(the_low_target): Remove the op field.
* linux-ppc-low.cc (class ppc_target) <supports_tracepoints>:
Declare.
(ppc_supports_tracepoints): Turn into...
(ppc_target::supports_tracepoints): ...this.
(the_low_target): Remove the op field.
* linux-s390-low.cc (class s390_target) <supports_tracepoints>:
Declare.
(s390_supports_tracepoints): Turn into...
(s390_target::supports_tracepoints): ...this.
(the_low_target): Remove the op field.
* linux-arm-low.cc (the_low_target): Remove the op field.
* 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 e42b3d843907856a3278225d75d3ce4d7918df78..a7635e06b1e98a244fd4297df9e520fbcc8eeabf 100644 (file)
@@ -1,3 +1,42 @@
+2020-04-02  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>
+
+       Remote the 'supports_tracepoints' linux target op and let the
+       concrete linux target define it by overriding the op declared in
+       process_stratum_target.
+
+       * linux-low.h (struct linux_target_ops): Remove the op.
+       (class linux_process_target) <supports_tracepoints>: Remove.
+       * linux-low.cc (linux_process_target::supports_tracepoints): Remove.
+       * linux-x86-low.cc (class x86_target) <supports_tracepoints>:
+       Declare.
+       (x86_supports_tracepoints): Turn into...
+       (x86_target::supports_tracepoints): ...this.
+       (the_low_target): Remove the op field.
+       * linux-aarch64-low.cc (class aarch64_target)
+       <supports_tracepoints>: Declare.
+       (aarch64_supports_tracepoints): Turn into...
+       (aarch64_target::supports_tracepoints): ...this.
+       (the_low_target): Remove the op field.
+       * linux-ppc-low.cc (class ppc_target) <supports_tracepoints>:
+       Declare.
+       (ppc_supports_tracepoints): Turn into...
+       (ppc_target::supports_tracepoints): ...this.
+       (the_low_target): Remove the op field.
+       * linux-s390-low.cc (class s390_target) <supports_tracepoints>:
+       Declare.
+       (s390_supports_tracepoints): Turn into...
+       (s390_target::supports_tracepoints): ...this.
+       (the_low_target): Remove the op field.
+       * linux-arm-low.cc (the_low_target): Remove the op field.
+       * 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>
 
        Remove the 'process_qsupported' linux target op and let a concrete
index 56bf027b888b1769fbebb8acefeea31076f7e5f8..cbca3d6a9ad1f7ac3b0be9ce394e6d557b3bf99f 100644 (file)
@@ -65,6 +65,8 @@ public:
 
   bool supports_z_point_type (char z_type) override;
 
+  bool supports_tracepoints () override;
+
 protected:
 
   void low_arch_setup () override;
@@ -715,13 +717,13 @@ aarch64_target::get_regs_info ()
   return &regs_info_aarch64;
 }
 
-/* Implementation of linux_target_ops method "supports_tracepoints".  */
+/* Implementation of target ops method "supports_tracepoints".  */
 
-static int
-aarch64_supports_tracepoints (void)
+bool
+aarch64_target::supports_tracepoints ()
 {
   if (current_thread == NULL)
-    return 1;
+    return true;
   else
     {
       /* We don't support tracepoints on aarch32 now.  */
@@ -3147,7 +3149,6 @@ aarch64_supports_hardware_single_step (void)
 
 struct linux_target_ops the_low_target =
 {
-  aarch64_supports_tracepoints,
   aarch64_get_thread_area,
   aarch64_install_fast_tracepoint_jump_pad,
   aarch64_emit_ops,
index 9e74b03df07bbad325237cbdcafcae679c9728be..383f217277add4953ae31e5b28af96ccac6d9c14 100644 (file)
@@ -1117,7 +1117,6 @@ arm_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* supports_tracepoints */
   NULL, /* get_thread_area */
   NULL, /* install_fast_tracepoint_jump_pad */
   NULL, /* emit_ops */
index aa8a16e1d168840dd017a2ab816ce3eb3b3172ad..06fcf76bf50f727e51382827a731b70478f49f88 100644 (file)
@@ -171,7 +171,6 @@ bfin_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* supports_tracepoints */
   NULL, /* get_thread_area */
   NULL, /* install_fast_tracepoint_jump_pad */
   NULL, /* emit_ops */
index f0851cabedd98fa3f8dbe1172401df894936393a..ab711c41690dc9a84d713877f9b6fef64f55cfb1 100644 (file)
@@ -468,7 +468,6 @@ crisv32_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* supports_tracepoints */
   NULL, /* get_thread_area */
   NULL, /* install_fast_tracepoint_jump_pad */
   NULL, /* emit_ops */
index e94118bd80037d21bc823f985a59947295c216e2..2b522348201750a6946f638c92bd3b0ef52b36bf 100644 (file)
@@ -6441,15 +6441,6 @@ linux_process_target::get_ipa_tdesc_idx ()
   return (*the_low_target.get_ipa_tdesc_idx) ();
 }
 
-bool
-linux_process_target::supports_tracepoints ()
-{
-  if (*the_low_target.supports_tracepoints == NULL)
-    return false;
-
-  return (*the_low_target.supports_tracepoints) ();
-}
-
 CORE_ADDR
 linux_process_target::read_pc (regcache *regcache)
 {
index bc45e3fbcb5bdc085e557888352e16bcdb83a8cb..223b19ddafdf19bde60b4c4cf5e2c4f771a23e6c 100644 (file)
@@ -131,9 +131,6 @@ struct lwp_info;
 
 struct linux_target_ops
 {
-  /* Returns true if the low target supports tracepoints.  */
-  int (*supports_tracepoints) (void);
-
   /* Fill ADDRP with the thread area address of LWPID.  Returns 0 on
      success, -1 on failure.  */
   int (*get_thread_area) (int lwpid, CORE_ADDR *addrp);
@@ -296,8 +293,6 @@ public:
                    unsigned char *myaddr, unsigned int len) override;
 #endif
 
-  bool supports_tracepoints () override;
-
   CORE_ADDR read_pc (regcache *regcache) override;
 
   void write_pc (regcache *regcache, CORE_ADDR pc) override;
index 3ba2b0ea5eec410899eac9f601943e0a4dd75d75..601522bc6111e66fdea33d313f9dd447ee4d1060 100644 (file)
@@ -161,7 +161,6 @@ m32r_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* supports_tracepoints */
   NULL, /* get_thread_area */
   NULL, /* install_fast_tracepoint_jump_pad */
   NULL, /* emit_ops */
index 4f9b68b8eefa0e16f4330f2d4e96923d11b26b02..6e16764d394b009b57998efcd945cc257c4f454f 100644 (file)
@@ -265,7 +265,6 @@ m68k_supports_hardware_single_step (void)
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* supports_tracepoints */
   NULL, /* get_thread_area */
   NULL, /* install_fast_tracepoint_jump_pad */
   NULL, /* emit_ops */
index 0c3d5eb9897c07ce693bf9433fd4c4642495bf3f..063707c5c7c6aa10c81f6dae5a8f0d48f294c7ef 100644 (file)
@@ -62,6 +62,9 @@ public:
 
   void low_supply_ptrace_register (regcache *regcache, int regno,
                                   const char *buf) override;
+
+  bool supports_tracepoints () override;
+
 protected:
 
   void low_arch_setup () override;
@@ -1024,12 +1027,12 @@ ppc_target::low_arch_setup ()
       }
 }
 
-/* Implementation of linux_target_ops method "supports_tracepoints".  */
+/* Implementation of target ops method "supports_tracepoints".  */
 
-static int
-ppc_supports_tracepoints (void)
+bool
+ppc_target::supports_tracepoints ()
 {
-  return 1;
+  return true;
 }
 
 /* Get the thread area address.  This is used to recognize which
@@ -3428,7 +3431,6 @@ ppc_get_ipa_tdesc_idx (void)
 }
 
 struct linux_target_ops the_low_target = {
-  ppc_supports_tracepoints,
   ppc_get_thread_area,
   ppc_install_fast_tracepoint_jump_pad,
   ppc_emit_ops,
index d3be399315cd140357bf26669ca54b7ca31f87de..22305fe9ce910f52236c40e18ede04e91a5a88b7 100644 (file)
@@ -63,6 +63,8 @@ public:
 
   bool supports_z_point_type (char z_type) override;
 
+  bool supports_tracepoints () override;
+
   void low_collect_ptrace_register (regcache *regcache, int regno,
                                    char *buf) override;
 
@@ -770,12 +772,12 @@ 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".  */
@@ -2845,7 +2847,6 @@ s390_emit_ops (void)
 }
 
 struct linux_target_ops the_low_target = {
-  s390_supports_tracepoints,
   s390_get_thread_area,
   s390_install_fast_tracepoint_jump_pad,
   s390_emit_ops,
index ac6b1d7b1c15d90798c3518ad1b845bccaa6a2dc..4fead793f9730636100647346a3e16acd56167a5 100644 (file)
@@ -192,7 +192,6 @@ sh_target::low_arch_setup ()
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* supports_tracepoints */
   NULL, /* get_thread_area */
   NULL, /* install_fast_tracepoint_jump_pad */
   NULL, /* emit_ops */
index bf7099bf7fc5a81d061f5b688ecd30f66cd96bf5..e385edd4324d873dc21b184070eac391d644f5af 100644 (file)
@@ -423,7 +423,6 @@ tic6x_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* supports_tracepoints */
   NULL, /* get_thread_area */
   NULL, /* install_fast_tracepoint_jump_pad */
   NULL, /* emit_ops */
index 355657bf95ec3d7ebcd48ed605cbc96b8b1e6130..ad2e716e4340488db4b6790f5eda45300ff733d5 100644 (file)
@@ -224,7 +224,6 @@ tile_supports_hardware_single_step (void)
 
 struct linux_target_ops the_low_target =
 {
-  NULL, /* supports_tracepoints */
   NULL, /* get_thread_area */
   NULL, /* install_fast_tracepoint_jump_pad */
   NULL, /* emit_ops */
index bf5245e5b2d75a1baa15086a3e314f9b97f9553f..b7bbc81cbee5b2c61b386cda43041e5e398079a0 100644 (file)
@@ -108,6 +108,8 @@ public:
 
   void process_qsupported (char **features, int count) override;
 
+  bool supports_tracepoints () override;
+
 protected:
 
   void low_arch_setup () override;
@@ -1109,10 +1111,10 @@ x86_get_syscall_trapinfo (struct regcache *regcache, int *sysno)
     collect_register_by_name (regcache, "orig_eax", sysno);
 }
 
-static int
-x86_supports_tracepoints (void)
+bool
+x86_target::supports_tracepoints ()
 {
-  return 1;
+  return true;
 }
 
 static void
@@ -2967,7 +2969,6 @@ x86_get_ipa_tdesc_idx (void)
 
 struct linux_target_ops the_low_target =
 {
-  x86_supports_tracepoints,
   x86_get_thread_area,
   x86_install_fast_tracepoint_jump_pad,
   x86_emit_ops,
index b6d0889e99879b452194b33e1a3d8781169fc292..5a009df551d8666d14883c2ba79415b959b35757 100644 (file)
@@ -329,7 +329,6 @@ xtensa_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* supports_tracepoints */
   NULL, /* get_thread_area */
   NULL, /* install_fast_tracepoint_jump_pad */
   NULL, /* emit_ops */