Benjamin Kramer | 43a772e | 2011-09-19 17:56:04 +0000 | [diff] [blame] | 1 | // |
| 2 | // The LLVM Compiler Infrastructure |
| 3 | // |
| 4 | // This file is distributed under the University of Illinois Open Source |
| 5 | // License. See LICENSE.TXT for details. |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
Benjamin Kramer | a7c40ef | 2014-08-13 16:26:38 +0000 | [diff] [blame] | 9 | #ifndef LLVM_TOOLS_LLVM_OBJDUMP_LLVM_OBJDUMP_H |
| 10 | #define LLVM_TOOLS_LLVM_OBJDUMP_LLVM_OBJDUMP_H |
Benjamin Kramer | 43a772e | 2011-09-19 17:56:04 +0000 | [diff] [blame] | 11 | |
| 12 | #include "llvm/ADT/StringRef.h" |
Igor Laevsky | 03a670c | 2016-01-26 15:09:42 +0000 | [diff] [blame^] | 13 | #include "llvm/DebugInfo/DIContext.h" |
Benjamin Kramer | 43a772e | 2011-09-19 17:56:04 +0000 | [diff] [blame] | 14 | #include "llvm/Support/CommandLine.h" |
Davide Italiano | ed9d95b | 2015-12-29 13:41:02 +0000 | [diff] [blame] | 15 | #include "llvm/Support/Compiler.h" |
Benjamin Kramer | 43a772e | 2011-09-19 17:56:04 +0000 | [diff] [blame] | 16 | #include "llvm/Support/DataTypes.h" |
Benjamin Kramer | 43a772e | 2011-09-19 17:56:04 +0000 | [diff] [blame] | 17 | |
| 18 | namespace llvm { |
Michael J. Spencer | 0c6ec48 | 2012-12-05 20:12:35 +0000 | [diff] [blame] | 19 | namespace object { |
| 20 | class COFFObjectFile; |
Tim Northover | 4bd286a | 2014-08-01 13:07:19 +0000 | [diff] [blame] | 21 | class MachOObjectFile; |
Michael J. Spencer | 209565db | 2013-01-06 03:56:49 +0000 | [diff] [blame] | 22 | class ObjectFile; |
Michael J. Spencer | 0c6ec48 | 2012-12-05 20:12:35 +0000 | [diff] [blame] | 23 | class RelocationRef; |
| 24 | } |
Michael J. Spencer | 0c6ec48 | 2012-12-05 20:12:35 +0000 | [diff] [blame] | 25 | |
Benjamin Kramer | 43a772e | 2011-09-19 17:56:04 +0000 | [diff] [blame] | 26 | extern cl::opt<std::string> TripleName; |
| 27 | extern cl::opt<std::string> ArchName; |
Kevin Enderby | c959562 | 2014-08-06 23:24:41 +0000 | [diff] [blame] | 28 | extern cl::opt<std::string> MCPU; |
| 29 | extern cl::list<std::string> MAttrs; |
Colin LeMahieu | fcc3276 | 2015-07-29 19:08:10 +0000 | [diff] [blame] | 30 | extern cl::list<std::string> FilterSections; |
Colin LeMahieu | 77804be | 2015-07-29 15:45:39 +0000 | [diff] [blame] | 31 | extern cl::opt<bool> Disassemble; |
Colin LeMahieu | f34933e | 2015-07-23 20:58:49 +0000 | [diff] [blame] | 32 | extern cl::opt<bool> DisassembleAll; |
Kevin Enderby | bf246f5 | 2014-09-24 23:08:22 +0000 | [diff] [blame] | 33 | extern cl::opt<bool> NoShowRawInsn; |
Kevin Enderby | e2297dd | 2015-01-07 21:02:18 +0000 | [diff] [blame] | 34 | extern cl::opt<bool> PrivateHeaders; |
Kevin Enderby | 0ae163f | 2016-01-13 00:25:36 +0000 | [diff] [blame] | 35 | extern cl::opt<bool> FirstPrivateHeader; |
Kevin Enderby | e2297dd | 2015-01-07 21:02:18 +0000 | [diff] [blame] | 36 | extern cl::opt<bool> ExportsTrie; |
| 37 | extern cl::opt<bool> Rebase; |
| 38 | extern cl::opt<bool> Bind; |
| 39 | extern cl::opt<bool> LazyBind; |
| 40 | extern cl::opt<bool> WeakBind; |
Adrian Prantl | 437105a | 2015-07-08 02:04:15 +0000 | [diff] [blame] | 41 | extern cl::opt<bool> RawClangAST; |
Kevin Enderby | 131d177 | 2015-01-09 19:22:37 +0000 | [diff] [blame] | 42 | extern cl::opt<bool> UniversalHeaders; |
Kevin Enderby | 13023a1 | 2015-01-15 23:19:11 +0000 | [diff] [blame] | 43 | extern cl::opt<bool> ArchiveHeaders; |
Kevin Enderby | a7bdc7e | 2015-01-22 18:55:27 +0000 | [diff] [blame] | 44 | extern cl::opt<bool> IndirectSymbols; |
Kevin Enderby | 69fe98d | 2015-01-23 18:52:17 +0000 | [diff] [blame] | 45 | extern cl::opt<bool> DataInCode; |
Kevin Enderby | 9a50944 | 2015-01-27 21:28:24 +0000 | [diff] [blame] | 46 | extern cl::opt<bool> LinkOptHints; |
Kevin Enderby | cd66be5 | 2015-03-11 22:06:32 +0000 | [diff] [blame] | 47 | extern cl::opt<bool> InfoPlist; |
Kevin Enderby | bc847fa | 2015-03-16 20:08:09 +0000 | [diff] [blame] | 48 | extern cl::opt<bool> DylibsUsed; |
| 49 | extern cl::opt<bool> DylibId; |
Kevin Enderby | 0fc1182 | 2015-04-01 20:57:01 +0000 | [diff] [blame] | 50 | extern cl::opt<bool> ObjcMetaData; |
Kevin Enderby | 6a22175 | 2015-03-17 17:10:57 +0000 | [diff] [blame] | 51 | extern cl::opt<std::string> DisSymName; |
Kevin Enderby | f064075 | 2015-03-13 17:56:32 +0000 | [diff] [blame] | 52 | extern cl::opt<bool> NonVerbose; |
Kevin Enderby | 98da613 | 2015-01-20 21:47:46 +0000 | [diff] [blame] | 53 | extern cl::opt<bool> Relocations; |
| 54 | extern cl::opt<bool> SectionHeaders; |
| 55 | extern cl::opt<bool> SectionContents; |
| 56 | extern cl::opt<bool> SymbolTable; |
| 57 | extern cl::opt<bool> UnwindInfo; |
Colin LeMahieu | 14ec76e | 2015-06-07 21:07:17 +0000 | [diff] [blame] | 58 | extern cl::opt<bool> PrintImmHex; |
Igor Laevsky | 03a670c | 2016-01-26 15:09:42 +0000 | [diff] [blame^] | 59 | extern cl::opt<DIDumpType> DwarfDumpType; |
Benjamin Kramer | 43a772e | 2011-09-19 17:56:04 +0000 | [diff] [blame] | 60 | |
| 61 | // Various helper functions. |
Davide Italiano | ccd53fe | 2015-08-05 07:18:31 +0000 | [diff] [blame] | 62 | void error(std::error_code ec); |
Michael J. Spencer | 0c6ec48 | 2012-12-05 20:12:35 +0000 | [diff] [blame] | 63 | bool RelocAddressLess(object::RelocationRef a, object::RelocationRef b); |
Kevin Enderby | e2297dd | 2015-01-07 21:02:18 +0000 | [diff] [blame] | 64 | void ParseInputMachO(StringRef Filename); |
Michael J. Spencer | 0c6ec48 | 2012-12-05 20:12:35 +0000 | [diff] [blame] | 65 | void printCOFFUnwindInfo(const object::COFFObjectFile* o); |
Tim Northover | 4bd286a | 2014-08-01 13:07:19 +0000 | [diff] [blame] | 66 | void printMachOUnwindInfo(const object::MachOObjectFile* o); |
Nick Kledzik | d04bc35 | 2014-08-30 00:20:14 +0000 | [diff] [blame] | 67 | void printMachOExportsTrie(const object::MachOObjectFile* o); |
Nick Kledzik | ac43144 | 2014-09-12 21:34:15 +0000 | [diff] [blame] | 68 | void printMachORebaseTable(const object::MachOObjectFile* o); |
Nick Kledzik | 56ebef4 | 2014-09-16 01:41:51 +0000 | [diff] [blame] | 69 | void printMachOBindTable(const object::MachOObjectFile* o); |
| 70 | void printMachOLazyBindTable(const object::MachOObjectFile* o); |
| 71 | void printMachOWeakBindTable(const object::MachOObjectFile* o); |
Michael J. Spencer | 209565db | 2013-01-06 03:56:49 +0000 | [diff] [blame] | 72 | void printELFFileHeader(const object::ObjectFile *o); |
Rui Ueyama | c2bed42 | 2013-09-27 21:04:00 +0000 | [diff] [blame] | 73 | void printCOFFFileHeader(const object::ObjectFile *o); |
Davide Italiano | e85abf7 | 2015-12-20 09:54:34 +0000 | [diff] [blame] | 74 | void printCOFFSymbolTable(const object::COFFObjectFile *o); |
Kevin Enderby | b76d386 | 2014-08-22 20:35:18 +0000 | [diff] [blame] | 75 | void printMachOFileHeader(const object::ObjectFile *o); |
Kevin Enderby | 0ae163f | 2016-01-13 00:25:36 +0000 | [diff] [blame] | 76 | void printMachOLoadCommands(const object::ObjectFile *o); |
Kevin Enderby | e2297dd | 2015-01-07 21:02:18 +0000 | [diff] [blame] | 77 | void printExportsTrie(const object::ObjectFile *o); |
| 78 | void printRebaseTable(const object::ObjectFile *o); |
| 79 | void printBindTable(const object::ObjectFile *o); |
| 80 | void printLazyBindTable(const object::ObjectFile *o); |
| 81 | void printWeakBindTable(const object::ObjectFile *o); |
Adrian Prantl | 437105a | 2015-07-08 02:04:15 +0000 | [diff] [blame] | 82 | void printRawClangAST(const object::ObjectFile *o); |
Kevin Enderby | 98da613 | 2015-01-20 21:47:46 +0000 | [diff] [blame] | 83 | void PrintRelocations(const object::ObjectFile *o); |
| 84 | void PrintSectionHeaders(const object::ObjectFile *o); |
| 85 | void PrintSectionContents(const object::ObjectFile *o); |
| 86 | void PrintSymbolTable(const object::ObjectFile *o); |
Davide Italiano | ed9d95b | 2015-12-29 13:41:02 +0000 | [diff] [blame] | 87 | LLVM_ATTRIBUTE_NORETURN void report_error(StringRef File, std::error_code EC); |
Benjamin Kramer | 43a772e | 2011-09-19 17:56:04 +0000 | [diff] [blame] | 88 | |
Rui Ueyama | c2bed42 | 2013-09-27 21:04:00 +0000 | [diff] [blame] | 89 | } // end namespace llvm |
Benjamin Kramer | 43a772e | 2011-09-19 17:56:04 +0000 | [diff] [blame] | 90 | |
| 91 | #endif |