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

Turn the 'supports_range_stepping' linux target op into a method
of linux_process_target.

* linux-low.h (struct linux_target_ops): Remove the op.
(class linux_process_target) <low_supports_range_stepping>: Declare.
* linux-low.cc (linux_process_target::low_supports_range_stepping):
Define.
(linux_process_target::supports_range_stepping): Update the call
site.
* linux-x86-low.cc (class x86_target)
<low_supports_range_stepping>: Declare.
(x86_supports_range_stepping): Turn into...
(x86_target::low_supports_range_stepping): ...this.
(the_low_target): Remove the op field.
* linux-aarch64-low.cc (class aarch64_target)
<low_supports_range_stepping>: Declare.
(aarch64_supports_range_stepping): Turn into...
(aarch64_target::low_supports_range_stepping): ...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-ppc-low.cc (the_low_target): Ditto.
* linux-s390-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 203b53453cf4af4f2e6d3691c5c31cc0c674d32f..31901878e2eead95dd8839da7ec938727e3a1d46 100644 (file)
@@ -1,3 +1,36 @@
+2020-04-02  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>
+
+       Turn the 'supports_range_stepping' linux target op into a method
+       of linux_process_target.
+
+       * linux-low.h (struct linux_target_ops): Remove the op.
+       (class linux_process_target) <low_supports_range_stepping>: Declare.
+       * linux-low.cc (linux_process_target::low_supports_range_stepping):
+       Define.
+       (linux_process_target::supports_range_stepping): Update the call
+       site.
+       * linux-x86-low.cc (class x86_target)
+       <low_supports_range_stepping>: Declare.
+       (x86_supports_range_stepping): Turn into...
+       (x86_target::low_supports_range_stepping): ...this.
+       (the_low_target): Remove the op field.
+       * linux-aarch64-low.cc (class aarch64_target)
+       <low_supports_range_stepping>: Declare.
+       (aarch64_supports_range_stepping): Turn into...
+       (aarch64_target::low_supports_range_stepping): ...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-ppc-low.cc (the_low_target): Ditto.
+       * linux-s390-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 'emit_ops' linux target ops and let the concrete
index c9893c80fcd2981854d74b9d01fc0588216abafd..b23f1c8e1f2b19edf981b9148c29f68fe172bbfa 100644 (file)
@@ -123,6 +123,8 @@ protected:
   void low_prepare_to_resume (lwp_info *lwp) override;
 
   int low_get_thread_area (int lwpid, CORE_ADDR *addrp) override;
+
+  bool low_supports_range_stepping () override;
 };
 
 /* The singleton target ops object.  */
@@ -3110,12 +3112,12 @@ aarch64_target::get_min_fast_tracepoint_insn_len ()
   return 4;
 }
 
-/* Implementation of linux_target_ops method "supports_range_stepping".  */
+/* Implementation of linux target ops method "low_supports_range_stepping".  */
 
-static int
-aarch64_supports_range_stepping (void)
+bool
+aarch64_target::low_supports_range_stepping ()
 {
-  return 1;
+  return true;
 }
 
 /* Implementation of target ops method "sw_breakpoint_from_kind".  */
@@ -3165,7 +3167,6 @@ aarch64_supports_hardware_single_step (void)
 
 struct linux_target_ops the_low_target =
 {
-  aarch64_supports_range_stepping,
   aarch64_supports_hardware_single_step,
   aarch64_get_syscall_trapinfo,
 };
index a235f4e1c55422cfd56573a5782bbae6bf47c1e7..a7d5261d2e22cfc1ed5dedcb9f99154f1c6c2bad 100644 (file)
@@ -1117,7 +1117,6 @@ arm_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* supports_range_stepping */
   arm_supports_hardware_single_step,
   arm_get_syscall_trapinfo,
 };
index b20edf7adc4a0bebb079056aa22bd023d3de87c0..3b241249173802ce5c78008e768b062c1acfdc63 100644 (file)
@@ -171,7 +171,6 @@ bfin_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* supports_range_stepping */
   bfin_supports_hardware_single_step,
 };
 
index ca56cabecd3da5eaa956deab30657821076d8c91..8850e73b7e1612225068a7c5ab9a71f5827cd84a 100644 (file)
@@ -468,7 +468,6 @@ crisv32_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* supports_range_stepping */
   cris_supports_hardware_single_step,
 };
 
index 71cc140d69db6363daa0514005bcdbf893afc6d1..7ec01f473aa57601906954f5c79f066ecb321d68 100644 (file)
@@ -6289,10 +6289,14 @@ linux_process_target::supports_range_stepping ()
 {
   if (supports_software_single_step ())
     return true;
-  if (*the_low_target.supports_range_stepping == NULL)
-    return false;
 
-  return (*the_low_target.supports_range_stepping) ();
+  return low_supports_range_stepping ();
+}
+
+bool
+linux_process_target::low_supports_range_stepping ()
+{
+  return false;
 }
 
 bool
