aboutsummaryrefslogtreecommitdiff
path: root/gdbserver
diff options
context:
space:
mode:
authorTankut Baris Aktemur <tankut.baris.aktemur@intel.com>2020-04-02 15:11:31 +0200
committerTankut Baris Aktemur <tankut.baris.aktemur@intel.com>2020-04-02 15:11:31 +0200
commit9cfd87155142f0467cdadb067efd21e165956c20 (patch)
tree01c82d1e3d503f532aff25ec95ddc64c48c4d9af /gdbserver
parentab64c99982e1e26439dc66b2ea04aa0d4b0458c9 (diff)
downloadgdb-9cfd87155142f0467cdadb067efd21e165956c20.zip
gdb-9cfd87155142f0467cdadb067efd21e165956c20.tar.gz
gdb-9cfd87155142f0467cdadb067efd21e165956c20.tar.bz2
gdbserver/linux-low: turn 'supports_range_stepping' into a method
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.
Diffstat (limited to 'gdbserver')
-rw-r--r--gdbserver/ChangeLog33
-rw-r--r--gdbserver/linux-aarch64-low.cc11
-rw-r--r--gdbserver/linux-arm-low.cc1
-rw-r--r--gdbserver/linux-bfin-low.cc1
-rw-r--r--gdbserver/linux-crisv32-low.cc1
-rw-r--r--gdbserver/linux-low.cc10
-rw-r--r--gdbserver/linux-low.h6
-rw-r--r--gdbserver/linux-m32r-low.cc1
-rw-r--r--gdbserver/linux-m68k-low.cc1
-rw-r--r--gdbserver/linux-ppc-low.cc1
-rw-r--r--gdbserver/linux-s390-low.cc1
-rw-r--r--gdbserver/linux-sh-low.cc1
-rw-r--r--gdbserver/linux-tic6x-low.cc1
-rw-r--r--gdbserver/linux-tile-low.cc1
-rw-r--r--gdbserver/linux-x86-low.cc9
-rw-r--r--gdbserver/linux-xtensa-low.cc1
16 files changed, 54 insertions, 26 deletions
diff --git a/gdbserver/ChangeLog b/gdbserver/ChangeLog
index 203b534..3190187 100644
--- a/gdbserver/ChangeLog
+++ b/gdbserver/ChangeLog
@@ -1,5 +1,38 @@
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
linux target define the op by overriding the declaration of
process_stratum_target.
diff --git a/gdbserver/linux-aarch64-low.cc b/gdbserver/linux-aarch64-low.cc
index c9893c8..b23f1c8 100644
--- a/gdbserver/linux-aarch64-low.cc
+++ b/gdbserver/linux-aarch64-low.cc
@@ -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,
};
diff --git a/gdbserver/linux-arm-low.cc b/gdbserver/linux-arm-low.cc
index a235f4e..a7d5261 100644
--- a/gdbserver/linux-arm-low.cc
+++ b/gdbserver/linux-arm-low.cc
@@ -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,
};
diff --git a/gdbserver/linux-bfin-low.cc b/gdbserver/linux-bfin-low.cc
index b20edf7..3b24124 100644
--- a/gdbserver/linux-bfin-low.cc
+++ b/gdbserver/linux-bfin-low.cc
@@ -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,
};
diff --git a/gdbserver/linux-crisv32-low.cc b/gdbserver/linux-crisv32-low.cc
index ca56cab..8850e73 100644
--- a/gdbserver/linux-crisv32-low.cc
+++ b/gdbserver/linux-crisv32-low.cc
@@ -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,
};
diff --git a/gdbserver/linux-low.cc b/gdbserver/linux-low.cc
index 71cc140..7ec01f4 100644
--- a/gdbserver/linux-low.cc
+++ b/gdbserver/linux-low.cc
@@ -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
diff --git a/gdbserver/linux-low.h b/gdbserver/linux-low.h
index 6db56d0..86a563a 100644
--- a/gdbserver/linux-low.h
+++ b/gdbserver/linux-low.h
@@ -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 ();
};
diff --git a/gdbserver/linux-m32r-low.cc b/gdbserver/linux-m32r-low.cc
index 82dde99..8104e54 100644
--- a/gdbserver/linux-m32r-low.cc
+++ b/gdbserver/linux-m32r-low.cc
@@ -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,
};
diff --git a/gdbserver/linux-m68k-low.cc b/gdbserver/linux-m68k-low.cc
index 0b30291..ccad368 100644
--- a/gdbserver/linux-m68k-low.cc
+++ b/gdbserver/linux-m68k-low.cc
@@ -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,
};
diff --git a/gdbserver/linux-ppc-low.cc b/gdbserver/linux-ppc-low.cc
index 58f6629..4993125 100644
--- a/gdbserver/linux-ppc-low.cc
+++ b/gdbserver/linux-ppc-low.cc
@@ -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,
diff --git a/gdbserver/linux-s390-low.cc b/gdbserver/linux-s390-low.cc
index 5ea4830..b5d5e89 100644
--- a/gdbserver/linux-s390-low.cc
+++ b/gdbserver/linux-s390-low.cc
@@ -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,
diff --git a/gdbserver/linux-sh-low.cc b/gdbserver/linux-sh-low.cc
index 6f270ed..db40322 100644
--- a/gdbserver/linux-sh-low.cc
+++ b/gdbserver/linux-sh-low.cc
@@ -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,
};
diff --git a/gdbserver/linux-tic6x-low.cc b/gdbserver/linux-tic6x-low.cc
index 6a0be06..c80a2fb 100644
--- a/gdbserver/linux-tic6x-low.cc
+++ b/gdbserver/linux-tic6x-low.cc
@@ -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,
};
diff --git a/gdbserver/linux-tile-low.cc b/gdbserver/linux-tile-low.cc
index b18134d..10af23f 100644
--- a/gdbserver/linux-tile-low.cc
+++ b/gdbserver/linux-tile-low.cc
@@ -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,
};
diff --git a/gdbserver/linux-x86-low.cc b/gdbserver/linux-x86-low.cc
index 8e35ab1..dce9a5f 100644
--- a/gdbserver/linux-x86-low.cc
+++ b/gdbserver/linux-x86-low.cc
@@ -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,
diff --git a/gdbserver/linux-xtensa-low.cc b/gdbserver/linux-xtensa-low.cc
index 774ad0a..e273666 100644
--- a/gdbserver/linux-xtensa-low.cc
+++ b/gdbserver/linux-xtensa-low.cc
@@ -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,
};