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