• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
9 #ifndef LLVM_TOOLS_LLVM_OBJDUMP_LLVM_OBJDUMP_H
10 #define LLVM_TOOLS_LLVM_OBJDUMP_LLVM_OBJDUMP_H
11 
12 #include "llvm/ADT/StringRef.h"
13 #include "llvm/Support/CommandLine.h"
14 #include "llvm/Support/DataTypes.h"
15 
16 namespace llvm {
17 namespace object {
18   class COFFObjectFile;
19   class MachOObjectFile;
20   class ObjectFile;
21   class RelocationRef;
22 }
23 
24 extern cl::opt<std::string> TripleName;
25 extern cl::opt<std::string> ArchName;
26 extern cl::opt<std::string> MCPU;
27 extern cl::list<std::string> MAttrs;
28 extern cl::list<std::string> FilterSections;
29 extern cl::opt<bool> Disassemble;
30 extern cl::opt<bool> DisassembleAll;
31 extern cl::opt<bool> NoShowRawInsn;
32 extern cl::opt<bool> PrivateHeaders;
33 extern cl::opt<bool> ExportsTrie;
34 extern cl::opt<bool> Rebase;
35 extern cl::opt<bool> Bind;
36 extern cl::opt<bool> LazyBind;
37 extern cl::opt<bool> WeakBind;
38 extern cl::opt<bool> RawClangAST;
39 extern cl::opt<bool> UniversalHeaders;
40 extern cl::opt<bool> ArchiveHeaders;
41 extern cl::opt<bool> IndirectSymbols;
42 extern cl::opt<bool> DataInCode;
43 extern cl::opt<bool> LinkOptHints;
44 extern cl::opt<bool> InfoPlist;
45 extern cl::opt<bool> DylibsUsed;
46 extern cl::opt<bool> DylibId;
47 extern cl::opt<bool> ObjcMetaData;
48 extern cl::opt<std::string> DisSymName;
49 extern cl::opt<bool> NonVerbose;
50 extern cl::opt<bool> Relocations;
51 extern cl::opt<bool> SectionHeaders;
52 extern cl::opt<bool> SectionContents;
53 extern cl::opt<bool> SymbolTable;
54 extern cl::opt<bool> UnwindInfo;
55 extern cl::opt<bool> PrintImmHex;
56 
57 // Various helper functions.
58 void error(std::error_code ec);
59 bool RelocAddressLess(object::RelocationRef a, object::RelocationRef b);
60 void ParseInputMachO(StringRef Filename);
61 void printCOFFUnwindInfo(const object::COFFObjectFile* o);
62 void printMachOUnwindInfo(const object::MachOObjectFile* o);
63 void printMachOExportsTrie(const object::MachOObjectFile* o);
64 void printMachORebaseTable(const object::MachOObjectFile* o);
65 void printMachOBindTable(const object::MachOObjectFile* o);
66 void printMachOLazyBindTable(const object::MachOObjectFile* o);
67 void printMachOWeakBindTable(const object::MachOObjectFile* o);
68 void printELFFileHeader(const object::ObjectFile *o);
69 void printCOFFFileHeader(const object::ObjectFile *o);
70 void printCOFFSymbolTable(const object::COFFObjectFile *o);
71 void printMachOFileHeader(const object::ObjectFile *o);
72 void printExportsTrie(const object::ObjectFile *o);
73 void printRebaseTable(const object::ObjectFile *o);
74 void printBindTable(const object::ObjectFile *o);
75 void printLazyBindTable(const object::ObjectFile *o);
76 void printWeakBindTable(const object::ObjectFile *o);
77 void printRawClangAST(const object::ObjectFile *o);
78 void PrintRelocations(const object::ObjectFile *o);
79 void PrintSectionHeaders(const object::ObjectFile *o);
80 void PrintSectionContents(const object::ObjectFile *o);
81 void PrintSymbolTable(const object::ObjectFile *o);
82 void report_error(StringRef File, std::error_code EC);
83 
84 } // end namespace llvm
85 
86 #endif
87