[PATCH for-11.1 14/17] target/riscv/debug: Insert breakpoints after migration
Daniel Henrique Barboza <[email protected]>
| Newsgroups | org.nongnu.qemu-riscv,org.nongnu.qemu-devel |
|---|---|
| Message-ID | <[email protected]> |
From: Nicholas Piggin <[email protected]> After migration, TCG breakpoints should be re-established based on debug register state. icount trigger timer in the icount_enabled() path is also missing, but that path will be removed subsequently so don't bother to fix it. Fixes: 577f028694 ("target/riscv: Add itrigger_enabled field to CPURISCVState") Signed-off-by: Nicholas Piggin <[email protected]> Reviewed-by: Daniel Henrique Barboza <[email protected]> --- target/riscv/tcg/debug.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/target/riscv/tcg/debug.c b/target/riscv/tcg/debug.c index 56f9ceb042..09d4cc03f9 100644 --- a/target/riscv/tcg/debug.c +++ b/target/riscv/tcg/debug.c @@ -1157,6 +1157,20 @@ void riscv_cpu_debug_change_priv(CPURISCVState *env) void riscv_cpu_debug_post_load(CPURISCVState *env) { + for (int i = 0; i < env->num_triggers; i++) { + int trigger_type = get_trigger_type(env, i); + + switch (trigger_type) { + case TRIGGER_TYPE_AD_MATCH: + type2_breakpoint_insert(env, i); + break; + case TRIGGER_TYPE_AD_MATCH6: + type6_breakpoint_insert(env, i); + break; + default: + break; + } + } if (!icount_enabled()) { env->itrigger_enabled = riscv_itrigger_enabled(env); } -- 2.43.0