LLVM: include/llvm/DebugInfo/LogicalView/Readers/LVCodeViewReader.h Source File (original) (raw)
34 return Item.data();
35 }
36};
71
72 using LVModules = std::vector<LVScope *>;
73 LVModules Modules;
74
75
76
78 std::shared_ptrllvm::pdb::InputFile TypeServer;
79 std::shared_ptr PrecompHeader;
80
81
83 std::unique_ptr MemBuffer;
84 std::unique_ptrllvm::pdb::IPDBSession Session;
85 std::unique_ptrllvm::pdb::NativeSession PdbSession;
86
87
89 std::unique_ptr Builder;
90 std::unique_ptr<BinaryItemStream> ItemStream;
91 std::unique_ptr ReaderPrecomp;
92 std::vector TypeArray;
95
96
97 std::unique_ptr BinaryBuffer;
98 std::unique_ptrllvm::object::Binary BinaryExecutable;
99
102
105 bool IsComdat) override;
106
109 bool isObj() const { return Input.isObj(); }
110 bool isPdb() const { return Input.isPdb(); }
111 StringRef getFileName() { return Input.getFilePath(); }
112
113
114 std::string ExePath;
115
117 int32_t CurrentModule = -1;
118
119 using RelocMapTy = DenseMap<const llvm::object::coff_section *,
120 std::vectorllvm::object::RelocationRef>;
121 RelocMapTy RelocMap;
122
123
124
125 LazyRandomTypeCollection &types() {
126 return TypeServer ? TypeServer->types()
127 : (PrecompHeader ? *PrecompHeader : Input.types());
128 }
129 LazyRandomTypeCollection &ids() {
130 return TypeServer ? TypeServer->ids()
131 : (PrecompHeader ? *PrecompHeader : Input.ids());
132 }
133
134 LVLogicalVisitor LogicalVisitor;
135
136 Expected
137 getFileNameForFileOffset(uint32_t FileOffset,
138 const llvm::pdb::SymbolGroup *SG = nullptr);
139 void printRelocatedField(StringRef Label,
140 const llvm::object::coff_section *CoffSection,
141 uint32_t RelocOffset, uint32_t Offset,
142 StringRef *RelocSym);
143
144 Error printFileNameForOffset(StringRef Label, uint32_t FileOffset,
145 const llvm::pdb::SymbolGroup *SG = nullptr);
146
147 Error loadPrecompiledObject(PrecompRecord &Precomp, CVTypeArray &CVTypesObj);
148 Error loadTypeServer(TypeServer2Record &TS);
149 Error traverseTypes(llvm::pdb::PDBFile &Pdb, LazyRandomTypeCollection &Types,
150 LazyRandomTypeCollection &Ids);
151
152 Error collectInlineeInfo(DebugInlineeLinesSubsectionRef &Lines,
153 const llvm::pdb::SymbolGroup *SG = nullptr);
154
155 void cacheRelocations();
156 Error resolveSymbol(const llvm::object::coff_section *CoffSection,
157 uint64_t Offset, llvm::object::SymbolRef &Sym);
158 Error resolveSymbolName(const llvm::object::coff_section *CoffSection,
160 Error traverseTypeSection(StringRef SectionName,
161 const llvm::object::SectionRef &Section);
162 Error traverseSymbolSection(StringRef SectionName,
163 const llvm::object::SectionRef &Section);
164 Error traverseInlineeLines(StringRef Subsection);
165
166 DebugChecksumsSubsectionRef CVFileChecksumTable;
167 DebugStringTableSubsectionRef CVStringTable;
168
169 Error traverseSymbolsSubsection(StringRef Subsection,
170 const llvm::object::SectionRef &Section,
171 StringRef SectionContents);
172
173
174
175
176 Error initializeFileAndStringTables(BinaryStreamReader &Reader);
177
178 Error createLines(const FixedStreamArray &LineNumbers,
179 LVAddress Addendum, uint32_t Segment, uint32_t Begin,
180 uint32_t Size, uint32_t NameIndex,
181 const llvm::pdb::SymbolGroup *SG = nullptr);
184 Error processModule();
185
186protected:
189
190public:
196 Input(&Obj), ExePath(ExePath), LogicalVisitor(this, W, Input) {}
200 Input(&Pdb), ExePath(ExePath), LogicalVisitor(this, W, Input) {}
204
208
211 return Modi >= Modules.size() ? nullptr : Modules[Modi];
212 }
213
214
217
220
222
225 LogicalVisitor.printRecords(OS);
226 };
227
228#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
230#endif
231};