aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/linux-xtensa-low.c
diff options
context:
space:
mode:
authorAntoine Tremblay <antoine.tremblay@ericsson.com>2015-11-19 11:29:10 -0500
committerAntoine Tremblay <antoine.tremblay@ericsson.com>2015-11-30 15:17:36 -0500
commit7d00775ece9e2364da5cfd65ebbfce515859667f (patch)
tree02f8c0a3b595e756cb5dbb6e00b49e149e80c420 /gdb/gdbserver/linux-xtensa-low.c
parent2d97cd356e0f0320ecb71cf6a10616ba4618f318 (diff)
downloadgdb-7d00775ece9e2364da5cfd65ebbfce515859667f.zip
gdb-7d00775ece9e2364da5cfd65ebbfce515859667f.tar.gz
gdb-7d00775ece9e2364da5cfd65ebbfce515859667f.tar.bz2
Refactor queries for hardware and software single stepping support in GDBServer.
Before this patch there was only one call: can_hardware_single_step. Its implementation was a check on breakpoint_reinsert_addr if NULL it assumed that the target could hardware single step. This patch prepares for the case where this is not true anymore. In order to improve software single stepping in GDBServer the breakpoint_reinsert_addr operation of targets that had a very simple software implementation used only for stepping over thread creation events will be removed. This will create a case where a target does not support hardware single step and has the operation breakpoint_reinsert_addr set to NULL, thus can_hardware_single_step needs to be implemented another way. A new target operation supports_hardware_single_step is introduced and is to return true if the target does support such a feature, support for the feature is manually hardcoded. Note that the hardware single step support was enabled as per the current behavior, I did not check if tile for example really has ptrace singlestep support but since the current implementation assumed it had, I kept it that way. No regressions on Ubuntu 14.04 on ARMv7 and x86. With gdbserver-{native,extended} / { -marm -mthumb } Compilation tested on: aarch64,arm,bfind,crisv32,m32r,ppc,s390,tic6x,tile, xtensa. Not tested : sh. gdb/gdbserver/ChangeLog: * linux-aarch64-low.c (aarch64_supports_hardware_single_step): New function. (struct linux_target_ops) <supports_hardware_single_step>: Initialize. * linux-arm-low.c (arm_supports_hardware_single_step): New function. (struct linux_target_ops) <supports_hardware_single_step>: Initialize. * linux-bfin-low.c (bfin_supports_hardware_single_step): New function. (struct linux_target_ops) <bfin_supports_hardware_single_step>: Initialize. * linux-crisv32-low.c (cris_supports_hardware_single_step): New function. (struct linux_target_ops) <supports_hardware_single_step>: Initialize. * linux-low.c (can_hardware_single_step): Use supports_hardware_single_step. (can_software_single_step): New function. (start_step_over): Call can_software_single_step. (linux_supports_hardware_single_step): New function. (struct target_ops) <supports_software_single_step>: Initialize. * linux-low.h (struct linux_target_ops) <supports_hardware_single_step>: Initialize. * linux-m32r-low.c (m32r_supports_hardware_single_step): New function. (struct linux_target_ops) <supports_hardware_single_step>: Initialize. * linux-ppc-low.c (ppc_supports_hardware_single_step): New function. (struct linux_target_ops) <supports_hardware_single_step> Initialize. * linux-s390-low.c (s390_supports_hardware_single_step): New function. (struct linux_target_ops) <supports_hardware_single_step>: Initialize. * linux-sh-low.c (sh_supports_hardware_single_step): New function. (struct linux_target_ops) <supports_hardware_single_step>: Initialize. * linux-tic6x-low.c (tic6x_supports_hardware_single_step): New function. (struct linux_target_ops) <tic6x_supports_hardware_single_step>: Initialize. * linux-tile-low.c (tile_supports_hardware_single_step): New function. (struct linux_target_ops) <tile_supports_hardware_single_step>: Initialize. * linux-x86-low.c (x86_supports_hardware_single_step) New function. (struct linux_target_ops) <supports_hardware_single_step>: Initialize. * linux-xtensa-low.c (xtensa_supports_hardware_single_step): New function. (struct linux_target_ops) <supports_hardware_single_step>: Initialize. * target.h (struct target_ops): <supports_software_single_step>: New field. (target_supports_software_single_step): New macro.
Diffstat (limited to 'gdb/gdbserver/linux-xtensa-low.c')
-rw-r--r--gdb/gdbserver/linux-xtensa-low.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/gdb/gdbserver/linux-xtensa-low.c b/gdb/gdbserver/linux-xtensa-low.c
index 7c71631..b48e8dd 100644
--- a/gdb/gdbserver/linux-xtensa-low.c
+++ b/gdb/gdbserver/linux-xtensa-low.c
@@ -229,6 +229,14 @@ xtensa_arch_setup (void)
current_process ()->tdesc = tdesc_xtensa;
}
+/* Support for hardware single step. */
+
+static int
+xtensa_supports_hardware_single_step (void)
+{
+ return 1;
+}
+
static const struct regs_info *
xtensa_regs_info (void)
{
@@ -248,6 +256,27 @@ struct linux_target_ops the_low_target = {
NULL,
0,
xtensa_breakpoint_at,
+ NULL, /* supports_z_point_type */
+ NULL, /* insert_point */
+ NULL, /* remove_point */
+ NULL, /* stopped_by_watchpoint */
+ NULL, /* stopped_data_address */
+ NULL, /* collect_ptrace_register */
+ NULL, /* supply_ptrace_register */
+ NULL, /* siginfo_fixup */
+ NULL, /* new_process */
+ NULL, /* new_thread */
+ NULL, /* new_fork */
+ NULL, /* prepare_to_resume */
+ NULL, /* process_qsupported */
+ NULL, /* supports_tracepoints */
+ NULL, /* get_thread_area */
+ NULL, /* install_fast_tracepoint_jump_pad */
+ NULL, /* emit_ops */
+ NULL, /* get_min_fast_tracepoint_insn_len */
+ NULL, /* supports_range_stepping */
+ NULL, /* breakpoint_kind_from_current_state */
+ xtensa_supports_hardware_single_step,
};