index 6db56d0e10698e502a11e9a6e88d87ef0b7fb6c1..86a563a053ca002ffcce46c9638120314f7429b0 100644 (file)
@@ -131,9 +131,6 @@ struct lwp_info;
 
 struct linux_target_ops
 {
-  /* Returns true if the low target supports range stepping.  */
-  int (*supports_range_stepping) (void);
-
   /* See target.h.  */
   int (*supports_hardware_single_step) (void);
 
@@ -678,6 +675,9 @@ protected:
      success, -1 on failure.  */
   virtual int low_get_thread_area (int lwpid, CORE_ADDR *addrp);
 
+  /* Returns true if the low target supports range stepping.  */
+  virtual bool low_supports_range_stepping ();
+
   /* How many bytes the PC should be decremented after a break.  */
   virtual int low_decr_pc_after_break ();
 };
index 82dde9938bd4107dd39a520e30edf56f0b59422e..8104e54c10d8acb9c4c13c0674b3f580f5d53a82 100644 (file)
@@ -161,7 +161,6 @@ m32r_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* supports_range_stepping */
   m32r_supports_hardware_single_step,
 };
 
index 0b30291d3fb3bf28bddc33cdc83a50286d6915a9..ccad368ea066de23865f35321e3a1975a8dc1c04 100644 (file)
@@ -265,7 +265,6 @@ m68k_supports_hardware_single_step (void)
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* supports_range_stepping */
   m68k_supports_hardware_single_step,
 };
 
index 58f6629917cf9ccc5bf170af7aaf34de42adcbe7..4993125db99ed3ed094676ea720c5a6c0826b4fc 100644 (file)
@@ -3454,7 +3454,6 @@ ppc_get_ipa_tdesc_idx (void)
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* supports_range_stepping */
   ppc_supports_hardware_single_step,
   NULL, /* get_syscall_trapinfo */
   ppc_get_ipa_tdesc_idx,
index 5ea4830dd1628323dfd8226905bf92311a8a439f..b5d5e898c0d8ec45cac1dfe75016b6f9d1d419d3 100644 (file)
@@ -2863,7 +2863,6 @@ s390_target::emit_ops ()
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* supports_range_stepping */
   s390_supports_hardware_single_step,
   NULL, /* get_syscall_trapinfo */
   s390_get_ipa_tdesc_idx,
index 6f270ed989ed5103a037e1f376d699f416e98c01..db40322cd43fceb0dd987dfd72c59a444d79b34f 100644 (file)
@@ -192,7 +192,6 @@ sh_target::low_arch_setup ()
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* supports_range_stepping */
   sh_supports_hardware_single_step,
 };
 
index 6a0be06da5e498304facf09d3efeca2278d40d2f..c80a2fb20ed82ed31e46ac997af9e515e16e6f74 100644 (file)
@@ -423,7 +423,6 @@ tic6x_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* supports_range_stepping */
   tic6x_supports_hardware_single_step,
 };
 
index b18134d6d8a801c358440350439918e5e7d4dea3..10af23fa48bb2adc220740acecec7b1cc2436ef2 100644 (file)
@@ -224,7 +224,6 @@ tile_supports_hardware_single_step (void)
 
 struct linux_target_ops the_low_target =
 {
-  NULL, /* supports_range_stepping */
   tile_supports_hardware_single_step,
 };
 
index 8e35ab172bf16f49828ad5cea4fca6f3f2c2e456..dce9a5fb7d7e0d3cd61e14baa1ac14ca8e03bd21 100644 (file)
@@ -174,6 +174,8 @@ protected:
 
   int low_get_thread_area (int lwpid, CORE_ADDR *addrp) override;
 
+  bool low_supports_range_stepping () override;
+
 private:
 
   /* Update all the target description of all processes; a new GDB
@@ -2956,10 +2958,10 @@ x86_target::sw_breakpoint_from_kind (int kind, int *size)
   return x86_breakpoint;
 }
 
-static int
-x86_supports_range_stepping (void)
+bool
+x86_target::low_supports_range_stepping ()
 {
-  return 1;
+  return true;
 }
 
 /* Implementation of linux_target_ops method "supports_hardware_single_step".
@@ -2992,7 +2994,6 @@ x86_get_ipa_tdesc_idx (void)
 
 struct linux_target_ops the_low_target =
 {
-  x86_supports_range_stepping,
   x86_supports_hardware_single_step,
   x86_get_syscall_trapinfo,
   x86_get_ipa_tdesc_idx,
index 774ad0a2ccbe3700de37295af93a101c4ab41ebb..e273666e1cfdb5b9188d3656d2c289a357b60ed2 100644 (file)
@@ -329,7 +329,6 @@ xtensa_target::get_regs_info ()
 }
 
 struct linux_target_ops the_low_target = {
-  NULL, /* supports_range_stepping */
   xtensa_supports_hardware_single_step,
 };
 
This page took 0.038919 seconds and 4 git commands to generate.