diff mbox

[PULL,12/13] target-arm: Fix GDB breakpoint handling

Message ID 1445003887-14475-13-git-send-email-peter.maydell@linaro.org
State Accepted
Commit e63a2d4d9ed73e33a0b7483085808048be8bbcb1
Headers show

Commit Message

Peter Maydell Oct. 16, 2015, 1:58 p.m. UTC
From: Sergey Fedorov <serge.fdrv@gmail.com>

GDB breakpoints have higher priority so they have to be checked first.
Should GDB breakpoint match, just return from the debug exception
handler.

Signed-off-by: Sergey Fedorov <serge.fdrv@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 target-arm/op_helper.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox

Patch

diff --git a/target-arm/op_helper.c b/target-arm/op_helper.c
index 1425a1d..67b18c0 100644
--- a/target-arm/op_helper.c
+++ b/target-arm/op_helper.c
@@ -897,6 +897,12 @@  void arm_debug_excp_handler(CPUState *cs)
             }
         }
     } else {
+        uint64_t pc = is_a64(env) ? env->pc : env->regs[15];
+
+        if (cpu_breakpoint_test(cs, pc, BP_GDB)) {
+            return;
+        }
+
         if (check_breakpoints(cpu)) {
             bool same_el = (arm_debug_target_el(env) == arm_current_el(env));
             if (extended_addresses_enabled(env)) {