[llvm-commits] [llvm] r59119 - /llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp
Evan Cheng
evan.cheng at apple.com
Wed Nov 12 00:22:43 PST 2008
Author: evancheng
Date: Wed Nov 12 02:22:43 2008
New Revision: 59119
URL: http://llvm.org/viewvc/llvm-project?rev=59119&view=rev
Log:
Change binary dump format.
Modified:
llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp
Modified: llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp?rev=59119&r1=59118&r2=59119&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp Wed Nov 12 02:22:43 2008
@@ -965,18 +965,30 @@
#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;
More information about the llvm-commits
mailing list