]> git.proxmox.com Git - mirror_qemu.git/commitdiff
target/arm: Implement debug_check_breakpoint
authorRichard Henderson <richard.henderson@linaro.org>
Mon, 19 Jul 2021 18:19:26 +0000 (08:19 -1000)
committerRichard Henderson <richard.henderson@linaro.org>
Wed, 21 Jul 2021 17:47:04 +0000 (07:47 -1000)
Reuse the code at the bottom of helper_check_breakpoints,
which is what we currently call from *_tr_breakpoint_check.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
target/arm/cpu.c
target/arm/cpu_tcg.c
target/arm/debug_helper.c
target/arm/internals.h

index 9cddfd6a442b9b8ee880439268f577b1a3152dfe..752b15bb79762c84ede4244e0da2ea04f2b20d83 100644 (file)
@@ -1984,6 +1984,7 @@ static const struct TCGCPUOps arm_tcg_ops = {
     .do_unaligned_access = arm_cpu_do_unaligned_access,
     .adjust_watchpoint_address = arm_adjust_watchpoint_address,
     .debug_check_watchpoint = arm_debug_check_watchpoint,
+    .debug_check_breakpoint = arm_debug_check_breakpoint,
 #endif /* !CONFIG_USER_ONLY */
 };
 #endif /* CONFIG_TCG */
index d2d97115ea105197713f844b128631051f9b91dc..ed444bf436a4181fa209a9b724a05aa25af4d6fb 100644 (file)
@@ -911,6 +911,7 @@ static const struct TCGCPUOps arm_v7m_tcg_ops = {
     .do_unaligned_access = arm_cpu_do_unaligned_access,
     .adjust_watchpoint_address = arm_adjust_watchpoint_address,
     .debug_check_watchpoint = arm_debug_check_watchpoint,
+    .debug_check_breakpoint = arm_debug_check_breakpoint,
 #endif /* !CONFIG_USER_ONLY */
 };
 #endif /* CONFIG_TCG */
index 2ff72d47d195d03b7f498e521efc379bbba86e6c..4a0c479527bab638e7a7aeabf7e1fd328fc1eff7 100644 (file)
@@ -216,8 +216,9 @@ static bool check_watchpoints(ARMCPU *cpu)
     return false;
 }
 
-static bool check_breakpoints(ARMCPU *cpu)
+bool arm_debug_check_breakpoint(CPUState *cs)
 {
+    ARMCPU *cpu = ARM_CPU(cs);
     CPUARMState *env = &cpu->env;
     int n;
 
@@ -240,9 +241,7 @@ static bool check_breakpoints(ARMCPU *cpu)
 
 void HELPER(check_breakpoints)(CPUARMState *env)
 {
-    ARMCPU *cpu = env_archcpu(env);
-
-    if (check_breakpoints(cpu)) {
+    if (arm_debug_check_breakpoint(env_cpu(env))) {
         HELPER(exception_internal(env, EXCP_DEBUG));
     }
 }
index 3ba86e8af81a3bcfb05f389690e4a09da8529f12..11a72013f51c590aa14c816b83811722bca0c183 100644 (file)
@@ -282,6 +282,9 @@ void hw_breakpoint_update(ARMCPU *cpu, int n);
  */
 void hw_breakpoint_update_all(ARMCPU *cpu);
 
+/* Callback function for checking if a breakpoint should trigger. */
+bool arm_debug_check_breakpoint(CPUState *cs);
+
 /* Callback function for checking if a watchpoint should trigger. */
 bool arm_debug_check_watchpoint(CPUState *cs, CPUWatchpoint *wp);