95
|
1 //===-- ObjDumper.h ---------------------------------------------*- C++ -*-===//
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
2 //
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
3 // The LLVM Compiler Infrastructure
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
4 //
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
5 // This file is distributed under the University of Illinois Open Source
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
6 // License. See LICENSE.TXT for details.
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
7 //
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
8 //===----------------------------------------------------------------------===//
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
9
|
77
|
10 #ifndef LLVM_TOOLS_LLVM_READOBJ_OBJDUMPER_H
|
|
11 #define LLVM_TOOLS_LLVM_READOBJ_OBJDUMPER_H
|
|
12
|
|
13 #include <memory>
|
|
14 #include <system_error>
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
15
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
16 namespace llvm {
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
17 namespace object {
|
95
|
18 class COFFImportFile;
|
|
19 class ObjectFile;
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
20 }
|
120
|
21 namespace codeview {
|
|
22 class TypeTableBuilder;
|
|
23 }
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
24
|
120
|
25 class ScopedPrinter;
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
26
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
27 class ObjDumper {
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
28 public:
|
120
|
29 ObjDumper(ScopedPrinter &Writer);
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
30 virtual ~ObjDumper();
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
31
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
32 virtual void printFileHeaders() = 0;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
33 virtual void printSections() = 0;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
34 virtual void printRelocations() = 0;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
35 virtual void printSymbols() = 0;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
36 virtual void printDynamicSymbols() = 0;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
37 virtual void printUnwindInfo() = 0;
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
38
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
39 // Only implemented for ELF at this time.
|
95
|
40 virtual void printDynamicRelocations() { }
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
41 virtual void printDynamicTable() { }
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
42 virtual void printNeededLibraries() { }
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
43 virtual void printProgramHeaders() { }
|
95
|
44 virtual void printHashTable() { }
|
100
|
45 virtual void printGnuHashTable() { }
|
95
|
46 virtual void printLoadName() {}
|
100
|
47 virtual void printVersionInfo() {}
|
120
|
48 virtual void printGroupSections() {}
|
|
49 virtual void printHashHistogram() {}
|
|
50 virtual void printNotes() {}
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
51
|
77
|
52 // Only implemented for ARM ELF at this time.
|
|
53 virtual void printAttributes() { }
|
|
54
|
|
55 // Only implemented for MIPS ELF at this time.
|
|
56 virtual void printMipsPLTGOT() { }
|
95
|
57 virtual void printMipsABIFlags() { }
|
|
58 virtual void printMipsReginfo() { }
|
120
|
59 virtual void printMipsOptions() { }
|
77
|
60
|
83
|
61 // Only implemented for PE/COFF.
|
|
62 virtual void printCOFFImports() { }
|
|
63 virtual void printCOFFExports() { }
|
|
64 virtual void printCOFFDirectives() { }
|
|
65 virtual void printCOFFBaseReloc() { }
|
120
|
66 virtual void printCOFFDebugDirectory() { }
|
121
|
67 virtual void printCOFFResources() {}
|
|
68 virtual void printCOFFLoadConfig() { }
|
100
|
69 virtual void printCodeViewDebugInfo() { }
|
121
|
70 virtual void mergeCodeViewTypes(llvm::codeview::TypeTableBuilder &CVIDs,
|
|
71 llvm::codeview::TypeTableBuilder &CVTypes) {}
|
83
|
72
|
95
|
73 // Only implemented for MachO.
|
|
74 virtual void printMachODataInCode() { }
|
|
75 virtual void printMachOVersionMin() { }
|
|
76 virtual void printMachODysymtab() { }
|
|
77 virtual void printMachOSegment() { }
|
|
78 virtual void printMachOIndirectSymbols() { }
|
|
79 virtual void printMachOLinkerOptions() { }
|
|
80
|
|
81 virtual void printStackMap() const = 0;
|
|
82
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
83 protected:
|
120
|
84 ScopedPrinter &W;
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
85 };
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
86
|
77
|
87 std::error_code createCOFFDumper(const object::ObjectFile *Obj,
|
120
|
88 ScopedPrinter &Writer,
|
77
|
89 std::unique_ptr<ObjDumper> &Result);
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
90
|
77
|
91 std::error_code createELFDumper(const object::ObjectFile *Obj,
|
120
|
92 ScopedPrinter &Writer,
|
77
|
93 std::unique_ptr<ObjDumper> &Result);
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
94
|
77
|
95 std::error_code createMachODumper(const object::ObjectFile *Obj,
|
120
|
96 ScopedPrinter &Writer,
|
77
|
97 std::unique_ptr<ObjDumper> &Result);
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
98
|
121
|
99 std::error_code createWasmDumper(const object::ObjectFile *Obj,
|
|
100 ScopedPrinter &Writer,
|
|
101 std::unique_ptr<ObjDumper> &Result);
|
|
102
|
95
|
103 void dumpCOFFImportFile(const object::COFFImportFile *File);
|
|
104
|
120
|
105 void dumpCodeViewMergedTypes(ScopedPrinter &Writer,
|
121
|
106 llvm::codeview::TypeTableBuilder &IDTable,
|
|
107 llvm::codeview::TypeTableBuilder &TypeTable);
|
120
|
108
|
0
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
109 } // namespace llvm
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
110
|
Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
111 #endif
|