Sync PC after we exit

We should sync PC if there is no UC_HOOK_CODE hook
This commit is contained in:
lazymio 2022-03-05 22:32:14 +01:00
parent ce932e4c28
commit b7bc13650c
No known key found for this signature in database
GPG Key ID: DFF27E34A47CB873

View File

@ -72,7 +72,7 @@ static inline tcg_target_ulong cpu_tb_exec(CPUState *cpu, TranslationBlock *itb)
* of the start of the TB.
*/
CPUClass *cc = CPU_GET_CLASS(cpu);
if (!HOOK_EXISTS(env->uc, UC_HOOK_CODE) && !env->uc->timeout) {
if (!HOOK_EXISTS(env->uc, UC_HOOK_CODE)) {
// We should sync pc for R/W error.
switch (env->uc->invalid_error) {
case UC_ERR_WRITE_PROT:
@ -87,9 +87,6 @@ static inline tcg_target_ulong cpu_tb_exec(CPUState *cpu, TranslationBlock *itb)
break;
default:
if (cc->synchronize_from_tb) {
// avoid sync twice when helper_uc_tracecode() already did this.
if (env->uc->emu_counter <= env->uc->emu_count &&
!env->uc->stop_request && !env->uc->quit_request)
cc->synchronize_from_tb(cpu, last_tb);
} else {
assert(cc->set_pc);