LLVM  14.0.0git
DbiStream.cpp
Go to the documentation of this file.
1 //===- DbiStream.cpp - PDB Dbi Stream (Stream 3) Access -------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
10 #include "llvm/ADT/StringRef.h"
19 #include "llvm/Object/COFF.h"
22 #include "llvm/Support/Error.h"
23 #include <algorithm>
24 #include <cstddef>
25 #include <cstdint>
26 
27 using namespace llvm;
28 using namespace llvm::codeview;
29 using namespace llvm::msf;
30 using namespace llvm::pdb;
31 using namespace llvm::support;
32 
33 template <typename ContribType>
35  BinaryStreamReader &Reader) {
36  if (Reader.bytesRemaining() % sizeof(ContribType) != 0)
37  return make_error<RawError>(
38  raw_error_code::corrupt_file,
39  "Invalid number of bytes of section contributions");
40 
41  uint32_t Count = Reader.bytesRemaining() / sizeof(ContribType);
42  if (auto EC = Reader.readArray(Output, Count))
43  return EC;
44  return Error::success();
45 }
46 
47 DbiStream::DbiStream(std::unique_ptr<BinaryStream> Stream)
48  : Stream(std::move(Stream)), Header(nullptr) {}
49 
50 DbiStream::~DbiStream() = default;
51 
53  BinaryStreamReader Reader(*Stream);
54 
55  if (Stream->getLength() < sizeof(DbiStreamHeader))
56  return make_error<RawError>(raw_error_code::corrupt_file,
57  "DBI Stream does not contain a header.");
58  if (auto EC = Reader.readObject(Header))
59  return make_error<RawError>(raw_error_code::corrupt_file,
60  "DBI Stream does not contain a header.");
61 
62  if (Header->VersionSignature != -1)
63  return make_error<RawError>(raw_error_code::corrupt_file,
64  "Invalid DBI version signature.");
65 
66  // Require at least version 7, which should be present in all PDBs
67  // produced in the last decade and allows us to avoid having to
68  // special case all kinds of complicated arcane formats.
69  if (Header->VersionHeader < PdbDbiV70)
70  return make_error<RawError>(raw_error_code::feature_unsupported,
71  "Unsupported DBI version.");
72 
73  if (Stream->getLength() !=
74  sizeof(DbiStreamHeader) + Header->ModiSubstreamSize +
75  Header->SecContrSubstreamSize + Header->SectionMapSize +
76  Header->FileInfoSize + Header->TypeServerSize +
77  Header->OptionalDbgHdrSize + Header->ECSubstreamSize)
78  return make_error<RawError>(raw_error_code::corrupt_file,
79  "DBI Length does not equal sum of substreams.");
80 
81  // Only certain substreams are guaranteed to be aligned. Validate
82  // them here.
83  if (Header->ModiSubstreamSize % sizeof(uint32_t) != 0)
84  return make_error<RawError>(raw_error_code::corrupt_file,
85  "DBI MODI substream not aligned.");
86  if (Header->SecContrSubstreamSize % sizeof(uint32_t) != 0)
87  return make_error<RawError>(
89  "DBI section contribution substream not aligned.");
90  if (Header->SectionMapSize % sizeof(uint32_t) != 0)
91  return make_error<RawError>(raw_error_code::corrupt_file,
92  "DBI section map substream not aligned.");
93  if (Header->FileInfoSize % sizeof(uint32_t) != 0)
94  return make_error<RawError>(raw_error_code::corrupt_file,
95  "DBI file info substream not aligned.");
96  if (Header->TypeServerSize % sizeof(uint32_t) != 0)
97  return make_error<RawError>(raw_error_code::corrupt_file,
98  "DBI type server substream not aligned.");
99 
100  if (auto EC = Reader.readSubstream(ModiSubstream, Header->ModiSubstreamSize))
101  return EC;
102 
103  if (auto EC = Reader.readSubstream(SecContrSubstream,
104  Header->SecContrSubstreamSize))
105  return EC;
106  if (auto EC = Reader.readSubstream(SecMapSubstream, Header->SectionMapSize))
107  return EC;
108  if (auto EC = Reader.readSubstream(FileInfoSubstream, Header->FileInfoSize))
109  return EC;
110  if (auto EC =
111  Reader.readSubstream(TypeServerMapSubstream, Header->TypeServerSize))
112  return EC;
113  if (auto EC = Reader.readSubstream(ECSubstream, Header->ECSubstreamSize))
114  return EC;
115  if (auto EC = Reader.readArray(
116  DbgStreams, Header->OptionalDbgHdrSize / sizeof(ulittle16_t)))
117  return EC;
118 
119  if (auto EC = Modules.initialize(ModiSubstream.StreamData,
120  FileInfoSubstream.StreamData))
121  return EC;
122 
123  if (auto EC = initializeSectionContributionData())
124  return EC;
125  if (auto EC = initializeSectionHeadersData(Pdb))
126  return EC;
127  if (auto EC = initializeSectionMapData())
128  return EC;
129  if (auto EC = initializeOldFpoRecords(Pdb))
130  return EC;
131  if (auto EC = initializeNewFpoRecords(Pdb))
132  return EC;
133 
134  if (Reader.bytesRemaining() > 0)
135  return make_error<RawError>(raw_error_code::corrupt_file,
136  "Found unexpected bytes in DBI Stream.");
137 
138  if (!ECSubstream.empty()) {
139  BinaryStreamReader ECReader(ECSubstream.StreamData);
140  if (auto EC = ECNames.reload(ECReader))
141  return EC;
142  }
143 
144  return Error::success();
145 }
146 
148  uint32_t Value = Header->VersionHeader;
149  return static_cast<PdbRaw_DbiVer>(Value);
150 }
151 
152 uint32_t DbiStream::getAge() const { return Header->Age; }
153 
155  return Header->PublicSymbolStreamIndex;
156 }
157 
159  return Header->GlobalSymbolStreamIndex;
160 }
161 
162 uint16_t DbiStream::getFlags() const { return Header->Flags; }
163 
165  return (Header->Flags & DbiFlags::FlagIncrementalMask) != 0;
166 }
167 
168 bool DbiStream::hasCTypes() const {
169  return (Header->Flags & DbiFlags::FlagHasCTypesMask) != 0;
170 }
171 
172 bool DbiStream::isStripped() const {
173  return (Header->Flags & DbiFlags::FlagStrippedMask) != 0;
174 }
175 
176 uint16_t DbiStream::getBuildNumber() const { return Header->BuildNumber; }
177 
179  return (Header->BuildNumber & DbiBuildNo::BuildMajorMask) >>
181 }
182 
184  return (Header->BuildNumber & DbiBuildNo::BuildMinorMask) >>
186 }
187 
188 uint16_t DbiStream::getPdbDllRbld() const { return Header->PdbDllRbld; }
189 
191 
193  return Header->SymRecordStreamIndex;
194 }
195 
197  uint16_t Machine = Header->MachineType;
198  return static_cast<PDB_Machine>(Machine);
199 }
200 
202  return SectionHeaders;
203 }
204 
205 bool DbiStream::hasOldFpoRecords() const { return OldFpoStream != nullptr; }
206 
208  return OldFpoRecords;
209 }
210 
211 bool DbiStream::hasNewFpoRecords() const { return NewFpoStream != nullptr; }
212 
214  return NewFpoRecords;
215 }
216 
217 const DbiModuleList &DbiStream::modules() const { return Modules; }
218 
220  return SectionMap;
221 }
222 
224  ISectionContribVisitor &Visitor) const {
225  if (!SectionContribs.empty()) {
226  assert(SectionContribVersion == DbiSecContribVer60);
227  for (auto &SC : SectionContribs)
228  Visitor.visit(SC);
229  } else if (!SectionContribs2.empty()) {
230  assert(SectionContribVersion == DbiSecContribV2);
231  for (auto &SC : SectionContribs2)
232  Visitor.visit(SC);
233  }
234 }
235 
237  return ECNames.getStringForID(NI);
238 }
239 
240 Error DbiStream::initializeSectionContributionData() {
241  if (SecContrSubstream.empty())
242  return Error::success();
243 
244  BinaryStreamReader SCReader(SecContrSubstream.StreamData);
245  if (auto EC = SCReader.readEnum(SectionContribVersion))
246  return EC;
247 
248  if (SectionContribVersion == DbiSecContribVer60)
249  return loadSectionContribs<SectionContrib>(SectionContribs, SCReader);
250  if (SectionContribVersion == DbiSecContribV2)
251  return loadSectionContribs<SectionContrib2>(SectionContribs2, SCReader);
252 
253  return make_error<RawError>(raw_error_code::feature_unsupported,
254  "Unsupported DBI Section Contribution version");
255 }
256 
257 // Initializes this->SectionHeaders.
258 Error DbiStream::initializeSectionHeadersData(PDBFile *Pdb) {
260  createIndexedStreamForHeaderType(Pdb, DbgHeaderType::SectionHdr);
261  if (auto EC = ExpectedStream.takeError())
262  return EC;
263 
264  auto &SHS = *ExpectedStream;
265  if (!SHS)
266  return Error::success();
267 
268  size_t StreamLen = SHS->getLength();
269  if (StreamLen % sizeof(object::coff_section))
270  return make_error<RawError>(raw_error_code::corrupt_file,
271  "Corrupted section header stream.");
272 
273  size_t NumSections = StreamLen / sizeof(object::coff_section);
274  BinaryStreamReader Reader(*SHS);
275  if (auto EC = Reader.readArray(SectionHeaders, NumSections))
276  return make_error<RawError>(raw_error_code::corrupt_file,
277  "Could not read a bitmap.");
278 
279  SectionHeaderStream = std::move(SHS);
280  return Error::success();
281 }
282 
283 // Initializes this->Fpos.
284 Error DbiStream::initializeOldFpoRecords(PDBFile *Pdb) {
286  createIndexedStreamForHeaderType(Pdb, DbgHeaderType::FPO);
287  if (auto EC = ExpectedStream.takeError())
288  return EC;
289 
290  auto &FS = *ExpectedStream;
291  if (!FS)
292  return Error::success();
293 
294  size_t StreamLen = FS->getLength();
295  if (StreamLen % sizeof(object::FpoData))
296  return make_error<RawError>(raw_error_code::corrupt_file,
297  "Corrupted Old FPO stream.");
298 
299  size_t NumRecords = StreamLen / sizeof(object::FpoData);
300  BinaryStreamReader Reader(*FS);
301  if (auto EC = Reader.readArray(OldFpoRecords, NumRecords))
302  return make_error<RawError>(raw_error_code::corrupt_file,
303  "Corrupted Old FPO stream.");
304  OldFpoStream = std::move(FS);
305  return Error::success();
306 }
307 
308 Error DbiStream::initializeNewFpoRecords(PDBFile *Pdb) {
310  createIndexedStreamForHeaderType(Pdb, DbgHeaderType::NewFPO);
311  if (auto EC = ExpectedStream.takeError())
312  return EC;
313 
314  auto &FS = *ExpectedStream;
315  if (!FS)
316  return Error::success();
317 
318  if (auto EC = NewFpoRecords.initialize(*FS))
319  return EC;
320 
321  NewFpoStream = std::move(FS);
322  return Error::success();
323 }
324 
326 DbiStream::createIndexedStreamForHeaderType(PDBFile *Pdb,
327  DbgHeaderType Type) const {
328  if (!Pdb)
329  return nullptr;
330 
331  if (DbgStreams.empty())
332  return nullptr;
333 
334  uint32_t StreamNum = getDebugStreamIndex(Type);
335 
336  // This means there is no such stream.
337  if (StreamNum == kInvalidStreamIndex)
338  return nullptr;
339 
340  return Pdb->safelyCreateIndexedStream(StreamNum);
341 }
342 
344  return SecContrSubstream;
345 }
346 
348  return SecMapSubstream;
349 }
350 
352  return ModiSubstream;
353 }
354 
356  return FileInfoSubstream;
357 }
358 
360  return TypeServerMapSubstream;
361 }
362 
363 BinarySubstreamRef DbiStream::getECSubstreamData() const { return ECSubstream; }
364 
365 Error DbiStream::initializeSectionMapData() {
366  if (SecMapSubstream.empty())
367  return Error::success();
368 
369  BinaryStreamReader SMReader(SecMapSubstream.StreamData);
370  const SecMapHeader *Header;
371  if (auto EC = SMReader.readObject(Header))
372  return EC;
373  if (auto EC = SMReader.readArray(SectionMap, Header->SecCount))
374  return EC;
375  return Error::success();
376 }
377 
379  uint16_t T = static_cast<uint16_t>(Type);
380  if (T >= DbgStreams.size())
381  return kInvalidStreamIndex;
382  return DbgStreams[T];
383 }
llvm::pdb::DbiStream::hasOldFpoRecords
bool hasOldFpoRecords() const
Definition: DbiStream.cpp:205
llvm::pdb::DbiStream::isStripped
bool isStripped() const
Definition: DbiStream.cpp:172
BinaryStreamReader.h
llvm::pdb::DbiStreamHeader::TypeServerSize
support::little32_t TypeServerSize
Size of type server map.
Definition: RawTypes.h:157
llvm::pdb::DbiSecContribVer60
@ DbiSecContribVer60
Definition: RawConstants.h:68
RawConstants.h
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
llvm::pdb::DbiBuildNo::BuildMajorMask
static const uint16_t BuildMajorMask
Definition: RawTypes.h:112
llvm::pdb::DbiBuildNo::BuildMinorMask
static const uint16_t BuildMinorMask
uint16_t MinorVersion : 8; uint16_t MajorVersion : 7; uint16_t NewVersionFormat : 1;
Definition: RawTypes.h:109
llvm::pdb::DbiModuleList::initialize
Error initialize(BinaryStreamRef ModInfo, BinaryStreamRef FileInfo)
Definition: DbiModuleList.cpp:162
llvm::support::detail::packed_endian_specific_integral
Definition: Endian.h:206
RawTypes.h
llvm::pdb::DbiSecContribV2
@ DbiSecContribV2
Definition: RawConstants.h:69
llvm::pdb::DbiFlags::FlagIncrementalMask
static const uint16_t FlagIncrementalMask
uint16_t IncrementalLinking : 1; // True if linked incrementally uint16_t IsStripped : 1; // True if ...
Definition: RawTypes.h:100
StringRef.h
llvm::pdb::DbiStream::visitSectionContributions
void visitSectionContributions(ISectionContribVisitor &Visitor) const
Definition: DbiStream.cpp:223
DbiModuleDescriptor.h
llvm::pdb::ISectionContribVisitor
Definition: ISectionContribVisitor.h:18
llvm::pdb::DbiStream::getPublicSymbolStreamIndex
uint16_t getPublicSymbolStreamIndex() const
Definition: DbiStream.cpp:154
llvm::codeview::DebugFrameDataSubsectionRef
Definition: DebugFrameDataSubsection.h:20
llvm::Error::success
static ErrorSuccess success()
Create a success value.
Definition: Error.h:331
llvm::pdb::kInvalidStreamIndex
const uint16_t kInvalidStreamIndex
Definition: RawConstants.h:19
Error.h
llvm::pdb::DbiStream::getFlags
uint16_t getFlags() const
Definition: DbiStream.cpp:162
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:45
llvm::BinaryStreamReader::bytesRemaining
uint64_t bytesRemaining() const
Definition: BinaryStreamReader.h:257
T
#define T
Definition: Mips16ISelLowering.cpp:341
llvm::Expected
Tagged union holding either a T or a Error.
Definition: APFloat.h:42
llvm::pdb::DbiStream::getOldFpoRecords
FixedStreamArray< object::FpoData > getOldFpoRecords() const
Definition: DbiStream.cpp:207
llvm::pdb::DbiBuildNo::BuildMinorShift
static const uint16_t BuildMinorShift
Definition: RawTypes.h:110
llvm::pdb::DbiStream::getSectionContributionData
BinarySubstreamRef getSectionContributionData() const
Definition: DbiStream.cpp:343
llvm::pdb::DbiStream::getDbiVersion
PdbRaw_DbiVer getDbiVersion() const
Definition: DbiStream.cpp:147
RawError.h
llvm::FixedStreamArray
FixedStreamArray is similar to VarStreamArray, except with each record having a fixed-length.
Definition: BinaryStreamArray.h:262
llvm::msf
Definition: IMSFFile.h:18
llvm::pdb::DbiStreamHeader
The fixed size header that appears at the beginning of the DBI Stream.
Definition: RawTypes.h:119
llvm::pdb::PDBStringTable::reload
Error reload(BinaryStreamReader &Reader)
Definition: PDBStringTable.cpp:84
llvm::pdb::DbiStream::getECName
Expected< StringRef > getECName(uint32_t NI) const
Definition: DbiStream.cpp:236
llvm::pdb::DbiStream::getNewFpoRecords
const codeview::DebugFrameDataSubsectionRef & getNewFpoRecords() const
Definition: DbiStream.cpp:213
llvm::pdb::DbiModuleList
Definition: DbiModuleList.h:69
llvm::PPCISD::SC
@ SC
CHAIN = SC CHAIN, Imm128 - System call.
Definition: PPCISelLowering.h:410
llvm::pdb::raw_error_code::corrupt_file
@ corrupt_file
llvm::pdb::DbiStream::getECSubstreamData
BinarySubstreamRef getECSubstreamData() const
Definition: DbiStream.cpp:363
llvm::pdb::DbiStreamHeader::PublicSymbolStreamIndex
support::ulittle16_t PublicSymbolStreamIndex
Public symbols stream #.
Definition: RawTypes.h:133
llvm::BinarySubstreamRef
Definition: BinaryStreamRef.h:200
llvm::pdb::DbiStream::getBuildNumber
uint16_t getBuildNumber() const
Definition: DbiStream.cpp:176
llvm::BinarySubstreamRef::StreamData
BinaryStreamRef StreamData
Definition: BinaryStreamRef.h:202
llvm::pdb::PdbDbiV70
@ PdbDbiV70
Definition: RawConstants.h:55
llvm::pdb::DbiStreamHeader::ECSubstreamSize
support::little32_t ECSubstreamSize
Size of EC stream (what is EC?)
Definition: RawTypes.h:166
llvm::BinaryStreamReader::readSubstream
Error readSubstream(BinarySubstreamRef &Ref, uint32_t Length)
Read Length bytes from the underlying stream into Ref.
Definition: BinaryStreamReader.cpp:142
llvm::codeview::CodeViewContainer::Pdb
@ Pdb
llvm::pdb::DbiStreamHeader::PdbDllRbld
support::ulittle16_t PdbDllRbld
rbld number of mspdbNNN.dll
Definition: RawTypes.h:142
llvm::pdb::SecMapHeader
Definition: RawTypes.h:66
llvm::pdb::DbiStream::hasNewFpoRecords
bool hasNewFpoRecords() const
Definition: DbiStream.cpp:211
llvm::pdb::DbiStreamHeader::VersionHeader
support::ulittle32_t VersionHeader
Definition: RawTypes.h:121
llvm::pdb::DbiStream::getSectionHeaders
FixedStreamArray< object::coff_section > getSectionHeaders() const
Definition: DbiStream.cpp:201
llvm::pdb::DbgHeaderType::FPO
@ FPO
PDBTypes.h
llvm::pdb::DbiStream::getFileInfoSubstreamData
BinarySubstreamRef getFileInfoSubstreamData() const
Definition: DbiStream.cpp:355
llvm::pdb
Definition: ConcreteSymbolEnumerator.h:20
llvm::BinaryStreamReader
Provides read only access to a subclass of BinaryStream.
Definition: BinaryStreamReader.h:31
llvm::pdb::DbgHeaderType::NewFPO
@ NewFPO
llvm::pdb::DbiStream::getSymRecordStreamIndex
uint32_t getSymRecordStreamIndex() const
Definition: DbiStream.cpp:192
llvm::pdb::DbiStream::getSectionMap
FixedStreamArray< SecMapEntry > getSectionMap() const
Definition: DbiStream.cpp:219
llvm::pdb::DbiStreamHeader::ModiSubstreamSize
support::little32_t ModiSubstreamSize
Size of module info stream.
Definition: RawTypes.h:145
llvm::pdb::DbiStream::isIncrementallyLinked
bool isIncrementallyLinked() const
Definition: DbiStream.cpp:164
llvm::pdb::PDBStringTable::getStringForID
Expected< StringRef > getStringForID(uint32_t ID) const
Definition: PDBStringTable.cpp:109
llvm::pdb::DbiStreamHeader::VersionSignature
support::little32_t VersionSignature
Definition: RawTypes.h:120
llvm::pdb::DbiFlags::FlagStrippedMask
static const uint16_t FlagStrippedMask
Definition: RawTypes.h:101
llvm::pdb::DbiStream::~DbiStream
~DbiStream()
llvm::pdb::DbiStreamHeader::SectionMapSize
support::little32_t SectionMapSize
Size of sec. map substream.
Definition: RawTypes.h:151
llvm::pdb::DbiStreamHeader::MachineType
support::ulittle16_t MachineType
See PDB_MachineType enum.
Definition: RawTypes.h:172
move
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
Definition: README.txt:546
BinaryStreamArray.h
llvm::pdb::DbiStream::getModiSubstreamData
BinarySubstreamRef getModiSubstreamData() const
Definition: DbiStream.cpp:351
llvm::pdb::DbiStreamHeader::SecContrSubstreamSize
support::little32_t SecContrSubstreamSize
Size of sec. contrib stream.
Definition: RawTypes.h:148
MappedBlockStream.h
llvm::pdb::DbiStream::getPdbDllRbld
uint16_t getPdbDllRbld() const
Definition: DbiStream.cpp:188
llvm::pdb::DbiStream::getBuildMajorVersion
uint16_t getBuildMajorVersion() const
Definition: DbiStream.cpp:178
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::pdb::DbiStream::hasCTypes
bool hasCTypes() const
Definition: DbiStream.cpp:168
llvm::move
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition: STLExtras.h:1605
llvm::pdb::raw_error_code::feature_unsupported
@ feature_unsupported
llvm::codeview::CompileSym2Flags::EC
@ EC
llvm::BinaryStreamReader::readObject
Error readObject(const T *&Dest)
Get a pointer to an object of type T from the underlying stream, as if by memcpy, and store the resul...
Definition: BinaryStreamReader.h:169
llvm::X86AS::FS
@ FS
Definition: X86.h:188
llvm::pdb::SecMapHeader::SecCount
support::ulittle16_t SecCount
Definition: RawTypes.h:67
llvm::pdb::DbiStreamHeader::PdbDllVersion
support::ulittle16_t PdbDllVersion
version of mspdbNNN.dll
Definition: RawTypes.h:136
DbiStream.h
llvm::pdb::DbiStream::getMachineType
PDB_Machine getMachineType() const
Definition: DbiStream.cpp:196
llvm::pdb::DbiStreamHeader::OptionalDbgHdrSize
support::little32_t OptionalDbgHdrSize
Size of DbgHeader info.
Definition: RawTypes.h:163
llvm::pdb::PdbRaw_DbiVer
PdbRaw_DbiVer
Definition: RawConstants.h:51
llvm::pdb::PDB_Machine
PDB_Machine
Definition: PDBTypes.h:125
llvm::codeview::DebugFrameDataSubsectionRef::initialize
Error initialize(BinaryStreamReader Reader)
Definition: DebugFrameDataSubsection.cpp:15
llvm::pdb::DbiBuildNo::BuildMajorShift
static const uint16_t BuildMajorShift
Definition: RawTypes.h:113
uint32_t
ISectionContribVisitor.h
llvm::pdb::DbiStream::reload
Error reload(PDBFile *Pdb)
Definition: DbiStream.cpp:52
llvm::pdb::DbiStream::getPdbDllVersion
uint32_t getPdbDllVersion() const
Definition: DbiStream.cpp:190
llvm::pdb::DbiStream::getAge
uint32_t getAge() const
Definition: DbiStream.cpp:152
std
Definition: BitVector.h:838
uint16_t
llvm::pdb::DbiStreamHeader::FileInfoSize
support::little32_t FileInfoSize
Size of file info substream.
Definition: RawTypes.h:154
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition: Error.h:157
llvm::object::coff_section
Definition: COFF.h:440
llvm::support
Definition: Endian.h:25
llvm::TargetStackID::Value
Value
Definition: TargetFrameLowering.h:27
llvm::pdb::DbiFlags::FlagHasCTypesMask
static const uint16_t FlagHasCTypesMask
Definition: RawTypes.h:102
llvm::pdb::DbgHeaderType::SectionHdr
@ SectionHdr
loadSectionContribs
static Error loadSectionContribs(FixedStreamArray< ContribType > &Output, BinaryStreamReader &Reader)
Definition: DbiStream.cpp:34
llvm::pdb::DbiStream::getGlobalSymbolStreamIndex
uint16_t getGlobalSymbolStreamIndex() const
Definition: DbiStream.cpp:158
llvm::pdb::DbiStream::getTypeServerMapSubstreamData
BinarySubstreamRef getTypeServerMapSubstreamData() const
Definition: DbiStream.cpp:359
llvm::codeview
Definition: AppendingTypeTableBuilder.h:22
llvm::Expected::takeError
Error takeError()
Take ownership of the stored error.
Definition: Error.h:589
llvm::pdb::DbiStreamHeader::Flags
support::ulittle16_t Flags
See DbiFlags enum.
Definition: RawTypes.h:169
llvm::pdb::DbiStreamHeader::Age
support::ulittle32_t Age
How "old" is this DBI Stream. Should match the age of the PDB InfoStream.
Definition: RawTypes.h:124
Machine
COFF::MachineTypes Machine
Definition: COFFYAML.cpp:366
COFF.h
llvm::pdb::PDBFile
Definition: PDBFile.h:42
PDBFile.h
llvm::pdb::DbiStream::getBuildMinorVersion
uint16_t getBuildMinorVersion() const
Definition: DbiStream.cpp:183
llvm::pdb::DbiStreamHeader::SymRecordStreamIndex
support::ulittle16_t SymRecordStreamIndex
Symbol records stream #.
Definition: RawTypes.h:139
llvm::pdb::DbgHeaderType
DbgHeaderType
Definition: RawConstants.h:86
llvm::pdb::DbiStreamHeader::GlobalSymbolStreamIndex
support::ulittle16_t GlobalSymbolStreamIndex
Global symbol stream #.
Definition: RawTypes.h:127
llvm::pdb::DbiStream::getSecMapSubstreamData
BinarySubstreamRef getSecMapSubstreamData() const
Definition: DbiStream.cpp:347
llvm::pdb::ISectionContribVisitor::visit
virtual void visit(const SectionContrib &C)=0
llvm::pdb::DbiStream::getDebugStreamIndex
uint32_t getDebugStreamIndex(DbgHeaderType Type) const
If the given stream type is present, returns its stream index.
Definition: DbiStream.cpp:378
llvm::BinarySubstreamRef::empty
bool empty() const
Definition: BinaryStreamRef.h:218
llvm::Value
LLVM Value Representation.
Definition: Value.h:75
llvm::BinaryStreamReader::readArray
Error readArray(ArrayRef< T > &Array, uint32_t NumElements)
Get a reference to a NumElements element array of objects of type T from the underlying stream as if ...
Definition: BinaryStreamReader.h:187
llvm::object::FpoData
Definition: COFF.h:1276
llvm::pdb::DbiStreamHeader::BuildNumber
support::ulittle16_t BuildNumber
See DbiBuildNo structure.
Definition: RawTypes.h:130
llvm::pdb::DbiStream::modules
const DbiModuleList & modules() const
Definition: DbiStream.cpp:217