[AArch64] Add a memory dump routine.

Allows me to easily disassemble a block of code from the Nexus 9 by dumping it to logcat.
This commit is contained in:
Ryan Houdek 2015-01-07 14:32:50 -06:00
parent b3201be95f
commit f1443bec1e
2 changed files with 11 additions and 0 deletions

View File

@ -179,6 +179,14 @@ void JitArm64::WriteExitDestInR(ARM64Reg Reg)
BR(EncodeRegTo64(Reg)); BR(EncodeRegTo64(Reg));
} }
void JitArm64::DumpCode(const u8* start, const u8* end)
{
std::string output = "";
for (u8* code = (u8*)start; code < end; code += 4)
output += StringFromFormat("%08x", Common::swap32(*(u32*)code));
WARN_LOG(DYNA_REC, "Code dump from %p to %p:\n%s", start, end, output.c_str());
}
void JitArm64::Run() void JitArm64::Run()
{ {
CompiledCode pExecAddr = (CompiledCode)asm_routines.enterCode; CompiledCode pExecAddr = (CompiledCode)asm_routines.enterCode;

View File

@ -116,6 +116,9 @@ private:
ARM64FloatEmitter m_float_emit; ARM64FloatEmitter m_float_emit;
// Dump a memory range of code
void DumpCode(const u8* start, const u8* end);
// The key is the backpatch flags // The key is the backpatch flags
std::map<u32, BackPatchInfo> m_backpatch_info; std::map<u32, BackPatchInfo> m_backpatch_info;