Skip to content

Commit

Permalink
CPU/CodeCache: Avoid log calls in faults outside of JIT code
Browse files Browse the repository at this point in the history
Could be in other functions that are unsafe to call log functions from.
  • Loading branch information
stenzek committed Dec 19, 2024
1 parent 7116a80 commit 5686677
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/core/cpu_code_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1707,15 +1707,12 @@ PageFaultHandler::HandlerResult CPU::CodeCache::HandleFastmemException(void* exc
guest_address = std::numeric_limits<PhysicalMemoryAddress>::max();
}

DEV_LOG("Page fault handler invoked at PC={} Address={} {}, fastmem offset {:08X}", exception_pc, fault_address,
is_write ? "(write)" : "(read)", guest_address);

auto iter = s_fastmem_backpatch_info.find(exception_pc);
if (iter == s_fastmem_backpatch_info.end())
{
ERROR_LOG("No backpatch info found for {}", exception_pc);
return PageFaultHandler::HandlerResult::ExecuteNextHandler;
}

DEV_LOG("Page fault handler invoked at PC={} Address={} {}, fastmem offset {:08X}", exception_pc, fault_address,
is_write ? "(write)" : "(read)", guest_address);

LoadstoreBackpatchInfo& info = iter->second;
DEV_LOG("Backpatching {} at {}[{}] (pc {:08X} addr {:08X}): Bitmask {:08X} Addr {} Data {} Size {} Signed {:02X}",
Expand Down

0 comments on commit 5686677

Please sign in to comment.