mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-07-07 14:00:40 +00:00
x86: check for exit request after every hooked instruction. this should fix issue #232
This commit is contained in:
parent
4c5ecda908
commit
938d0b89eb
|
@ -294,8 +294,8 @@ static tcg_target_ulong cpu_tb_exec(CPUState *cpu, uint8_t *tb_ptr)
|
||||||
TranslationBlock *tb = (TranslationBlock *)(next_tb & ~TB_EXIT_MASK);
|
TranslationBlock *tb = (TranslationBlock *)(next_tb & ~TB_EXIT_MASK);
|
||||||
if (cc->synchronize_from_tb) {
|
if (cc->synchronize_from_tb) {
|
||||||
// avoid sync twice when helper_uc_tracecode() already did this.
|
// avoid sync twice when helper_uc_tracecode() already did this.
|
||||||
if (env->uc->emu_counter <= env->uc->emu_count)
|
if (env->uc->emu_counter <= env->uc->emu_count && !env->uc->stop_request)
|
||||||
cc->synchronize_from_tb(cpu, tb); // qq
|
cc->synchronize_from_tb(cpu, tb);
|
||||||
} else {
|
} else {
|
||||||
assert(cc->set_pc);
|
assert(cc->set_pc);
|
||||||
// avoid sync twice when helper_uc_tracecode() already did this.
|
// avoid sync twice when helper_uc_tracecode() already did this.
|
||||||
|
|
|
@ -4774,11 +4774,8 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s,
|
||||||
}
|
}
|
||||||
// generate code to call callback
|
// generate code to call callback
|
||||||
gen_uc_tracecode(tcg_ctx, 0xf1f1f1f1, trace->callback, env->uc, pc_start, trace->user_data);
|
gen_uc_tracecode(tcg_ctx, 0xf1f1f1f1, trace->callback, env->uc, pc_start, trace->user_data);
|
||||||
// if requested to emulate only some instructions, check if
|
// the callback might want to stop emulation immediately
|
||||||
// we need to exit immediately
|
check_exit_request(tcg_ctx);
|
||||||
if (env->uc->emu_count > 0) {
|
|
||||||
check_exit_request(tcg_ctx);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue