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 offloading : Flag<["--"], "offloading">, 85 HelpText<"Display the content of the offloading section">; 86 87def file_headers : Flag<["--"], "file-headers">, 88 HelpText<"Display the contents of the overall file header">; 89def : Flag<["-"], "f">, Alias<file_headers>, 90 HelpText<"Alias for --file-headers">; 91 92def full_contents : Flag<["--"], "full-contents">, 93 HelpText<"Display the content of each section">; 94def : Flag<["-"], "s">, Alias<full_contents>, 95 HelpText<"Alias for --full-contents">; 96 97def line_numbers : Flag<["--"], "line-numbers">, 98 HelpText<"When disassembling, display source line numbers. " 99 "Implies --disassemble">; 100def : Flag<["-"], "l">, 101 Alias<line_numbers>, 102 HelpText<"Alias for --line-numbers">; 103 104def macho : Flag<["--"], "macho">, 105 HelpText<"Use MachO specific object file parser">; 106def : Flag<["-"], "m">, Alias<macho>, HelpText<"Alias for --macho">; 107 108def mcpu_EQ : Joined<["--"], "mcpu=">, 109 MetaVarName<"cpu-name">, 110 HelpText<"Target a specific cpu type (--mcpu=help for details)">; 111 112def mattr_EQ : Joined<["--"], "mattr=">, 113 MetaVarName<"a1,+a2,-a3,...">, 114 HelpText<"Target specific attributes (--mattr=help for details)">; 115 116def no_show_raw_insn : Flag<["--"], "no-show-raw-insn">, 117 HelpText<"When disassembling instructions, " 118 "do not print the instruction bytes.">; 119 120def no_leading_addr : Flag<["--"], "no-leading-addr">, 121 HelpText<"When disassembling, do not print leading addresses">; 122 123def raw_clang_ast : Flag<["--"], "raw-clang-ast">, 124 HelpText<"Dump the raw binary contents of the clang AST section">; 125 126def reloc : Flag<["--"], "reloc">, 127 HelpText<"Display the relocation entries in the file">; 128def : Flag<["-"], "r">, Alias<reloc>, HelpText<"Alias for --reloc">; 129 130def print_imm_hex : Flag<["--"], "print-imm-hex">, 131 HelpText<"Use hex format for immediate values">; 132 133def no_print_imm_hex : Flag<["--"], "no-print-imm-hex">, 134 HelpText<"Do not use hex format for immediate values (default)">; 135def : Flag<["--"], "print-imm-hex=false">, Alias<no_print_imm_hex>; 136 137def private_headers : Flag<["--"], "private-headers">, 138 HelpText<"Display format specific file headers">; 139def : Flag<["-"], "p">, Alias<private_headers>, 140 HelpText<"Alias for --private-headers">; 141 142def section_EQ : Joined<["--"], "section=">, 143 HelpText<"Operate on the specified sections only. " 144 "With --macho dump segment,section">; 145def : Separate<["--"], "section">, Alias<section_EQ>; 146def : JoinedOrSeparate<["-"], "j">, Alias<section_EQ>, 147 HelpText<"Alias for --section">; 148 149def section_headers : Flag<["--"], "section-headers">, 150 HelpText<"Display summaries of the headers for each section.">; 151def : Flag<["--"], "headers">, Alias<section_headers>, 152 HelpText<"Alias for --section-headers">; 153def : Flag<["-"], "h">, Alias<section_headers>, 154 HelpText<"Alias for --section-headers">; 155 156def show_lma : Flag<["--"], "show-lma">, 157 HelpText<"Display LMA column when dumping ELF section headers">; 158 159def source : Flag<["--"], "source">, 160 HelpText<"When disassembling, display source interleaved with the " 161 "disassembly. Implies --disassemble">; 162def : Flag<["-"], "S">, Alias<source>, HelpText<"Alias for --source">; 163 164def start_address_EQ : Joined<["--"], "start-address=">, 165 MetaVarName<"address">, 166 HelpText<"Set the start address for disassembling, " 167 "printing relocations and printing symbols">; 168def stop_address_EQ : Joined<["--"], "stop-address=">, 169 MetaVarName<"address">, 170 HelpText<"Set the stop address for disassembling, " 171 "printing relocations and printing symbols">; 172 173def syms : Flag<["--"], "syms">, 174 HelpText<"Display the symbol table">; 175def : Flag<["-"], "t">, Alias<syms>, HelpText<"Alias for --syms">; 176 177def symbolize_operands : Flag<["--"], "symbolize-operands">, 178 HelpText<"Symbolize instruction operands when disassembling">; 179 180def dynamic_syms : Flag<["--"], "dynamic-syms">, 181 HelpText<"Display the contents of the dynamic symbol table">; 182def : Flag<["-"], "T">, Alias<dynamic_syms>, 183 HelpText<"Alias for --dynamic-syms">; 184 185def triple_EQ : Joined<["--"], "triple=">, 186 HelpText<"Target triple to disassemble for, " 187 "see --version for available targets">; 188def : Separate<["--"], "triple">, 189 Alias<triple_EQ>; 190 191def unwind_info : Flag<["--"], "unwind-info">, 192 HelpText<"Display unwind information">; 193def : Flag<["-"], "u">, Alias<unwind_info>, 194 HelpText<"Alias for --unwind-info">; 195 196def wide : Flag<["--"], "wide">, 197 HelpText<"Ignored for compatibility with GNU objdump">; 198def : Flag<["-"], "w">, Alias<wide>; 199 200defm prefix : Eq<"prefix", "Add prefix to absolute paths">, 201 MetaVarName<"prefix">; 202defm prefix_strip 203 : Eq<"prefix-strip", "Strip out initial directories from absolute " 204 "paths. No effect without --prefix">, 205 MetaVarName<"prefix">; 206 207def debug_vars_EQ : Joined<["--"], "debug-vars=">, 208 HelpText<"Print the locations (in registers or memory) of " 209 "source-level variables alongside disassembly. " 210 "Supported formats: ascii, unicode (default)">, 211 Values<"unicode,ascii">; 212def : Flag<["--"], "debug-vars">, Alias<debug_vars_EQ>, AliasArgs<["unicode"]>; 213 214def debug_vars_indent_EQ : Joined<["--"], "debug-vars-indent=">, 215 HelpText<"Distance to indent the source-level variable display, " 216 "relative to the start of the disassembly">; 217 218def x86_asm_syntax_att : Flag<["--"], "x86-asm-syntax=att">, 219 HelpText<"Emit AT&T-style disassembly">; 220 221def x86_asm_syntax_intel : Flag<["--"], "x86-asm-syntax=intel">, 222 HelpText<"Emit Intel-style disassembly">; 223 224 225def grp_mach_o : OptionGroup<"kind">, HelpText<"llvm-objdump MachO Specific Options">; 226 227def private_header : Flag<["--"], "private-header">, 228 HelpText<"Display only the first format specific file header">, 229 Group<grp_mach_o>; 230 231def exports_trie : Flag<["--"], "exports-trie">, 232 HelpText<"Display mach-o exported symbols">, 233 Group<grp_mach_o>; 234 235def rebase : Flag<["--"], "rebase">, 236 HelpText<"Display mach-o rebasing info">, 237 Group<grp_mach_o>; 238 239def bind : Flag<["--"], "bind">, 240 HelpText<"Display mach-o binding info">, 241 Group<grp_mach_o>; 242 243def lazy_bind : Flag<["--"], "lazy-bind">, 244 HelpText<"Display mach-o lazy binding info">, 245 Group<grp_mach_o>; 246 247def weak_bind : Flag<["--"], "weak-bind">, 248 HelpText<"Display mach-o weak binding info">, 249 Group<grp_mach_o>; 250 251def g : Flag<["-"], "g">, 252 HelpText<"Print line information from debug info if available">, 253 Group<grp_mach_o>; 254 255def dsym_EQ : Joined<["--"], "dsym=">, 256 HelpText<"Use .dSYM file for debug info">, 257 Group<grp_mach_o>; 258def : Separate<["--"], "dsym">, 259 Alias<dsym_EQ>, 260 Group<grp_mach_o>; 261 262def full_leading_addr : Flag<["--"], "full-leading-addr">, 263 HelpText<"Print full leading address">, 264 Group<grp_mach_o>; 265 266def no_leading_headers : Flag<["--"], "no-leading-headers">, 267 HelpText<"Print no leading headers">, 268 Group<grp_mach_o>; 269 270def universal_headers : Flag<["--"], "universal-headers">, 271 HelpText<"Print Mach-O universal headers (requires --macho)">, 272 Group<grp_mach_o>; 273 274def archive_member_offsets : Flag<["--"], "archive-member-offsets">, 275 HelpText<"Print the offset to each archive member for Mach-O archives " 276 "(requires --macho and --archive-headers)">, 277 Group<grp_mach_o>; 278 279def indirect_symbols : Flag<["--"], "indirect-symbols">, 280 HelpText<"Print indirect symbol table for Mach-O objects (requires --macho)">, 281 Group<grp_mach_o>; 282 283def data_in_code : Flag<["--"], "data-in-code">, 284 HelpText<"Print the data in code table for Mach-O objects (requires --macho)">, 285 Group<grp_mach_o>; 286 287def function_starts : Flag<["--"], "function-starts">, 288 HelpText<"Print the function starts table for " 289 "Mach-O objects (requires --macho)">, 290 Group<grp_mach_o>; 291 292def link_opt_hints : Flag<["--"], "link-opt-hints">, 293 HelpText<"Print the linker optimization hints for " 294 "Mach-O objects (requires --macho)">, 295 Group<grp_mach_o>; 296 297def info_plist : Flag<["--"], "info-plist">, 298 HelpText<"Print the info plist section as strings for " 299 "Mach-O objects (requires --macho)">, 300 Group<grp_mach_o>; 301 302def dyld_info : Flag<["--"], "dyld_info">, 303 HelpText<"Print bind and rebase information used by dyld to resolve " 304 "external references in a final linked binary " 305 "(requires --macho)">, 306 Group<grp_mach_o>; 307 308def dylibs_used : Flag<["--"], "dylibs-used">, 309 HelpText<"Print the shared libraries used for linked " 310 "Mach-O files (requires --macho)">, 311 Group<grp_mach_o>; 312 313def dylib_id : Flag<["--"], "dylib-id">, 314 HelpText<"Print the shared library's id for the " 315 "dylib Mach-O file (requires --macho)">, 316 Group<grp_mach_o>; 317 318def rpaths : Flag<["--"], "rpaths">, 319 HelpText<"Print the runtime search paths for the " 320 "Mach-O file (requires --macho)">, 321 Group<grp_mach_o>; 322 323def non_verbose : Flag<["--"], "non-verbose">, 324 HelpText<"Print the info for Mach-O objects in non-verbose or " 325 "numeric form (requires --macho)">, 326 Group<grp_mach_o>; 327 328def objc_meta_data : Flag<["--"], "objc-meta-data">, 329 HelpText<"Print the Objective-C runtime meta data " 330 "for Mach-O files (requires --macho)">, 331 Group<grp_mach_o>; 332 333def dis_symname : Separate<["--"], "dis-symname">, 334 HelpText<"disassemble just this symbol's instructions (requires --macho)">, 335 Group<grp_mach_o>; 336 337def no_symbolic_operands : Flag<["--"], "no-symbolic-operands">, 338 HelpText<"do not symbolic operands when disassembling (requires --macho)">, 339 Group<grp_mach_o>; 340 341def arch_EQ : Joined<["--"], "arch=">, 342 HelpText<"architecture(s) from a Mach-O file to dump">, 343 Group<grp_mach_o>; 344def : Separate<["--"], "arch">, 345 Alias<arch_EQ>, 346 Group<grp_mach_o>; 347