Use the matched breakpoint instead of looping over all.
Signed-off-by: Richard Henderson <[email protected]>
---
target/arm/tcg/debug.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/target/arm/tcg/debug.c b/target/arm/tcg/debug.c
index 519a06fbc7..2389830b2a 100644
--- a/target/arm/tcg/debug.c
+++ b/target/arm/tcg/debug.c
@@ -331,7 +331,6 @@ bool arm_debug_check_breakpoint(CPUState *cs, CPUBreakpoint
*bp)
ARMCPU *cpu = ARM_CPU(cs);
CPUARMState *env = &cpu->env;
vaddr pc;
- int n;
/*
* If breakpoints are disabled globally or we can't take debug
@@ -363,15 +362,7 @@ bool arm_debug_check_breakpoint(CPUState *cs,
CPUBreakpoint *bp)
* TODO: We would need to look up the page for PC and verify that
* it is present and executable.
*/
-
- for (n = 0; n < ARRAY_SIZE(env->cpu_breakpoint); n++) {
- if (env->cpu_breakpoint[n] &&
- env->cpu_breakpoint[n]->pc != pc &&
- bp_wp_matches(cpu, env->cp15.dbgbcr[n], arm_current_el(env))) {
- return true;
- }
- }
- return false;
+ return bp_wp_matches(cpu, env->cp15.dbgbcr[bp->id], arm_current_el(env));
}
bool arm_debug_check_watchpoint(CPUState *cs, CPUWatchpoint *ignore)
--
2.43.0