Starting to properly attribute virtual vs. physical memory accesses.
This commit is contained in:
@@ -368,8 +368,7 @@ uint64_t TrapDebugPrint(void* raw_context, uint64_t address) {
|
||||
auto thread_state = *reinterpret_cast<ThreadState**>(raw_context);
|
||||
uint32_t str_ptr = uint32_t(thread_state->context()->r[3]);
|
||||
uint16_t str_len = uint16_t(thread_state->context()->r[4]);
|
||||
const char* str =
|
||||
reinterpret_cast<const char*>(thread_state->memory()->Translate(str_ptr));
|
||||
auto str = thread_state->memory()->TranslateVirtual<const char*>(str_ptr);
|
||||
// TODO(benvanik): truncate to length?
|
||||
PLOGD("(DebugPrint) %s", str);
|
||||
return 0;
|
||||
|
||||
@@ -37,7 +37,7 @@ int X64Function::RemoveBreakpointImpl(Breakpoint* breakpoint) { return 0; }
|
||||
int X64Function::CallImpl(ThreadState* thread_state, uint32_t return_address) {
|
||||
auto backend = (X64Backend*)thread_state->runtime()->backend();
|
||||
auto thunk = backend->host_to_guest_thunk();
|
||||
thunk(machine_code_, thread_state->raw_context(),
|
||||
thunk(machine_code_, thread_state->context(),
|
||||
reinterpret_cast<void*>(uintptr_t(return_address)));
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user