diff options
author | Eli Bendersky <eliben@google.com> | 2012-11-20 22:57:02 +0000 |
---|---|---|
committer | Eli Bendersky <eliben@google.com> | 2012-11-20 22:57:02 +0000 |
commit | 3a6808cc32e4343512e50334ce00e8b1b4705fab (patch) | |
tree | 403837e56865f4ead6093640f4574ba5749fa2a1 /llvm/tools/llvm-objdump/llvm-objdump.cpp | |
parent | 87ce43c5b5f1333a76899a9d532aa9bb345d2440 (diff) | |
download | bcm5719-llvm-3a6808cc32e4343512e50334ce00e8b1b4705fab.tar.gz bcm5719-llvm-3a6808cc32e4343512e50334ce00e8b1b4705fab.zip |
Add the -no-show-raw-insn option to llvm-objdump, thus making it a bit more
conformant to binutils objdump.
llvm-svn: 168393
Diffstat (limited to 'llvm/tools/llvm-objdump/llvm-objdump.cpp')
-rw-r--r-- | llvm/tools/llvm-objdump/llvm-objdump.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp index 13ea4e32958..ddfcca39381 100644 --- a/llvm/tools/llvm-objdump/llvm-objdump.cpp +++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp @@ -100,6 +100,10 @@ MAttrs("mattr", cl::desc("Target specific attributes"), cl::value_desc("a1,+a2,-a3,...")); +static cl::opt<bool> +NoShowRawInsn("no-show-raw-insn", cl::desc("When disassembling instructions, " + "do not print the instruction bytes.")); + static StringRef ToolName; static bool error(error_code ec) { @@ -321,8 +325,11 @@ static void DisassembleObject(const ObjectFile *Obj, bool InlineRelocs) { if (DisAsm->getInstruction(Inst, Size, memoryObject, Index, DebugOut, nulls())) { - outs() << format("%8" PRIx64 ":\t", SectionAddr + Index); - DumpBytes(StringRef(Bytes.data() + Index, Size)); + outs() << format("%8" PRIx64 ":", SectionAddr + Index); + if (!NoShowRawInsn) { + outs() << "\t"; + DumpBytes(StringRef(Bytes.data() + Index, Size)); + } IP->printInst(&Inst, outs(), ""); outs() << "\n"; } else { |