xref: /freebsd/contrib/llvm-project/llvm/tools/llvm-objdump/ObjdumpOpts.td (revision 3e8eb5c7f4909209c042403ddee340b2ee7003a5)
1include "llvm/Option/OptParser.td"
2
3multiclass Eq<string name, string help> {
4  def NAME : Separate<["--"], name>;
5  def NAME #_eq : Joined<["--"], name #"=">,
6                  Alias<!cast<Separate>(NAME)>,
7                  HelpText<help>;
8}
9
10def help : Flag<["--"], "help">,
11  HelpText<"Display available options (--help-hidden for more)">;
12
13def help_hidden : Flag<["--"], "help-hidden">,
14  Flags<[HelpHidden]>,
15  HelpText<"Display all available options">;
16
17def version : Flag<["--"], "version">,
18  HelpText<"Display the version of this program">;
19def : Flag<["-"], "v">, Alias<version>, HelpText<"Alias for --version">;
20
21def adjust_vma_EQ : Joined<["--"], "adjust-vma=">,
22  MetaVarName<"offset">,
23  HelpText<"Increase the displayed address by the specified offset">;
24
25def all_headers : Flag<["--"], "all-headers">,
26  HelpText<"Display all available header information, "
27           "relocation entries and the symbol table">;
28def : Flag<["-"], "x">, Alias<all_headers>, HelpText<"Alias for --all-headers">;
29
30def arch_name_EQ : Joined<["--"], "arch-name=">,
31  HelpText<"Target arch to disassemble for, "
32            "see --version for available targets">;
33def archive_headers : Flag<["--"], "archive-headers">,
34  HelpText<"Display archive header information">;
35
36def : Flag<["-"], "a">, Alias<archive_headers>,
37  HelpText<"Alias for --archive-headers">;
38
39def demangle : Flag<["--"], "demangle">, HelpText<"Demangle symbol names">;
40def : Flag<["-"], "C">, Alias<demangle>, HelpText<"Alias for --demangle">;
41
42def disassemble : Flag<["--"], "disassemble">,
43  HelpText<"Disassemble all executable sections found in the input files">;
44def : Flag<["-"], "d">, Alias<disassemble>, HelpText<"Alias for --disassemble">;
45
46def disassemble_all : Flag<["--"], "disassemble-all">,
47  HelpText<"Disassemble all sections found in the input files">;
48def : Flag<["-"], "D">, Alias<disassemble_all>,
49  HelpText<"Alias for --disassemble-all">;
50
51def symbol_description : Flag<["--"], "symbol-description">,
52  HelpText<"Add symbol description for disassembly. This "
53           "option is for XCOFF files only.">;
54
55def disassemble_symbols_EQ : Joined<["--"], "disassemble-symbols=">,
56  HelpText<"List of symbols to disassemble. "
57           "Accept demangled names when --demangle is "
58           "specified, otherwise accept mangled names">;
59
60def disassemble_zeroes : Flag<["--"], "disassemble-zeroes">,
61  HelpText<"Do not skip blocks of zeroes when disassembling">;
62def : Flag<["-"], "z">, Alias<disassemble_zeroes>,
63  HelpText<"Alias for --disassemble-zeroes">;
64
65def disassembler_options_EQ : Joined<["--"], "disassembler-options=">,
66  MetaVarName<"options">,
67  HelpText<"Pass target specific disassembler options">;
68def : JoinedOrSeparate<["-"], "M">, Alias<disassembler_options_EQ>,
69  HelpText<"Alias for --disassembler-options=">;
70
71def dynamic_reloc : Flag<["--"], "dynamic-reloc">,
72  HelpText<"Display the dynamic relocation entries in the file">;
73def : Flag<["-"], "R">, Alias<dynamic_reloc>,
74  HelpText<"Alias for --dynamic-reloc">;
75
76def dwarf_EQ : Joined<["--"], "dwarf=">,
77  HelpText<"Dump the specified DWARF debug sections. The "
78           "only supported value is 'frames'">,
79  Values<"frames">;
80
81def fault_map_section : Flag<["--"], "fault-map-section">,
82  HelpText<"Display the content of the fault map section">;
83
84def file_headers : Flag<["--"], "file-headers">,
85  HelpText<"Display the contents of the overall file header">;
86def : Flag<["-"], "f">, Alias<file_headers>,
87  HelpText<"Alias for --file-headers">;
88
89def full_contents : Flag<["--"], "full-contents">,
90  HelpText<"Display the content of each section">;
91def : Flag<["-"], "s">, Alias<full_contents>,
92  HelpText<"Alias for --full-contents">;
93
94def line_numbers : Flag<["--"], "line-numbers">,
95  HelpText<"When disassembling, display source line numbers. "
96           "Implies --disassemble">;
97def : Flag<["-"], "l">,
98  Alias<line_numbers>,
99  HelpText<"Alias for --line-numbers">;
100
101def macho : Flag<["--"], "macho">,
102  HelpText<"Use MachO specific object file parser">;
103def : Flag<["-"], "m">, Alias<macho>, HelpText<"Alias for --macho">;
104
105def mcpu_EQ : Joined<["--"], "mcpu=">,
106  MetaVarName<"cpu-name">,
107  HelpText<"Target a specific cpu type (--mcpu=help for details)">;
108
109def mattr_EQ : Joined<["--"], "mattr=">,
110  MetaVarName<"a1,+a2,-a3,...">,
111  HelpText<"Target specific attributes (--mattr=help for details)">;
112
113def no_show_raw_insn : Flag<["--"], "no-show-raw-insn">,
114  HelpText<"When disassembling instructions, "
115           "do not print the instruction bytes.">;
116
117def no_leading_addr : Flag<["--"], "no-leading-addr">,
118  HelpText<"When disassembling, do not print leading addresses">;
119
120def raw_clang_ast : Flag<["--"], "raw-clang-ast">,
121  HelpText<"Dump the raw binary contents of the clang AST section">;
122
123def reloc : Flag<["--"], "reloc">,
124  HelpText<"Display the relocation entries in the file">;
125def : Flag<["-"], "r">, Alias<reloc>, HelpText<"Alias for --reloc">;
126
127def print_imm_hex : Flag<["--"], "print-imm-hex">,
128  HelpText<"Use hex format for immediate values">;
129
130def no_print_imm_hex : Flag<["--"], "no-print-imm-hex">,
131  HelpText<"Do not use hex format for immediate values (default)">;
132def : Flag<["--"], "print-imm-hex=false">, Alias<no_print_imm_hex>;
133
134def private_headers : Flag<["--"], "private-headers">,
135  HelpText<"Display format specific file headers">;
136def : Flag<["-"], "p">, Alias<private_headers>,
137  HelpText<"Alias for --private-headers">;
138
139def section_EQ : Joined<["--"], "section=">,
140  HelpText<"Operate on the specified sections only. "
141           "With --macho dump segment,section">;
142def : Separate<["--"], "section">, Alias<section_EQ>;
143def : JoinedOrSeparate<["-"], "j">, Alias<section_EQ>,
144  HelpText<"Alias for --section">;
145
146def section_headers : Flag<["--"], "section-headers">,
147  HelpText<"Display summaries of the headers for each section.">;
148def : Flag<["--"], "headers">, Alias<section_headers>,
149  HelpText<"Alias for --section-headers">;
150def : Flag<["-"], "h">, Alias<section_headers>,
151  HelpText<"Alias for --section-headers">;
152
153def show_lma : Flag<["--"], "show-lma">,
154  HelpText<"Display LMA column when dumping ELF section headers">;
155
156def source : Flag<["--"], "source">,
157  HelpText<"When disassembling, display source interleaved with the "
158           "disassembly. Implies --disassemble">;
159def : Flag<["-"], "S">, Alias<source>, HelpText<"Alias for --source">;
160
161def start_address_EQ : Joined<["--"], "start-address=">,
162  MetaVarName<"address">,
163  HelpText<"Set the start address for disassembling, "
164           "printing relocations and printing symbols">;
165def stop_address_EQ : Joined<["--"], "stop-address=">,
166  MetaVarName<"address">,
167  HelpText<"Set the stop address for disassembling, "
168           "printing relocations and printing symbols">;
169
170def syms : Flag<["--"], "syms">,
171  HelpText<"Display the symbol table">;
172def : Flag<["-"], "t">, Alias<syms>, HelpText<"Alias for --syms">;
173
174def symbolize_operands : Flag<["--"], "symbolize-operands">,
175  HelpText<"Symbolize instruction operands when disassembling">;
176
177def dynamic_syms : Flag<["--"], "dynamic-syms">,
178  HelpText<"Display the contents of the dynamic symbol table">;
179def : Flag<["-"], "T">, Alias<dynamic_syms>,
180  HelpText<"Alias for --dynamic-syms">;
181
182def triple_EQ : Joined<["--"], "triple=">,
183  HelpText<"Target triple to disassemble for, "
184            "see --version for available targets">;
185def : Separate<["--"], "triple">,
186  Alias<triple_EQ>;
187
188def unwind_info : Flag<["--"], "unwind-info">,
189  HelpText<"Display unwind information">;
190def : Flag<["-"], "u">, Alias<unwind_info>,
191  HelpText<"Alias for --unwind-info">;
192
193def wide : Flag<["--"], "wide">,
194  HelpText<"Ignored for compatibility with GNU objdump">;
195def : Flag<["-"], "w">, Alias<wide>;
196
197defm prefix : Eq<"prefix", "Add prefix to absolute paths">,
198              MetaVarName<"prefix">;
199defm prefix_strip
200    : Eq<"prefix-strip", "Strip out initial directories from absolute "
201                         "paths. No effect without --prefix">,
202      MetaVarName<"prefix">;
203
204def debug_vars_EQ : Joined<["--"], "debug-vars=">,
205  HelpText<"Print the locations (in registers or memory) of "
206           "source-level variables alongside disassembly. "
207           "Supported formats: ascii, unicode (default)">,
208  Values<"unicode,ascii">;
209def : Flag<["--"], "debug-vars">, Alias<debug_vars_EQ>, AliasArgs<["unicode"]>;
210
211def debug_vars_indent_EQ : Joined<["--"], "debug-vars-indent=">,
212  HelpText<"Distance to indent the source-level variable display, "
213           "relative to the start of the disassembly">;
214
215def x86_asm_syntax_att : Flag<["--"], "x86-asm-syntax=att">,
216  HelpText<"Emit AT&T-style disassembly">;
217
218def x86_asm_syntax_intel : Flag<["--"], "x86-asm-syntax=intel">,
219  HelpText<"Emit Intel-style disassembly">;
220
221
222def grp_mach_o : OptionGroup<"kind">, HelpText<"llvm-objdump MachO Specific Options">;
223
224def private_header : Flag<["--"], "private-header">,
225  HelpText<"Display only the first format specific file header">,
226  Group<grp_mach_o>;
227
228def exports_trie : Flag<["--"], "exports-trie">,
229  HelpText<"Display mach-o exported symbols">,
230  Group<grp_mach_o>;
231
232def rebase : Flag<["--"], "rebase">,
233  HelpText<"Display mach-o rebasing info">,
234  Group<grp_mach_o>;
235
236def bind : Flag<["--"], "bind">,
237  HelpText<"Display mach-o binding info">,
238  Group<grp_mach_o>;
239
240def lazy_bind : Flag<["--"], "lazy-bind">,
241  HelpText<"Display mach-o lazy binding info">,
242  Group<grp_mach_o>;
243
244def weak_bind : Flag<["--"], "weak-bind">,
245  HelpText<"Display mach-o weak binding info">,
246  Group<grp_mach_o>;
247
248def g : Flag<["-"], "g">,
249  HelpText<"Print line information from debug info if available">,
250  Group<grp_mach_o>;
251
252def dsym_EQ : Joined<["--"], "dsym=">,
253  HelpText<"Use .dSYM file for debug info">,
254  Group<grp_mach_o>;
255def : Separate<["--"], "dsym">,
256  Alias<dsym_EQ>,
257  Group<grp_mach_o>;
258
259def full_leading_addr : Flag<["--"], "full-leading-addr">,
260  HelpText<"Print full leading address">,
261  Group<grp_mach_o>;
262
263def no_leading_headers : Flag<["--"], "no-leading-headers">,
264  HelpText<"Print no leading headers">,
265  Group<grp_mach_o>;
266
267def universal_headers : Flag<["--"], "universal-headers">,
268  HelpText<"Print Mach-O universal headers (requires --macho)">,
269  Group<grp_mach_o>;
270
271def archive_member_offsets : Flag<["--"], "archive-member-offsets">,
272  HelpText<"Print the offset to each archive member for Mach-O archives "
273           "(requires --macho and --archive-headers)">,
274  Group<grp_mach_o>;
275
276def indirect_symbols : Flag<["--"], "indirect-symbols">,
277  HelpText<"Print indirect symbol table for Mach-O objects (requires --macho)">,
278  Group<grp_mach_o>;
279
280def data_in_code : Flag<["--"], "data-in-code">,
281  HelpText<"Print the data in code table for Mach-O objects (requires --macho)">,
282  Group<grp_mach_o>;
283
284def function_starts : Flag<["--"], "function-starts">,
285  HelpText<"Print the function starts table for "
286           "Mach-O objects (requires --macho)">,
287  Group<grp_mach_o>;
288
289def link_opt_hints : Flag<["--"], "link-opt-hints">,
290  HelpText<"Print the linker optimization hints for "
291           "Mach-O objects (requires --macho)">,
292  Group<grp_mach_o>;
293
294def info_plist : Flag<["--"], "info-plist">,
295  HelpText<"Print the info plist section as strings for "
296           "Mach-O objects (requires --macho)">,
297  Group<grp_mach_o>;
298
299def dylibs_used : Flag<["--"], "dylibs-used">,
300  HelpText<"Print the shared libraries used for linked "
301           "Mach-O files (requires --macho)">,
302  Group<grp_mach_o>;
303
304def dylib_id : Flag<["--"], "dylib-id">,
305  HelpText<"Print the shared library's id for the "
306           "dylib Mach-O file (requires --macho)">,
307  Group<grp_mach_o>;
308
309def rpaths : Flag<["--"], "rpaths">,
310  HelpText<"Print the runtime search paths for the "
311           "Mach-O file (requires --macho)">,
312  Group<grp_mach_o>;
313
314def non_verbose : Flag<["--"], "non-verbose">,
315  HelpText<"Print the info for Mach-O objects in non-verbose or "
316           "numeric form (requires --macho)">,
317  Group<grp_mach_o>;
318
319def objc_meta_data : Flag<["--"], "objc-meta-data">,
320  HelpText<"Print the Objective-C runtime meta data "
321           "for Mach-O files (requires --macho)">,
322  Group<grp_mach_o>;
323
324def dis_symname : Separate<["--"], "dis-symname">,
325  HelpText<"disassemble just this symbol's instructions (requires --macho)">,
326  Group<grp_mach_o>;
327
328def no_symbolic_operands : Flag<["--"], "no-symbolic-operands">,
329  HelpText<"do not symbolic operands when disassembling (requires --macho)">,
330  Group<grp_mach_o>;
331
332def arch_EQ : Joined<["--"], "arch=">,
333  HelpText<"architecture(s) from a Mach-O file to dump">,
334  Group<grp_mach_o>;
335def : Separate<["--"], "arch">,
336  Alias<arch_EQ>,
337  Group<grp_mach_o>;
338