fix UC_MEM_WRITE_PROT callback
callbacks work on the physical address.
This commit is contained in:
@@ -2125,7 +2125,7 @@ store_helper(CPUArchState *env, target_ulong addr, uint64_t val,
|
|||||||
continue;
|
continue;
|
||||||
if (!HOOK_BOUND_CHECK(hook, paddr))
|
if (!HOOK_BOUND_CHECK(hook, paddr))
|
||||||
continue;
|
continue;
|
||||||
if ((handled = ((uc_cb_eventmem_t)hook->callback)(uc, UC_MEM_WRITE_PROT, addr, size, val, hook->user_data)))
|
if ((handled = ((uc_cb_eventmem_t)hook->callback)(uc, UC_MEM_WRITE_PROT, paddr, size, val, hook->user_data)))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// the last callback may already asked to stop emulation
|
// the last callback may already asked to stop emulation
|
||||||
@@ -2147,7 +2147,7 @@ store_helper(CPUArchState *env, target_ulong addr, uint64_t val,
|
|||||||
}
|
}
|
||||||
uc->invalid_error = UC_ERR_OK;
|
uc->invalid_error = UC_ERR_OK;
|
||||||
} else {
|
} else {
|
||||||
uc->invalid_addr = addr;
|
uc->invalid_addr = paddr;
|
||||||
uc->invalid_error = UC_ERR_WRITE_PROT;
|
uc->invalid_error = UC_ERR_WRITE_PROT;
|
||||||
// printf("***** Invalid memory write (ro) at " TARGET_FMT_lx "\n", addr);
|
// printf("***** Invalid memory write (ro) at " TARGET_FMT_lx "\n", addr);
|
||||||
cpu_exit(uc->cpu);
|
cpu_exit(uc->cpu);
|
||||||
|
|||||||
Reference in New Issue
Block a user