From 2472b6c07bb50179019589af1c22f43935ab7f5c Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Fri, 12 Sep 2014 19:04:17 +0100 Subject: gdbstub: Allow target CPUs to specify watchpoint STOP_BEFORE_ACCESS flag GDB assumes that watchpoint set via the gdbstub remote protocol will behave in the same way as hardware watchpoints for the target. In particular, whether the CPU stops with the PC before or after the insn which triggers the watchpoint is target dependent. Allow guest CPU code to specify which behaviour to use. This fixes a bug where with guest CPUs which stop before the accessing insn GDB would manually step forward over what it thought was the insn and end up one insn further forward than it should be. We set this flag for the CPU architectures which set gdbarch_have_nonsteppable_watchpoint in gdb 7.7: ARM, CRIS, LM32, MIPS and Xtensa. Signed-off-by: Peter Maydell Reviewed-by: Edgar E. Iglesias Tested-by: Max Filippov Tested-by: Edgar E. Iglesias Tested-by: Michael Walle (for lm32) Message-id: 1410545057-14014-1-git-send-email-peter.maydell@linaro.org --- target-arm/cpu.c | 1 + 1 file changed, 1 insertion(+) (limited to 'target-arm') diff --git a/target-arm/cpu.c b/target-arm/cpu.c index 8ab6d95..edfd586 100644 --- a/target-arm/cpu.c +++ b/target-arm/cpu.c @@ -1117,6 +1117,7 @@ static void arm_cpu_class_init(ObjectClass *oc, void *data) #endif cc->gdb_num_core_regs = 26; cc->gdb_core_xml_file = "arm-core.xml"; + cc->gdb_stop_before_watchpoint = true; cc->debug_excp_handler = arm_debug_excp_handler; } -- cgit v1.1