From 3ca4edb6617353defacd3bf3a4ee3d458238419e Mon Sep 17 00:00:00 2001 From: Tankut Baris Aktemur Date: Thu, 2 Apr 2020 15:11:25 +0200 Subject: gdbserver/linux-low: turn 'sw_breakpoint_from_kind' into a method gdbserver/ChangeLog: 2020-04-02 Tankut Baris Aktemur Remove the 'sw_breakpoint_from_kind' linux target op, and let the concrete linux target define it by overriding the op in process_stratum_target. * linux-low.cc (linux_process_target::sw_breakpoint_from_kind): Remove. * linux-low.h (struct linux_target_ops): Remove the op. (class linux_process_target) : Remove. * linux-x86-low.cc (class x86_target) : Declare. (x86_sw_breakpoint_from_kind): Turn into... (x86_target::sw_breakpoint_from_kind): ...this. (the_low_target): Remove the op field. * linux-aarch64-low.cc (class aarch64_target) : Declare. (aarch64_sw_breakpoint_from_kind): Turn into... (aarch64_target::sw_breakpoint_from_kind): ...this. (the_low_target): Remove the op field. * linux-arm-low.cc (class arm_target) : Declare. (arm_target::sw_breakpoint_from_kind): Define. (the_low_target): Remove the op field. * linux-bfin-low.cc (class bfin_target) : Declare. (bfin_sw_breakpoint_from_kind): Turn into... (bfin_target::sw_breakpoint_from_kind): ...this. (the_low_target): Remove the op field. * linux-cris-low.cc (class cris_target) : Declare. (cris_sw_breakpoint_from_kind): Turn into... (cris_target::sw_breakpoint_from_kind): ...this. (the_low_target): Remove the op field. * linux-crisv32-low.cc (class crisv32_target) : Declare. (cris_sw_breakpoint_from_kind): Turn into... (crisv32_target::sw_breakpoint_from_kind): ...this. (the_low_target): Remove the op field. * linux-ia64-low.cc (class ia64_target) : Declare. (ia64_target::sw_breakpoint_from_kind): Define. * linux-m32r-low.cc (class m32r_target) : Declare. (m32r_sw_breakpoint_from_kind): Turn into... (m32r_target::sw_breakpoint_from_kind): ...this. (the_low_target): Remove the op field. * linux-m68k-low.cc (class m68k_target) : Declare. (m68k_sw_breakpoint_from_kind): Turn into... (m68k_target::sw_breakpoint_from_kind): ...this. (the_low_target): Remove the op field. * linux-mips-low.cc (class mips_target) : Declare. (mips_sw_breakpoint_from_kind): Turn into... (mips_target::sw_breakpoint_from_kind): ...this. (the_low_target): Remove the op field. * linux-nios2-low.cc (class nios2_target) : Declare. (nios2_sw_breakpoint_from_kind): Turn into... (nios2_target::sw_breakpoint_from_kind): ...this. (the_low_target): Remove the op field. * linux-ppc-low.cc (class ppc_target) : Declare. (ppc_sw_breakpoint_from_kind): Turn into... (ppc_target::sw_breakpoint_from_kind): ...this. (the_low_target): Remove the op field. * linux-riscv-low.cc (class riscv_target) : Declare. (riscv_sw_breakpoint_from_kind): Turn into... (riscv_target::sw_breakpoint_from_kind): ...this. (the_low_target): Remove the op field. * linux-s390-low.cc (class s390_target) : Declare. (s390_sw_breakpoint_from_kind): Turn into... (s390_target::sw_breakpoint_from_kind): ...this. (the_low_target): Remove the op field. * linux-sh-low.cc (class sh_target) : Declare. (sh_sw_breakpoint_from_kind): Turn into... (sh_target::sw_breakpoint_from_kind): ...this. (the_low_target): Remove the op field. * linux-sparc-low.cc (class sparc_target) : Declare. (sparc_sw_breakpoint_from_kind): Turn into... (sparc_target::sw_breakpoint_from_kind): ...this. (the_low_target): Remove the op field. * linux-tic6x-low.cc (class tic6x_target) : Declare. (tic6x_sw_breakpoint_from_kind): Turn into... (tic6x_target::sw_breakpoint_from_kind): ...this. (the_low_target): Remove the op field. * linux-tile-low.cc (class tile_target) : Declare. (tile_sw_breakpoint_from_kind): Turn into... (tile_target::sw_breakpoint_from_kind): ...this. (the_low_target): Remove the op field. * linux-xtensa-low.cc (class xtensa_target) : Declare. (xtensa_sw_breakpoint_from_kind): Turn into... (xtensa_target::sw_breakpoint_from_kind): ...this. (the_low_target): Remove the op field. --- gdbserver/linux-aarch64-low.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'gdbserver/linux-aarch64-low.cc') diff --git a/gdbserver/linux-aarch64-low.cc b/gdbserver/linux-aarch64-low.cc index c9c9b30..23c9c3e 100644 --- a/gdbserver/linux-aarch64-low.cc +++ b/gdbserver/linux-aarch64-low.cc @@ -61,6 +61,8 @@ public: int breakpoint_kind_from_current_state (CORE_ADDR *pcptr) override; + const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override; + protected: void low_arch_setup () override; @@ -3054,10 +3056,10 @@ aarch64_supports_range_stepping (void) return 1; } -/* Implementation of linux_target_ops method "sw_breakpoint_from_kind". */ +/* Implementation of target ops method "sw_breakpoint_from_kind". */ -static const gdb_byte * -aarch64_sw_breakpoint_from_kind (int kind, int *size) +const gdb_byte * +aarch64_target::sw_breakpoint_from_kind (int kind, int *size) { if (is_64bit_tdesc ()) { @@ -3101,7 +3103,6 @@ aarch64_supports_hardware_single_step (void) struct linux_target_ops the_low_target = { - aarch64_sw_breakpoint_from_kind, NULL, /* get_next_pcs */ 0, /* decr_pc_after_break */ aarch64_breakpoint_at, -- cgit v1.1