ObjdumpOpts.td 12 KB

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