diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-11-12 08:22:43 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-11-12 08:22:43 +0000 |
commit | e7c3551e6f75ca3fc8a3a30e8ca5f9c19edbe2e3 (patch) | |
tree | 211107b53e034b3621adbb371b69d882dec10aea /lib/ExecutionEngine | |
parent | 607f1b41a26f6b083399a480ed8547236931db76 (diff) | |
download | external_llvm-e7c3551e6f75ca3fc8a3a30e8ca5f9c19edbe2e3.zip external_llvm-e7c3551e6f75ca3fc8a3a30e8ca5f9c19edbe2e3.tar.gz external_llvm-e7c3551e6f75ca3fc8a3a30e8ca5f9c19edbe2e3.tar.bz2 |
Change binary dump format.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59119 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine')
-rw-r--r-- | lib/ExecutionEngine/JIT/JITEmitter.cpp | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/lib/ExecutionEngine/JIT/JITEmitter.cpp b/lib/ExecutionEngine/JIT/JITEmitter.cpp index d7348dd..14705a4 100644 --- a/lib/ExecutionEngine/JIT/JITEmitter.cpp +++ b/lib/ExecutionEngine/JIT/JITEmitter.cpp @@ -965,18 +965,30 @@ bool JITEmitter::finishFunction(MachineFunction &F) { #ifndef NDEBUG { - DOUT << "JIT: Disassembled code:\n"; - if (sys::hasDisassembler()) + if (sys::hasDisassembler()) { + DOUT << "JIT: Disassembled code:\n"; DOUT << sys::disassembleBuffer(FnStart, FnEnd-FnStart, (uintptr_t)FnStart); - else { + } else { + DOUT << "JIT: Binary code:\n"; DOUT << std::hex; - int i; unsigned char* q = FnStart; - for (i=1; q!=FnEnd; q++, i++) { - if (i%8==1) - DOUT << "JIT: 0x" << (long)q << ": "; - DOUT<< std::setw(2) << std::setfill('0') << (unsigned short)*q << " "; - if (i%8==0) + for (int i = 0; q < FnEnd; q += 4, ++i) { + if (i == 4) + i = 0; + if (i == 0) + DOUT << "JIT: " << std::setw(8) << std::setfill('0') + << (long)(q - FnStart) << ": "; + bool Done = false; + for (int j = 3; j >= 0; --j) { + if (q + j >= FnEnd) + Done = true; + else + DOUT << std::setw(2) << std::setfill('0') << (unsigned short)q[j]; + } + if (Done) + break; + DOUT << ' '; + if (i == 3) DOUT << '\n'; } DOUT << std::dec; |