Co-authored-by: Rami Ali <flowergrass@users.noreply.github.com>
This commit is contained in:
parent
7ca7e8a79d
commit
34ddafcbcf
@ -10434,17 +10434,23 @@ static void disas_thumb_insn(CPUARMState *env, DisasContext *s) // qq
|
||||
// Unicorn: trace this instruction on request
|
||||
if (HOOK_EXISTS_BOUNDED(s->uc, UC_HOOK_CODE, s->pc)) {
|
||||
// determine instruction size (Thumb/Thumb2)
|
||||
switch(insn & 0xf800) {
|
||||
// Thumb2: 32-bit
|
||||
case 0xe800:
|
||||
case 0xf000:
|
||||
case 0xf800:
|
||||
gen_uc_tracecode(tcg_ctx, 4, UC_HOOK_CODE_IDX, s->uc, s->pc);
|
||||
break;
|
||||
// Thumb: 16-bit
|
||||
default:
|
||||
gen_uc_tracecode(tcg_ctx, 2, UC_HOOK_CODE_IDX, s->uc, s->pc);
|
||||
break;
|
||||
// avoid terminating inside ITE clause
|
||||
if (s->condexec_mask == 0) {
|
||||
switch(insn & 0xf800) {
|
||||
// Thumb2: 32-bit
|
||||
case 0xe800:
|
||||
case 0xf000:
|
||||
case 0xf800:
|
||||
gen_uc_tracecode(tcg_ctx, 4, UC_HOOK_CODE_IDX, s->uc, s->pc);
|
||||
break;
|
||||
// Thumb: 16-bit
|
||||
default:
|
||||
// avoid terminating at an IT instruction
|
||||
if (!((insn & 0xff00) == 0xbf00)) {
|
||||
gen_uc_tracecode(tcg_ctx, 2, UC_HOOK_CODE_IDX, s->uc, s->pc);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
// the callback might want to stop emulation immediately
|
||||
check_exit_request(tcg_ctx);
|
||||
|
Loading…
Reference in New Issue
Block a user