From b168573dd9ac5eeba9270834114f6a9b77807ad4 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Tue, 18 Jun 2024 11:53:50 -0700 Subject: [PATCH] Fix program counter reported for Arm32 instruction tracing It was logging the next address rather than the current one so was always off by 4. --- target/arm/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/arm/translate.c b/target/arm/translate.c index 2ca6c847d8..faed6ead36 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -9110,7 +9110,7 @@ static void arm_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu) #if defined(CONFIG_TCG_LOG_INSTR) if (unlikely(dcbase->log_instr_enabled)) { - TCGv pc = tcg_const_tl(dcbase->pc_next); + TCGv pc = tcg_const_tl(dc->pc_curr); gen_helper_arm_log_instr(cpu_env, pc, tcg_constant_i32(insn)); tcg_temp_free(pc); }