target/arm: Inline check_watchpoints() in arm_debug_check_watchpoint()
check_watchpoints() is called once, by arm_debug_check_watchpoint(), which doesn't do more than this call. Merge both. No logical change intended. Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-ID: <20260705215729.62196-27-philmd@oss.qualcomm.com>
Philippe Mathieu-Daudé committed
Jun 27, 2026 at 17:02 UTC
0b55b519c6f8c905d545412568e47e06bf34d918
1 file changed
+17
-23
target/arm/tcg/debug.c
+17
-23
@@ -351,28 +351,6 @@ static bool bp_wp_matches(ARMCPU *cpu, int n, bool is_wp)
351
return true;
352
}
353
354
-static bool check_watchpoints(ARMCPU *cpu)
355
-{
356
- CPUARMState *env = &cpu->env;
357
- int n;
358
-
359
- /*
360
- * If watchpoints are disabled globally or we can't take debug
361
- * exceptions here then watchpoint firings are ignored.
362
- */
363
- if (extract32(env->cp15.mdscr_el1, 15, 1) == 0
364
- || !arm_generate_debug_exceptions(env)) {
365
- return false;
366
- }
367
-
368
- for (n = 0; n < ARRAY_SIZE(env->cpu_watchpoint); n++) {
369
- if (bp_wp_matches(cpu, n, true)) {
370
- return true;
371
- }
372
- }
373
- return false;
374
-}
375
-
354
bool arm_debug_check_breakpoint(CPUState *cs)
355
{
356
ARMCPU *cpu = ARM_CPU(cs);
@@ -426,8 +404,24 @@ bool arm_debug_check_watchpoint(CPUState *cs, CPUWatchpoint *wp)
404
* is also an architectural watchpoint match.
405
*/
406
ARMCPU *cpu = ARM_CPU(cs);
407
+ CPUARMState *env = &cpu->env;
408
+ int n;
409
430
- return check_watchpoints(cpu);
410
+ /*
411
+ * If watchpoints are disabled globally or we can't take debug
412
+ * exceptions here then watchpoint firings are ignored.
413
+ */
414
+ if (extract32(env->cp15.mdscr_el1, 15, 1) == 0
415
+ || !arm_generate_debug_exceptions(env)) {
416
+ return false;
417
+ }
418
+
419
+ for (n = 0; n < ARRAY_SIZE(env->cpu_watchpoint); n++) {
420
+ if (bp_wp_matches(cpu, n, true)) {
421
+ return true;
422
+ }
423
+ }
424
+ return false;
425
}
426
427
/*