ObjdumpOpts.td 14 KB

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