aboutsummaryrefslogtreecommitdiff
path: root/target-arm
diff options
context:
space:
mode:
authorSergey Fedorov <serge.fdrv@gmail.com>2015-11-10 13:37:32 +0000
committerPeter Maydell <peter.maydell@linaro.org>2015-11-10 13:37:32 +0000
commit5c629f4ff4dc9ae79cc732f59a8df15ede796ff7 (patch)
tree6df7cbdc257583f2afaba09d7b2f07a00cf940f2 /target-arm
parenta8b4f9585a0bf5186fca793ce2c5d754cd8ec49a (diff)
downloadqemu-5c629f4ff4dc9ae79cc732f59a8df15ede796ff7.zip
qemu-5c629f4ff4dc9ae79cc732f59a8df15ede796ff7.tar.gz
qemu-5c629f4ff4dc9ae79cc732f59a8df15ede796ff7.tar.bz2
target-arm: Fix gdb singlestep handling in arm_debug_excp_handler()
Do not raise a CPU exception if no CPU breakpoint has fired, since singlestep is also done by generating a debug internal exception. This fixes a bug with singlestepping in gdbstub. Signed-off-by: Sergey Fedorov <serge.fdrv@gmail.com> Message-id: 1446726361-18328-1-git-send-email-serge.fdrv@gmail.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target-arm')
-rw-r--r--target-arm/op_helper.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/target-arm/op_helper.c b/target-arm/op_helper.c
index b5db345..6cd54c8 100644
--- a/target-arm/op_helper.c
+++ b/target-arm/op_helper.c
@@ -917,7 +917,13 @@ void arm_debug_excp_handler(CPUState *cs)
uint64_t pc = is_a64(env) ? env->pc : env->regs[15];
bool same_el = (arm_debug_target_el(env) == arm_current_el(env));
- if (cpu_breakpoint_test(cs, pc, BP_GDB)) {
+ /* (1) GDB breakpoints should be handled first.
+ * (2) Do not raise a CPU exception if no CPU breakpoint has fired,
+ * since singlestep is also done by generating a debug internal
+ * exception.
+ */
+ if (cpu_breakpoint_test(cs, pc, BP_GDB)
+ || !cpu_breakpoint_test(cs, pc, BP_CPU)) {
return;
}