mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-05-26 13:50:37 +00:00
cpu_patches: Log full instruction on JIT patch failure. (#4477)
This commit is contained in:
@@ -788,10 +788,16 @@ static bool PatchesIllegalInstructionHandler(void* context) {
|
||||
ZydisDecodedOperand operands[ZYDIS_MAX_OPERAND_COUNT];
|
||||
const auto status =
|
||||
Common::Decoder::Instance()->decodeInstruction(instruction, operands, code_address);
|
||||
LOG_ERROR(Core, "Failed to patch address {:x} -- mnemonic: {}",
|
||||
reinterpret_cast<u64>(code_address),
|
||||
ZYAN_SUCCESS(status) ? ZydisMnemonicGetString(instruction.mnemonic)
|
||||
: "Failed to decode");
|
||||
if (ZYAN_SUCCESS(status)) {
|
||||
const auto disassembled = Common::Decoder::Instance()->disassembleInst(
|
||||
instruction, operands, std::bit_cast<u64>(code_address));
|
||||
LOG_ERROR(Core, "Failed to patch address {:x} -- mnemonic: {}, instruction: {}",
|
||||
reinterpret_cast<u64>(code_address),
|
||||
ZydisMnemonicGetString(instruction.mnemonic), disassembled);
|
||||
} else {
|
||||
LOG_ERROR(Core, "Failed to patch address {:x} -- mnemonic: (failed to decode)",
|
||||
reinterpret_cast<u64>(code_address));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user