Fix regression: We should triage MIPS internal exceptions to Unicorn exceptions

This commit is contained in:
2024-12-07 17:09:59 +08:00
parent c22651c9fe
commit 3b2f54fc61
3 changed files with 24 additions and 1 deletions

View File

@@ -535,6 +535,18 @@ static void raise_mmu_exception(CPUMIPSState *env, target_ulong address,
#endif
cs->exception_index = exception;
env->error_code = error_code;
// Dispatch internal exceptions to Unicorn Exceptions
switch (exception) {
case EXCP_TLBL:
env->uc->invalid_error = UC_ERR_READ_UNMAPPED;
env->uc->invalid_addr = address;
break;
case EXCP_TLBS:
env->uc->invalid_error = UC_ERR_WRITE_UNMAPPED;
env->uc->invalid_addr = address;
break;
}
}
hwaddr mips_cpu_get_phys_page_debug(CPUState *cs, vaddr addr)