[llvm] r232558 - Add the option -no-symbolic-operands to llvm-objdump used with -macho and
Kevin Enderby
enderby at apple.com
Tue Mar 17 15:26:12 PDT 2015
Author: enderby
Date: Tue Mar 17 17:26:11 2015
New Revision: 232558
URL: http://llvm.org/viewvc/llvm-project?rev=232558&view=rev
Log:
Add the option -no-symbolic-operands to llvm-objdump used with -macho and
-disassemble to not symbolic operands when disassembling.
Modified:
llvm/trunk/test/tools/llvm-objdump/X86/macho-symbolized-disassembly.test
llvm/trunk/tools/llvm-objdump/MachODump.cpp
Modified: llvm/trunk/test/tools/llvm-objdump/X86/macho-symbolized-disassembly.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/X86/macho-symbolized-disassembly.test?rev=232558&r1=232557&r2=232558&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objdump/X86/macho-symbolized-disassembly.test (original)
+++ llvm/trunk/test/tools/llvm-objdump/X86/macho-symbolized-disassembly.test Tue Mar 17 17:26:11 2015
@@ -7,6 +7,9 @@
// RUN: llvm-objdump -d -m -no-show-raw-insn -full-leading-addr -print-imm-hex %p/Inputs/hello.obj.macho-i386 | FileCheck %s -check-prefix=i386-OBJ
// RUN: llvm-objdump -d -m -no-show-raw-insn -full-leading-addr -print-imm-hex %p/Inputs/hello.exe.macho-i386 | FileCheck %s -check-prefix=i386-EXE
+// RUN: llvm-objdump -d -m -no-show-raw-insn -full-leading-addr -print-imm-hex -no-symbolic-operands %p/Inputs/hello.obj.macho-x86_64 | FileCheck %s -check-prefix=NO-SYM-OPS-OBJ
+// RUN: llvm-objdump -d -m -no-show-raw-insn -full-leading-addr -print-imm-hex -no-symbolic-operands %p/Inputs/hello.exe.macho-x86_64 | FileCheck %s -check-prefix=NO-SYM-OPS-EXE
+
OBJ: 0000000000000008 leaq L_.str(%rip), %rax ## literal pool for: "Hello world\n"
OBJ: 0000000000000026 callq _printf
@@ -36,3 +39,9 @@ CXX-EXE: 00000001000014cb callq __ZNSt3_
i386-OBJ: 0000002f calll _printf
i386-EXE: 00001f6f calll 0x1f84 ## symbol stub for: _printf
+
+NO-SYM-OPS-OBJ: 0000000000000008 leaq (%rip), %rax
+NO-SYM-OPS-OBJ: 0000000000000026 callq 0x2b
+
+NO-SYM-OPS-EXE: 0000000100000f38 leaq 0x4f(%rip), %rax
+NO-SYM-OPS-EXE: 0000000100000f56 callq 0x100000f6c
Modified: llvm/trunk/tools/llvm-objdump/MachODump.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/MachODump.cpp?rev=232558&r1=232557&r2=232558&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objdump/MachODump.cpp (original)
+++ llvm/trunk/tools/llvm-objdump/MachODump.cpp Tue Mar 17 17:26:11 2015
@@ -66,7 +66,6 @@ static cl::opt<bool> FullLeadingAddr("fu
static cl::opt<bool> NoLeadingAddr("no-leading-addr",
cl::desc("Print no leading address"));
-
static cl::opt<bool>
PrintImmHex("print-imm-hex",
cl::desc("Use hex format for immediate values"));
@@ -124,6 +123,11 @@ cl::opt<std::string> llvm::DisSymName(
"dis-symname",
cl::desc("disassemble just this symbol's instructions (requires -macho"));
+static cl::opt<bool> NoSymbolicOperands(
+ "no-symbolic-operands",
+ cl::desc("do not symbolic operands when disassembling (requires -macho)"));
+
+
static cl::list<std::string>
ArchFlags("arch", cl::desc("architecture(s) from a Mach-O file to dump"),
cl::ZeroOrMore);
@@ -3209,7 +3213,7 @@ static void DisassembleMachO(StringRef F
return;
}
// Set up the block of info used by the Symbolizer call backs.
- SymbolizerInfo.verbose = true;
+ SymbolizerInfo.verbose = !NoSymbolicOperands;
SymbolizerInfo.O = MachOOF;
SymbolizerInfo.S = Sections[SectIdx];
SymbolizerInfo.AddrMap = &AddrMap;
@@ -3222,7 +3226,7 @@ static void DisassembleMachO(StringRef F
SymbolizerInfo.adrp_addr = 0;
SymbolizerInfo.adrp_inst = 0;
// Same for the ThumbSymbolizer
- ThumbSymbolizerInfo.verbose = true;
+ ThumbSymbolizerInfo.verbose = !NoSymbolicOperands;
ThumbSymbolizerInfo.O = MachOOF;
ThumbSymbolizerInfo.S = Sections[SectIdx];
ThumbSymbolizerInfo.AddrMap = &AddrMap;
More information about the llvm-commits
mailing list