Fix pc issue of tcg opcode hooks

This commit is contained in:
mio
2025-02-10 21:35:17 +08:00
parent 77a841e53d
commit c915d13cce
2 changed files with 3 additions and 2 deletions

View File

@@ -11598,6 +11598,7 @@ static void thumb_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu)
check_exit_request(tcg_ctx); check_exit_request(tcg_ctx);
} }
tcg_ctx->pc_start = dc->base.pc_next - insn_size;
if (is_16bit) { if (is_16bit) {
disas_thumb_insn(dc, insn); disas_thumb_insn(dc, insn);
} else { } else {

View File

@@ -902,7 +902,7 @@ static void test_arm_tcg_opcode_cmp(void)
OK(uc_emu_start(uc, code_start, code_start + sizeof(code) - 1, 0, 3)); OK(uc_emu_start(uc, code_start, code_start + sizeof(code) - 1, 0, 3));
TEST_CHECK(cmp_info.v0 == 5 && cmp_info.v1 == 3); TEST_CHECK(cmp_info.v0 == 5 && cmp_info.v1 == 3);
TEST_CHECK(cmp_info.pc == code_start); TEST_CHECK(cmp_info.pc == 0x1008);
TEST_CHECK(cmp_info.size == 32); TEST_CHECK(cmp_info.size == 32);
} }
@@ -928,7 +928,7 @@ static void test_arm_thumb_tcg_opcode_cmn(void)
OK(uc_emu_start(uc, code_start | 1, code_start + sizeof(code) - 1, 0, 4)); OK(uc_emu_start(uc, code_start | 1, code_start + sizeof(code) - 1, 0, 4));
TEST_CHECK(cmp_info.v0 == 5 && cmp_info.v1 == 3); TEST_CHECK(cmp_info.v0 == 5 && cmp_info.v1 == 3);
TEST_CHECK(cmp_info.pc == (code_start | 1)); TEST_CHECK(cmp_info.pc == 0x1006);
TEST_CHECK(cmp_info.size == 32); TEST_CHECK(cmp_info.size == 32);
} }