1 include "llvm/Option/OptParser.td"
3 multiclass B<string name, string help1, string help2> {
4 def NAME: Flag<["--"], name>, HelpText<help1>;
5 def no_ # NAME: Flag<["--"], "no-" # name>, HelpText<help2>;
8 multiclass Eq<string name, string help> {
9 def NAME : Separate<["--"], name>;
10 def NAME #_eq : Joined<["--"], name #"=">,
11 Alias<!cast<Separate>(NAME)>,
15 def help : Flag<["--"], "help">,
16 HelpText<"Display available options (--help-hidden for more)">;
18 def help_hidden : Flag<["--"], "help-hidden">,
20 HelpText<"Display all available options">;
22 def version : Flag<["--"], "version">,
23 HelpText<"Display the version of this program">;
24 def : Flag<["-"], "v">, Alias<version>, HelpText<"Alias for --version">;
26 def adjust_vma_EQ : Joined<["--"], "adjust-vma=">,
27 MetaVarName<"offset">,
28 HelpText<"Increase the displayed address by the specified offset">;
30 def all_headers : Flag<["--"], "all-headers">,
31 HelpText<"Display all available header information, "
32 "relocation entries and the symbol table">;
33 def : Flag<["-"], "x">, Alias<all_headers>, HelpText<"Alias for --all-headers">;
35 def arch_name_EQ : Joined<["--"], "arch-name=">,
36 HelpText<"Target arch to disassemble for, "
37 "see --version for available targets">;
38 def archive_headers : Flag<["--"], "archive-headers">,
39 HelpText<"Display archive header information">;
42 Eq<"build-id", "Build ID to look up. Once found, added as an input file">,
45 def : Flag<["-"], "a">, Alias<archive_headers>,
46 HelpText<"Alias for --archive-headers">;
48 def demangle : Flag<["--"], "demangle">, HelpText<"Demangle symbol names">;
49 def : Flag<["-"], "C">, Alias<demangle>, HelpText<"Alias for --demangle">;
51 defm debug_file_directory :
52 Eq<"debug-file-directory", "Path to directory where to look for debug files">,
55 defm debuginfod : B<"debuginfod", "Use debuginfod to find debug files", "Don't use debuginfod to find debug files">;
57 def disassemble : Flag<["--"], "disassemble">,
58 HelpText<"Disassemble all executable sections found in the input files">;
59 def : Flag<["-"], "d">, Alias<disassemble>, HelpText<"Alias for --disassemble">;
61 def disassemble_all : Flag<["--"], "disassemble-all">,
62 HelpText<"Disassemble all sections found in the input files">;
63 def : Flag<["-"], "D">, Alias<disassemble_all>,
64 HelpText<"Alias for --disassemble-all">;
66 def symbol_description : Flag<["--"], "symbol-description">,
67 HelpText<"Add symbol description for disassembly. This "
68 "option is for XCOFF files only">;
70 def traceback_table : Flag<["--"], "traceback-table">,
71 HelpText<"Decode traceback table in disassembly. Implies --disassemble. "
72 "This option is for XCOFF files only">;
74 def disassemble_symbols_EQ : Joined<["--"], "disassemble-symbols=">,
75 HelpText<"List of symbols to disassemble. "
76 "Accept demangled names when --demangle is "
77 "specified, otherwise accept mangled names">;
79 def disassemble_zeroes : Flag<["--"], "disassemble-zeroes">,
80 HelpText<"Do not skip blocks of zeroes when disassembling">;
81 def : Flag<["-"], "z">, Alias<disassemble_zeroes>,
82 HelpText<"Alias for --disassemble-zeroes">;
84 def disassembler_options_EQ : Joined<["--"], "disassembler-options=">,
85 MetaVarName<"options">,
86 HelpText<"Pass target specific disassembler options">;
87 def : JoinedOrSeparate<["-"], "M">, Alias<disassembler_options_EQ>,
88 HelpText<"Alias for --disassembler-options=">;
90 def disassembler_color_EQ : Joined<["--"], "disassembler-color=">,
92 HelpText<"Enable or disable disassembler color output. "
93 "Valid options are \"on\", \"off\" and \"terminal\" (default)">;
95 def dynamic_reloc : Flag<["--"], "dynamic-reloc">,
96 HelpText<"Display the dynamic relocation entries in the file">;
97 def : Flag<["-"], "R">, Alias<dynamic_reloc>,
98 HelpText<"Alias for --dynamic-reloc">;
100 def dwarf_EQ : Joined<["--"], "dwarf=">,
101 HelpText<"Dump the specified DWARF debug sections. The "
102 "only supported value is 'frames'">,
105 def fault_map_section : Flag<["--"], "fault-map-section">,
106 HelpText<"Display the content of the fault map section">;
108 def offloading : Flag<["--"], "offloading">,
109 HelpText<"Display the content of the offloading section">;
111 def file_headers : Flag<["--"], "file-headers">,
112 HelpText<"Display the contents of the overall file header">;
113 def : Flag<["-"], "f">, Alias<file_headers>,
114 HelpText<"Alias for --file-headers">;
116 def full_contents : Flag<["--"], "full-contents">,
117 HelpText<"Display the content of each section">;
118 def : Flag<["-"], "s">, Alias<full_contents>,
119 HelpText<"Alias for --full-contents">;
121 def line_numbers : Flag<["--"], "line-numbers">,
122 HelpText<"When disassembling, display source line numbers. "
123 "Implies --disassemble">;
124 def : Flag<["-"], "l">,
126 HelpText<"Alias for --line-numbers">;
128 def macho : Flag<["--"], "macho">,
129 HelpText<"Use MachO specific object file parser">;
130 def : Flag<["-"], "m">, Alias<macho>, HelpText<"Alias for --macho">;
132 def mcpu_EQ : Joined<["--"], "mcpu=">,
133 MetaVarName<"cpu-name">,
134 HelpText<"Target a specific cpu type (--mcpu=help for details)">;
136 def mattr_EQ : Joined<["--"], "mattr=">,
137 MetaVarName<"a1,+a2,-a3,...">,
138 HelpText<"Target specific attributes (--mattr=help for details)">;
140 def no_show_raw_insn : Flag<["--"], "no-show-raw-insn">,
141 HelpText<"When disassembling instructions, "
142 "do not print the instruction bytes.">;
144 def no_leading_addr : Flag<["--"], "no-leading-addr">,
145 HelpText<"When disassembling, do not print leading addresses for instructions or inline relocations">;
146 def : Flag<["--"], "no-addresses">, Alias<no_leading_addr>,
147 HelpText<"Alias for --no-leading-addr">;
149 def raw_clang_ast : Flag<["--"], "raw-clang-ast">,
150 HelpText<"Dump the raw binary contents of the clang AST section">;
152 def reloc : Flag<["--"], "reloc">,
153 HelpText<"Display the relocation entries in the file">;
154 def : Flag<["-"], "r">, Alias<reloc>, HelpText<"Alias for --reloc">;
156 def print_imm_hex : Flag<["--"], "print-imm-hex">,
157 HelpText<"Use hex format for immediate values (default)">;
159 def no_print_imm_hex : Flag<["--"], "no-print-imm-hex">,
160 HelpText<"Do not use hex format for immediate values">;
161 def : Flag<["--"], "print-imm-hex=false">, Alias<no_print_imm_hex>;
163 def private_headers : Flag<["--"], "private-headers">,
164 HelpText<"Display format specific file headers">;
165 def : Flag<["-"], "p">, Alias<private_headers>,
166 HelpText<"Alias for --private-headers">;
168 def section_EQ : Joined<["--"], "section=">,
169 HelpText<"Operate on the specified sections only. "
170 "With --macho dump segment,section">;
171 def : Separate<["--"], "section">, Alias<section_EQ>;
172 def : JoinedOrSeparate<["-"], "j">, Alias<section_EQ>,
173 HelpText<"Alias for --section">;
175 def section_headers : Flag<["--"], "section-headers">,
176 HelpText<"Display summaries of the headers for each section.">;
177 def : Flag<["--"], "headers">, Alias<section_headers>,
178 HelpText<"Alias for --section-headers">;
179 def : Flag<["-"], "h">, Alias<section_headers>,
180 HelpText<"Alias for --section-headers">;
182 def show_all_symbols : Flag<["--"], "show-all-symbols">,
183 HelpText<"Show all symbols during disassembly, even if multiple "
184 "symbols are defined at the same location">;
186 def show_lma : Flag<["--"], "show-lma">,
187 HelpText<"Display LMA column when dumping ELF section headers">;
189 def source : Flag<["--"], "source">,
190 HelpText<"When disassembling, display source interleaved with the "
191 "disassembly. Implies --disassemble">;
192 def : Flag<["-"], "S">, Alias<source>, HelpText<"Alias for --source">;
194 def start_address_EQ : Joined<["--"], "start-address=">,
195 MetaVarName<"address">,
196 HelpText<"Set the start address for disassembling, "
197 "printing relocations and printing symbols">;
198 def stop_address_EQ : Joined<["--"], "stop-address=">,
199 MetaVarName<"address">,
200 HelpText<"Set the stop address for disassembling, "
201 "printing relocations and printing symbols">;
203 def syms : Flag<["--"], "syms">,
204 HelpText<"Display the symbol table">;
205 def : Flag<["-"], "t">, Alias<syms>, HelpText<"Alias for --syms">;
207 def symbolize_operands : Flag<["--"], "symbolize-operands">,
208 HelpText<"Symbolize instruction operands when disassembling">;
210 def dynamic_syms : Flag<["--"], "dynamic-syms">,
211 HelpText<"Display the contents of the dynamic symbol table">;
212 def : Flag<["-"], "T">, Alias<dynamic_syms>,
213 HelpText<"Alias for --dynamic-syms">;
215 def triple_EQ : Joined<["--"], "triple=">,
216 HelpText<"Target triple to disassemble for, "
217 "see --version for available targets">;
218 def : Separate<["--"], "triple">,
221 def unwind_info : Flag<["--"], "unwind-info">,
222 HelpText<"Display unwind information">;
223 def : Flag<["-"], "u">, Alias<unwind_info>,
224 HelpText<"Alias for --unwind-info">;
226 def wide : Flag<["--"], "wide">,
227 HelpText<"Ignored for compatibility with GNU objdump">;
228 def : Flag<["-"], "w">, Alias<wide>;
230 defm prefix : Eq<"prefix", "Add prefix to absolute paths">,
231 MetaVarName<"prefix">;
233 : Eq<"prefix-strip", "Strip out initial directories from absolute "
234 "paths. No effect without --prefix">,
235 MetaVarName<"prefix">;
237 def debug_vars_EQ : Joined<["--"], "debug-vars=">,
238 HelpText<"Print the locations (in registers or memory) of "
239 "source-level variables alongside disassembly. "
240 "Supported formats: ascii, unicode (default)">,
241 Values<"unicode,ascii">;
242 def : Flag<["--"], "debug-vars">, Alias<debug_vars_EQ>, AliasArgs<["unicode"]>;
244 def debug_vars_indent_EQ : Joined<["--"], "debug-vars-indent=">,
245 HelpText<"Distance to indent the source-level variable display, "
246 "relative to the start of the disassembly">;
248 def x86_asm_syntax_att : Flag<["--"], "x86-asm-syntax=att">,
249 HelpText<"Emit AT&T-style disassembly">;
251 def x86_asm_syntax_intel : Flag<["--"], "x86-asm-syntax=intel">,
252 HelpText<"Emit Intel-style disassembly">;
255 def grp_mach_o : OptionGroup<"kind">, HelpText<"llvm-objdump MachO Specific Options">;
257 def private_header : Flag<["--"], "private-header">,
258 HelpText<"Display only the first format specific file header">,
261 def exports_trie : Flag<["--"], "exports-trie">,
262 HelpText<"Display mach-o exported symbols">,
265 def rebase : Flag<["--"], "rebase">,
266 HelpText<"Display mach-o rebasing info">,
269 def bind : Flag<["--"], "bind">,
270 HelpText<"Display mach-o binding info">,
273 def lazy_bind : Flag<["--"], "lazy-bind">,
274 HelpText<"Display mach-o lazy binding info">,
277 def weak_bind : Flag<["--"], "weak-bind">,
278 HelpText<"Display mach-o weak binding info">,
281 def g : Flag<["-"], "g">,
282 HelpText<"Print line information from debug info if available">,
285 def dsym_EQ : Joined<["--"], "dsym=">,
286 HelpText<"Use .dSYM file for debug info">,
288 def : Separate<["--"], "dsym">,
292 def full_leading_addr : Flag<["--"], "full-leading-addr">,
293 HelpText<"Print full leading address">,
296 def no_leading_headers : Flag<["--"], "no-leading-headers">,
297 HelpText<"Print no leading headers">,
300 def universal_headers : Flag<["--"], "universal-headers">,
301 HelpText<"Print Mach-O universal headers (requires --macho)">,
304 def archive_member_offsets : Flag<["--"], "archive-member-offsets">,
305 HelpText<"Print the offset to each archive member for Mach-O archives "
306 "(requires --macho and --archive-headers)">,
309 def indirect_symbols : Flag<["--"], "indirect-symbols">,
310 HelpText<"Print indirect symbol table for Mach-O objects (requires --macho)">,
313 def data_in_code : Flag<["--"], "data-in-code">,
314 HelpText<"Print the data in code table for Mach-O objects (requires --macho)">,
317 def function_starts_EQ : Joined<["--"], "function-starts=">,
318 HelpText<"Print the function starts table for Mach-O objects. "
319 "Options: addrs (default), names, both (requires --macho)">,
320 Values<"addrs,names,both">,
323 def : Flag<["--"], "function-starts">, Alias<function_starts_EQ>,
324 AliasArgs<["addrs"]>, Group<grp_mach_o>;
326 def link_opt_hints : Flag<["--"], "link-opt-hints">,
327 HelpText<"Print the linker optimization hints for "
328 "Mach-O objects (requires --macho)">,
331 def info_plist : Flag<["--"], "info-plist">,
332 HelpText<"Print the info plist section as strings for "
333 "Mach-O objects (requires --macho)">,
336 def chained_fixups : Flag<["--"], "chained-fixups">,
337 HelpText<"Print chained fixup information (requires --macho)">,
340 def dyld_info : Flag<["--"], "dyld-info">,
341 HelpText<"Print bind and rebase information used by dyld to resolve "
342 "external references in a final linked binary "
343 "(requires --macho)">,
346 def dylibs_used : Flag<["--"], "dylibs-used">,
347 HelpText<"Print the shared libraries used for linked "
348 "Mach-O files (requires --macho)">,
351 def dylib_id : Flag<["--"], "dylib-id">,
352 HelpText<"Print the shared library's id for the "
353 "dylib Mach-O file (requires --macho)">,
356 def rpaths : Flag<["--"], "rpaths">,
357 HelpText<"Print the runtime search paths for the "
358 "Mach-O file (requires --macho)">,
361 def non_verbose : Flag<["--"], "non-verbose">,
362 HelpText<"Print the info for Mach-O objects in non-verbose or "
363 "numeric form (requires --macho)">,
366 def objc_meta_data : Flag<["--"], "objc-meta-data">,
367 HelpText<"Print the Objective-C runtime meta data "
368 "for Mach-O files (requires --macho)">,
371 def dis_symname : Separate<["--"], "dis-symname">,
372 HelpText<"disassemble just this symbol's instructions (requires --macho)">,
375 def no_symbolic_operands : Flag<["--"], "no-symbolic-operands">,
376 HelpText<"do not symbolic operands when disassembling (requires --macho)">,
379 def arch_EQ : Joined<["--"], "arch=">,
380 HelpText<"architecture(s) from a Mach-O file to dump">,
382 def : Separate<["--"], "arch">,