From: Nicholas Piggin <[email protected]>
trigger_common_match() has some warning log messages in it for
unsupported triggers. Don't call it in BP/WP checking except for
mcontrol/mcontrol6 triggers applicable to BP/WPs.
Fixes: b5f6379d13 ("target/riscv: debug: Implement debug related TCGCPUOps")
Signed-off-by: Nicholas Piggin <[email protected]>
Reviewed-by: Daniel Henrique Barboza <[email protected]>
Reviewed-by: Chao Liu <[email protected]>
---
target/riscv/tcg/debug.c | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/target/riscv/tcg/debug.c b/target/riscv/tcg/debug.c
index 3c0fe70101..3ee598b86c 100644
--- a/target/riscv/tcg/debug.c
+++ b/target/riscv/tcg/debug.c
@@ -954,6 +954,14 @@ bool riscv_cpu_debug_check_breakpoint(CPUState *cs)
for (i = 0; i < env->num_triggers; i++) {
trigger_type = get_trigger_type(env, i);
+ switch (trigger_type) {
+ case TRIGGER_TYPE_AD_MATCH:
+ case TRIGGER_TYPE_AD_MATCH6:
+ break;
+ default:
+ continue; /* No other types match breakpoint */
+ }
+
if (!trigger_common_match(env, trigger_type, i)) {
continue;
}
@@ -978,8 +986,7 @@ bool riscv_cpu_debug_check_breakpoint(CPUState *cs)
}
break;
default:
- /* other trigger types are not supported or irrelevant */
- break;
+ g_assert_not_reached();
}
}
}
@@ -1000,6 +1007,14 @@ bool riscv_cpu_debug_check_watchpoint(CPUState *cs,
CPUWatchpoint *wp)
for (i = 0; i < env->num_triggers; i++) {
trigger_type = get_trigger_type(env, i);
+ switch (trigger_type) {
+ case TRIGGER_TYPE_AD_MATCH:
+ case TRIGGER_TYPE_AD_MATCH6:
+ break;
+ default:
+ continue; /* No other types match watchpoint */
+ }
+
if (!trigger_common_match(env, trigger_type, i)) {
continue;
}
@@ -1038,8 +1053,7 @@ bool riscv_cpu_debug_check_watchpoint(CPUState *cs,
CPUWatchpoint *wp)
}
break;
default:
- /* other trigger types are not supported */
- break;
+ g_assert_not_reached();
}
}
--
2.43.0