Skip to content

Commit c915d13

Browse files
committed
Fix pc issue of tcg opcode hooks
1 parent 77a841e commit c915d13

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

qemu/target/arm/translate.c

+1
Original file line numberDiff line numberDiff line change
@@ -11598,6 +11598,7 @@ static void thumb_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu)
1159811598
check_exit_request(tcg_ctx);
1159911599
}
1160011600

11601+
tcg_ctx->pc_start = dc->base.pc_next - insn_size;
1160111602
if (is_16bit) {
1160211603
disas_thumb_insn(dc, insn);
1160311604
} else {

tests/unit/test_arm.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,7 @@ static void test_arm_tcg_opcode_cmp(void)
902902

903903
OK(uc_emu_start(uc, code_start, code_start + sizeof(code) - 1, 0, 3));
904904
TEST_CHECK(cmp_info.v0 == 5 && cmp_info.v1 == 3);
905-
TEST_CHECK(cmp_info.pc == code_start);
905+
TEST_CHECK(cmp_info.pc == 0x1008);
906906
TEST_CHECK(cmp_info.size == 32);
907907
}
908908

@@ -928,7 +928,7 @@ static void test_arm_thumb_tcg_opcode_cmn(void)
928928

929929
OK(uc_emu_start(uc, code_start | 1, code_start + sizeof(code) - 1, 0, 4));
930930
TEST_CHECK(cmp_info.v0 == 5 && cmp_info.v1 == 3);
931-
TEST_CHECK(cmp_info.pc == (code_start | 1));
931+
TEST_CHECK(cmp_info.pc == 0x1006);
932932
TEST_CHECK(cmp_info.size == 32);
933933
}
934934

0 commit comments

Comments
 (0)