LLVM  14.0.0git
PDBFile.cpp
Go to the documentation of this file.
1 //===- PDBFile.cpp - Low level interface to a PDB file ----------*- C++ -*-===//
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/ArrayRef.h"
11 #include "llvm/ADT/STLExtras.h"
26 #include "llvm/Support/Endian.h"
27 #include "llvm/Support/Error.h"
28 #include "llvm/Support/Path.h"
29 #include <algorithm>
30 #include <cassert>
31 #include <cstdint>
32 
33 using namespace llvm;
34 using namespace llvm::codeview;
35 using namespace llvm::msf;
36 using namespace llvm::pdb;
37 
38 namespace {
39 typedef FixedStreamArray<support::ulittle32_t> ulittle_array;
40 } // end anonymous namespace
41 
42 PDBFile::PDBFile(StringRef Path, std::unique_ptr<BinaryStream> PdbFileBuffer,
44  : FilePath(std::string(Path)), Allocator(Allocator),
45  Buffer(std::move(PdbFileBuffer)) {}
46 
47 PDBFile::~PDBFile() = default;
48 
49 StringRef PDBFile::getFilePath() const { return FilePath; }
50 
52  return sys::path::parent_path(FilePath);
53 }
54 
55 uint32_t PDBFile::getBlockSize() const { return ContainerLayout.SB->BlockSize; }
56 
58  return ContainerLayout.SB->FreeBlockMapBlock;
59 }
60 
62  return ContainerLayout.SB->NumBlocks;
63 }
64 
66  return ContainerLayout.SB->NumDirectoryBytes;
67 }
68 
70  return ContainerLayout.SB->BlockMapAddr;
71 }
72 
73 uint32_t PDBFile::getUnknown1() const { return ContainerLayout.SB->Unknown1; }
74 
76  return msf::bytesToBlocks(ContainerLayout.SB->NumDirectoryBytes,
77  ContainerLayout.SB->BlockSize);
78 }
79 
81  return (uint64_t)ContainerLayout.SB->BlockMapAddr *
82  ContainerLayout.SB->BlockSize;
83 }
84 
86  return ContainerLayout.StreamSizes.size();
87 }
88 
90  return *std::max_element(ContainerLayout.StreamSizes.begin(),
91  ContainerLayout.StreamSizes.end());
92 }
93 
95  return ContainerLayout.StreamSizes[StreamIndex];
96 }
97 
100  return ContainerLayout.StreamMap[StreamIndex];
101 }
102 
103 uint64_t PDBFile::getFileSize() const { return Buffer->getLength(); }
104 
106  uint32_t NumBytes) const {
107  uint64_t StreamBlockOffset = msf::blockToOffset(BlockIndex, getBlockSize());
108 
109  ArrayRef<uint8_t> Result;
110  if (auto EC = Buffer->readBytes(StreamBlockOffset, NumBytes, Result))
111  return std::move(EC);
112  return Result;
113 }
114 
116  ArrayRef<uint8_t> Data) const {
117  return make_error<RawError>(raw_error_code::not_writable,
118  "PDBFile is immutable");
119 }
120 
122  BinaryStreamReader Reader(*Buffer);
123 
124  // Initialize SB.
125  const msf::SuperBlock *SB = nullptr;
126  if (auto EC = Reader.readObject(SB)) {
128  return make_error<RawError>(raw_error_code::corrupt_file,
129  "MSF superblock is missing");
130  }
131 
132  if (auto EC = msf::validateSuperBlock(*SB))
133  return EC;
134 
135  if (Buffer->getLength() % SB->BlockSize != 0)
136  return make_error<RawError>(raw_error_code::corrupt_file,
137  "File size is not a multiple of block size");
138  ContainerLayout.SB = SB;
139 
140  // Initialize Free Page Map.
141  ContainerLayout.FreePageMap.resize(SB->NumBlocks);
142  // The Fpm exists either at block 1 or block 2 of the MSF. However, this
143  // allows for a maximum of getBlockSize() * 8 blocks bits in the Fpm, and
144  // thusly an equal number of total blocks in the file. For a block size
145  // of 4KiB (very common), this would yield 32KiB total blocks in file, for a
146  // maximum file size of 32KiB * 4KiB = 128MiB. Obviously this won't do, so
147  // the Fpm is split across the file at `getBlockSize()` intervals. As a
148  // result, every block whose index is of the form |{1,2} + getBlockSize() * k|
149  // for any non-negative integer k is an Fpm block. In theory, we only really
150  // need to reserve blocks of the form |{1,2} + getBlockSize() * 8 * k|, but
151  // current versions of the MSF format already expect the Fpm to be arranged
152  // at getBlockSize() intervals, so we have to be compatible.
153  // See the function fpmPn() for more information:
154  // https://github.com/Microsoft/microsoft-pdb/blob/master/PDB/msf/msf.cpp#L489
155  auto FpmStream =
156  MappedBlockStream::createFpmStream(ContainerLayout, *Buffer, Allocator);
157  BinaryStreamReader FpmReader(*FpmStream);
158  ArrayRef<uint8_t> FpmBytes;
159  if (auto EC = FpmReader.readBytes(FpmBytes, FpmReader.bytesRemaining()))
160  return EC;
161  uint32_t BlocksRemaining = getBlockCount();
162  uint32_t BI = 0;
163  for (auto Byte : FpmBytes) {
164  uint32_t BlocksThisByte = std::min(BlocksRemaining, 8U);
165  for (uint32_t I = 0; I < BlocksThisByte; ++I) {
166  if (Byte & (1 << I))
167  ContainerLayout.FreePageMap[BI] = true;
168  --BlocksRemaining;
169  ++BI;
170  }
171  }
172 
173  Reader.setOffset(getBlockMapOffset());
174  if (auto EC = Reader.readArray(ContainerLayout.DirectoryBlocks,
176  return EC;
177 
178  return Error::success();
179 }
180 
182  assert(ContainerLayout.SB);
183  if (DirectoryStream)
184  return Error::success();
185 
186  uint32_t NumStreams = 0;
187 
188  // Normally you can't use a MappedBlockStream without having fully parsed the
189  // PDB file, because it accesses the directory and various other things, which
190  // is exactly what we are attempting to parse. By specifying a custom
191  // subclass of IPDBStreamData which only accesses the fields that have already
192  // been parsed, we can avoid this and reuse MappedBlockStream.
193  auto DS = MappedBlockStream::createDirectoryStream(ContainerLayout, *Buffer,
194  Allocator);
195  BinaryStreamReader Reader(*DS);
196  if (auto EC = Reader.readInteger(NumStreams))
197  return EC;
198 
199  if (auto EC = Reader.readArray(ContainerLayout.StreamSizes, NumStreams))
200  return EC;
201  for (uint32_t I = 0; I < NumStreams; ++I) {
202  uint32_t StreamSize = getStreamByteSize(I);
203  // FIXME: What does StreamSize ~0U mean?
204  uint64_t NumExpectedStreamBlocks =
205  StreamSize == UINT32_MAX
206  ? 0
207  : msf::bytesToBlocks(StreamSize, ContainerLayout.SB->BlockSize);
208 
209  // For convenience, we store the block array contiguously. This is because
210  // if someone calls setStreamMap(), it is more convenient to be able to call
211  // it with an ArrayRef instead of setting up a StreamRef. Since the
212  // DirectoryStream is cached in the class and thus lives for the life of the
213  // class, we can be guaranteed that readArray() will return a stable
214  // reference, even if it has to allocate from its internal pool.
216  if (auto EC = Reader.readArray(Blocks, NumExpectedStreamBlocks))
217  return EC;
218  for (uint32_t Block : Blocks) {
219  uint64_t BlockEndOffset =
220  (uint64_t)(Block + 1) * ContainerLayout.SB->BlockSize;
221  if (BlockEndOffset > getFileSize())
222  return make_error<RawError>(raw_error_code::corrupt_file,
223  "Stream block map is corrupt.");
224  }
225  ContainerLayout.StreamMap.push_back(Blocks);
226  }
227 
228  // We should have read exactly SB->NumDirectoryBytes bytes.
229  assert(Reader.bytesRemaining() == 0);
230  DirectoryStream = std::move(DS);
231  return Error::success();
232 }
233 
235  return ContainerLayout.DirectoryBlocks;
236 }
237 
238 std::unique_ptr<MappedBlockStream>
240  if (SN == kInvalidStreamIndex)
241  return nullptr;
242  return MappedBlockStream::createIndexedStream(ContainerLayout, *Buffer, SN,
243  Allocator);
244 }
245 
247  MSFStreamLayout Result;
248  auto Blocks = getStreamBlockList(StreamIdx);
249  Result.Blocks.assign(Blocks.begin(), Blocks.end());
250  Result.Length = getStreamByteSize(StreamIdx);
251  return Result;
252 }
253 
255  return msf::getFpmStreamLayout(ContainerLayout);
256 }
257 
259  if (!Globals) {
260  auto DbiS = getPDBDbiStream();
261  if (!DbiS)
262  return DbiS.takeError();
263 
264  auto GlobalS =
265  safelyCreateIndexedStream(DbiS->getGlobalSymbolStreamIndex());
266  if (!GlobalS)
267  return GlobalS.takeError();
268  auto TempGlobals = std::make_unique<GlobalsStream>(std::move(*GlobalS));
269  if (auto EC = TempGlobals->reload())
270  return std::move(EC);
271  Globals = std::move(TempGlobals);
272  }
273  return *Globals;
274 }
275 
277  if (!Info) {
278  auto InfoS = safelyCreateIndexedStream(StreamPDB);
279  if (!InfoS)
280  return InfoS.takeError();
281  auto TempInfo = std::make_unique<InfoStream>(std::move(*InfoS));
282  if (auto EC = TempInfo->reload())
283  return std::move(EC);
284  Info = std::move(TempInfo);
285  }
286  return *Info;
287 }
288 
290  if (!Dbi) {
292  if (!DbiS)
293  return DbiS.takeError();
294  auto TempDbi = std::make_unique<DbiStream>(std::move(*DbiS));
295  if (auto EC = TempDbi->reload(this))
296  return std::move(EC);
297  Dbi = std::move(TempDbi);
298  }
299  return *Dbi;
300 }
301 
303  if (!Tpi) {
305  if (!TpiS)
306  return TpiS.takeError();
307  auto TempTpi = std::make_unique<TpiStream>(*this, std::move(*TpiS));
308  if (auto EC = TempTpi->reload())
309  return std::move(EC);
310  Tpi = std::move(TempTpi);
311  }
312  return *Tpi;
313 }
314 
316  if (!Ipi) {
317  if (!hasPDBIpiStream())
318  return make_error<RawError>(raw_error_code::no_stream);
319 
321  if (!IpiS)
322  return IpiS.takeError();
323  auto TempIpi = std::make_unique<TpiStream>(*this, std::move(*IpiS));
324  if (auto EC = TempIpi->reload())
325  return std::move(EC);
326  Ipi = std::move(TempIpi);
327  }
328  return *Ipi;
329 }
330 
332  if (!Publics) {
333  auto DbiS = getPDBDbiStream();
334  if (!DbiS)
335  return DbiS.takeError();
336 
337  auto PublicS =
338  safelyCreateIndexedStream(DbiS->getPublicSymbolStreamIndex());
339  if (!PublicS)
340  return PublicS.takeError();
341  auto TempPublics = std::make_unique<PublicsStream>(std::move(*PublicS));
342  if (auto EC = TempPublics->reload())
343  return std::move(EC);
344  Publics = std::move(TempPublics);
345  }
346  return *Publics;
347 }
348 
350  if (!Symbols) {
351  auto DbiS = getPDBDbiStream();
352  if (!DbiS)
353  return DbiS.takeError();
354 
355  uint32_t SymbolStreamNum = DbiS->getSymRecordStreamIndex();
356  auto SymbolS = safelyCreateIndexedStream(SymbolStreamNum);
357  if (!SymbolS)
358  return SymbolS.takeError();
359 
360  auto TempSymbols = std::make_unique<SymbolStream>(std::move(*SymbolS));
361  if (auto EC = TempSymbols->reload())
362  return std::move(EC);
363  Symbols = std::move(TempSymbols);
364  }
365  return *Symbols;
366 }
367 
369  if (!Strings) {
370  auto NS = safelyCreateNamedStream("/names");
371  if (!NS)
372  return NS.takeError();
373 
374  auto N = std::make_unique<PDBStringTable>();
375  BinaryStreamReader Reader(**NS);
376  if (auto EC = N->reload(Reader))
377  return std::move(EC);
378  assert(Reader.bytesRemaining() == 0);
379  StringTableStream = std::move(*NS);
380  Strings = std::move(N);
381  }
382  return *Strings;
383 }
384 
386  if (!InjectedSources) {
387  auto IJS = safelyCreateNamedStream("/src/headerblock");
388  if (!IJS)
389  return IJS.takeError();
390 
391  auto Strings = getStringTable();
392  if (!Strings)
393  return Strings.takeError();
394 
395  auto IJ = std::make_unique<InjectedSourceStream>(std::move(*IJS));
396  if (auto EC = IJ->reload(*Strings))
397  return std::move(EC);
398  InjectedSources = std::move(IJ);
399  }
400  return *InjectedSources;
401 }
402 
404  auto DbiS = getPDBDbiStream();
405  if (!DbiS)
406  return 0;
407  PDB_Machine Machine = DbiS->getMachineType();
409  return 8;
410  return 4;
411 }
412 
415 }
416 
418  auto DbiS = getPDBDbiStream();
419  if (!DbiS) {
420  consumeError(DbiS.takeError());
421  return false;
422  }
423 
424  return DbiS->getGlobalSymbolStreamIndex() < getNumStreams();
425 }
426 
428 
430  if (!hasPDBInfoStream())
431  return false;
432 
433  if (StreamIPI >= getNumStreams())
434  return false;
435 
436  auto &InfoStream = cantFail(const_cast<PDBFile *>(this)->getPDBInfoStream());
437  return InfoStream.containsIdStream();
438 }
439 
441  auto DbiS = getPDBDbiStream();
442  if (!DbiS) {
443  consumeError(DbiS.takeError());
444  return false;
445  }
446  return DbiS->getPublicSymbolStreamIndex() < getNumStreams();
447 }
448 
450  auto DbiS = getPDBDbiStream();
451  if (!DbiS)
452  return false;
453  return DbiS->getSymRecordStreamIndex() < getNumStreams();
454 }
455 
457 
459  auto IS = getPDBInfoStream();
460  if (!IS)
461  return false;
462  Expected<uint32_t> ExpectedNSI = IS->getNamedStreamIndex("/names");
463  if (!ExpectedNSI) {
464  consumeError(ExpectedNSI.takeError());
465  return false;
466  }
467  assert(*ExpectedNSI < getNumStreams());
468  return true;
469 }
470 
472  auto IS = getPDBInfoStream();
473  if (!IS)
474  return false;
475  Expected<uint32_t> ExpectedNSI = IS->getNamedStreamIndex("/src/headerblock");
476  if (!ExpectedNSI) {
477  consumeError(ExpectedNSI.takeError());
478  return false;
479  }
480  assert(*ExpectedNSI < getNumStreams());
481  return true;
482 }
483 
484 /// Wrapper around MappedBlockStream::createIndexedStream() that checks if a
485 /// stream with that index actually exists. If it does not, the return value
486 /// will have an MSFError with code msf_error_code::no_stream. Else, the return
487 /// value will contain the stream returned by createIndexedStream().
490  if (StreamIndex >= getNumStreams())
491  // This rejects kInvalidStreamIndex with an error as well.
492  return make_error<RawError>(raw_error_code::no_stream);
493  return createIndexedStream(StreamIndex);
494 }
495 
498  auto IS = getPDBInfoStream();
499  if (!IS)
500  return IS.takeError();
501 
502  Expected<uint32_t> ExpectedNSI = IS->getNamedStreamIndex(Name);
503  if (!ExpectedNSI)
504  return ExpectedNSI.takeError();
505  uint32_t NameStreamIndex = *ExpectedNSI;
506 
507  return safelyCreateIndexedStream(NameStreamIndex);
508 }
llvm::codeview::SimpleTypeKind::Byte
@ Byte
llvm::pdb::raw_error_code::no_stream
@ no_stream
BinaryStreamReader.h
llvm::pdb::PDBFile::hasPDBIpiStream
bool hasPDBIpiStream() const
Definition: PDBFile.cpp:429
llvm::BinaryStreamReader::setOffset
void setOffset(uint64_t Off)
Definition: BinaryStreamReader.h:254
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:23
PublicsStream.h
llvm::msf::MSFLayout::DirectoryBlocks
ArrayRef< support::ulittle32_t > DirectoryBlocks
Definition: MSFCommon.h:66
llvm::msf::bytesToBlocks
uint64_t bytesToBlocks(uint64_t NumBytes, uint64_t BlockSize)
Definition: MSFCommon.h:131
TpiStream.h
llvm::BinaryStreamReader::readBytes
Error readBytes(ArrayRef< uint8_t > &Buffer, uint32_t Size)
Read Size bytes from the underlying stream at the current offset and and set Buffer to the resulting ...
Definition: BinaryStreamReader.cpp:37
BinaryStream.h
llvm::pdb::PDBFile::getFreeBlockMapBlock
uint32_t getFreeBlockMapBlock() const
Definition: PDBFile.cpp:57
llvm::pdb::PDBFile::getNumDirectoryBytes
uint32_t getNumDirectoryBytes() const
Definition: PDBFile.cpp:65
llvm::pdb::PDBFile::~PDBFile
~PDBFile() override
Path.h
llvm::pdb::PDBFile::getFilePath
StringRef getFilePath() const
Definition: PDBFile.cpp:49
llvm::pdb::StreamDBI
@ StreamDBI
Definition: RawConstants.h:80
llvm::Error::success
static ErrorSuccess success()
Create a success value.
Definition: Error.h:331
llvm::msf::SuperBlock::NumDirectoryBytes
support::ulittle32_t NumDirectoryBytes
Definition: MSFCommon.h:44
llvm::pdb::PDBFile::getBlockMapIndex
uint32_t getBlockMapIndex() const
Definition: PDBFile.cpp:69
llvm::msf::blockToOffset
uint64_t blockToOffset(uint64_t BlockNumber, uint64_t BlockSize)
Definition: MSFCommon.h:135
llvm::pdb::kInvalidStreamIndex
const uint16_t kInvalidStreamIndex
Definition: RawConstants.h:19
Error.h
llvm::msf::MSFLayout::FreePageMap
BitVector FreePageMap
Definition: MSFCommon.h:65
llvm::pdb::PDBFile::hasPDBSymbolStream
bool hasPDBSymbolStream()
Definition: PDBFile.cpp:449
llvm::BitVector::resize
void resize(unsigned N, bool t=false)
resize - Grow or shrink the bitvector.
Definition: BitVector.h:333
llvm::pdb::PDBFile::hasPDBGlobalsStream
bool hasPDBGlobalsStream()
Definition: PDBFile.cpp:417
llvm::BinaryStreamReader::bytesRemaining
uint64_t bytesRemaining() const
Definition: BinaryStreamReader.h:257
Offset
uint64_t Offset
Definition: ELFObjHandler.cpp:81
llvm::pdb::PDBFile::getStreamByteSize
uint32_t getStreamByteSize(uint32_t StreamIndex) const override
Definition: PDBFile.cpp:94
llvm::Expected
Tagged union holding either a T or a Error.
Definition: APFloat.h:42
STLExtras.h
llvm::pdb::PDBFile::getPDBSymbolStream
Expected< SymbolStream & > getPDBSymbolStream()
Definition: PDBFile.cpp:349
llvm::msf::getFpmStreamLayout
MSFStreamLayout getFpmStreamLayout(const MSFLayout &Msf, bool IncludeUnusedFpmData=false, bool AltFpm=false)
Determine the layout of the FPM stream, given the MSF layout.
Definition: MSFCommon.cpp:62
RawError.h
llvm::FixedStreamArray< support::ulittle32_t >
llvm::consumeError
void consumeError(Error Err)
Consume a Error without doing anything.
Definition: Error.h:1045
llvm::msf
Definition: IMSFFile.h:18
llvm::pdb::PDBFile::getBlockCount
uint32_t getBlockCount() const override
Definition: PDBFile.cpp:61
llvm::pdb::PDBFile::getFileDirectory
StringRef getFileDirectory() const
Definition: PDBFile.cpp:51
llvm::pdb::PDBFile::getPDBIpiStream
Expected< TpiStream & > getPDBIpiStream()
Definition: PDBFile.cpp:315
llvm::pdb::StreamTPI
@ StreamTPI
Definition: RawConstants.h:79
GlobalsStream.h
llvm::pdb::PDBFile::getDirectoryBlockArray
ArrayRef< support::ulittle32_t > getDirectoryBlockArray() const
Definition: PDBFile.cpp:234
llvm::pdb::PDBFile::hasPDBTpiStream
bool hasPDBTpiStream() const
Definition: PDBFile.cpp:456
llvm::pdb::raw_error_code::corrupt_file
@ corrupt_file
llvm::pdb::PDBFile::getStreamLayout
msf::MSFStreamLayout getStreamLayout(uint32_t StreamIdx) const
Definition: PDBFile.cpp:246
llvm::msf::validateSuperBlock
Error validateSuperBlock(const SuperBlock &SB)
Definition: MSFCommon.cpp:19
llvm::pdb::PDBFile::hasPDBStringTable
bool hasPDBStringTable()
Definition: PDBFile.cpp:458
llvm::pdb::PDBFile::safelyCreateIndexedStream
Expected< std::unique_ptr< msf::MappedBlockStream > > safelyCreateIndexedStream(uint32_t StreamIndex) const
Wrapper around MappedBlockStream::createIndexedStream() that checks if a stream with that index actua...
Definition: PDBFile.cpp:489
llvm::pdb::PDBFile::getPDBDbiStream
Expected< DbiStream & > getPDBDbiStream()
Definition: PDBFile.cpp:289
llvm::BinaryStreamReader::readInteger
Error readInteger(T &Dest)
Read an integer of the specified endianness into Dest and update the stream's offset.
Definition: BinaryStreamReader.h:75
llvm::msf::SuperBlock
Definition: MSFCommon.h:31
llvm::pdb
Definition: ConcreteSymbolEnumerator.h:20
llvm::msf::SuperBlock::NumBlocks
support::ulittle32_t NumBlocks
Definition: MSFCommon.h:42
llvm::BinaryStreamReader
Provides read only access to a subclass of BinaryStream.
Definition: BinaryStreamReader.h:31
llvm::msf::MSFLayout::StreamSizes
ArrayRef< support::ulittle32_t > StreamSizes
Definition: MSFCommon.h:67
llvm::pdb::PDBFile::getNumStreams
uint32_t getNumStreams() const override
Definition: PDBFile.cpp:85
llvm::pdb::PDBFile::safelyCreateNamedStream
Expected< std::unique_ptr< msf::MappedBlockStream > > safelyCreateNamedStream(StringRef Name)
Definition: PDBFile.cpp:497
uint64_t
llvm::pdb::PDBFile::getFpmStreamLayout
msf::MSFStreamLayout getFpmStreamLayout() const
Definition: PDBFile.cpp:254
llvm::BumpPtrAllocatorImpl
Allocate memory in an ever growing pool, as if by bump-pointer.
Definition: Allocator.h:67
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
I
#define I(x, y, z)
Definition: MD5.cpp:59
llvm::msf::SuperBlock::FreeBlockMapBlock
support::ulittle32_t FreeBlockMapBlock
Definition: MSFCommon.h:38
ArrayRef.h
BinaryStreamArray.h
llvm::pdb::PDBFile::getFileSize
uint64_t getFileSize() const
Definition: PDBFile.cpp:103
MappedBlockStream.h
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::sys::path::parent_path
StringRef parent_path(StringRef path, Style style=Style::native)
Get parent path.
Definition: Path.cpp:467
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:1658
llvm::pdb::PDBFile::getBlockSize
uint32_t getBlockSize() const override
Definition: PDBFile.cpp:55
llvm::codeview::CompileSym2Flags::EC
@ EC
llvm::pdb::InfoStream
Definition: InfoStream.h:28
llvm::pdb::PDBFile::setBlockData
Error setBlockData(uint32_t BlockIndex, uint32_t Offset, ArrayRef< uint8_t > Data) const override
Definition: PDBFile.cpp:115
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::pdb::PDBFile::getInjectedSourceStream
Expected< InjectedSourceStream & > getInjectedSourceStream()
Definition: PDBFile.cpp:385
llvm::pdb::PDBFile::getPDBInfoStream
Expected< InfoStream & > getPDBInfoStream()
Definition: PDBFile.cpp:276
DbiStream.h
llvm::pdb::PDBFile::hasPDBDbiStream
bool hasPDBDbiStream() const
Definition: PDBFile.cpp:413
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: APInt.h:32
llvm::pdb::PDB_Machine::Amd64
@ Amd64
llvm::min
Expected< ExpressionValue > min(const ExpressionValue &Lhs, const ExpressionValue &Rhs)
Definition: FileCheck.cpp:357
llvm::pdb::InfoStream::containsIdStream
bool containsIdStream() const
Definition: InfoStream.cpp:99
llvm::pdb::PDB_Machine
PDB_Machine
Definition: PDBTypes.h:125
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:57
llvm::pdb::PDBFile::hasPDBInjectedSourceStream
bool hasPDBInjectedSourceStream()
Definition: PDBFile.cpp:471
llvm::pdb::PDBFile::getStringTable
Expected< PDBStringTable & > getStringTable()
Definition: PDBFile.cpp:368
InjectedSourceStream.h
llvm::cantFail
void cantFail(Error Err, const char *Msg=nullptr)
Report a fatal error if Err is a failure value.
Definition: Error.h:747
uint32_t
llvm::pdb::PDBFile::parseStreamData
Error parseStreamData()
Definition: PDBFile.cpp:181
llvm::pdb::PDBFile::getUnknown1
uint32_t getUnknown1() const
Definition: PDBFile.cpp:73
MSFCommon.h
llvm::pdb::PDBFile::getStreamBlockList
ArrayRef< support::ulittle32_t > getStreamBlockList(uint32_t StreamIndex) const override
Definition: PDBFile.cpp:99
llvm::pdb::PDBFile::getPDBTpiStream
Expected< TpiStream & > getPDBTpiStream()
Definition: PDBFile.cpp:302
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:52
std
Definition: BitVector.h:838
llvm::msf::SuperBlock::BlockSize
support::ulittle32_t BlockSize
Definition: MSFCommon.h:36
llvm::pdb::raw_error_code::not_writable
@ not_writable
uint16_t
llvm::msf::SuperBlock::Unknown1
support::ulittle32_t Unknown1
Definition: MSFCommon.h:46
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition: Error.h:157
llvm::msf::MSFLayout::StreamMap
std::vector< ArrayRef< support::ulittle32_t > > StreamMap
Definition: MSFCommon.h:68
llvm::pdb::PDBFile::getBlockData
Expected< ArrayRef< uint8_t > > getBlockData(uint32_t BlockIndex, uint32_t NumBytes) const override
Definition: PDBFile.cpp:105
llvm::pdb::PDBFile::getMaxStreamSize
uint32_t getMaxStreamSize() const
Definition: PDBFile.cpp:89
llvm::pdb::PDBFile::parseFileHeaders
Error parseFileHeaders()
Definition: PDBFile.cpp:121
llvm::codeview
Definition: AppendingTypeTableBuilder.h:22
PDBStringTable.h
llvm::Expected::takeError
Error takeError()
Take ownership of the stored error.
Definition: Error.h:599
llvm::pdb::PDBFile::hasPDBPublicsStream
bool hasPDBPublicsStream()
Definition: PDBFile.cpp:440
Machine
COFF::MachineTypes Machine
Definition: COFFYAML.cpp:366
llvm::pdb::PDBFile::getPDBPublicsStream
Expected< PublicsStream & > getPDBPublicsStream()
Definition: PDBFile.cpp:331
InfoStream.h
llvm::pdb::PDBFile
Definition: PDBFile.h:42
PDBFile.h
llvm::pdb::PDBFile::getPointerSize
uint32_t getPointerSize()
Definition: PDBFile.cpp:403
Allocator
Basic Register Allocator
Definition: RegAllocBasic.cpp:146
N
#define N
llvm::pdb::StreamPDB
@ StreamPDB
Definition: RawConstants.h:78
llvm::pdb::PDBFile::hasPDBInfoStream
bool hasPDBInfoStream() const
Definition: PDBFile.cpp:427
llvm::msf::MSFLayout::SB
const SuperBlock * SB
Definition: MSFCommon.h:64
SymbolStream.h
llvm::pdb::PDBFile::createIndexedStream
std::unique_ptr< msf::MappedBlockStream > createIndexedStream(uint16_t SN) const
Definition: PDBFile.cpp:239
llvm::pdb::PDBFile::getNumDirectoryBlocks
uint32_t getNumDirectoryBlocks() const
Definition: PDBFile.cpp:75
Endian.h
llvm::pdb::PDB_SymType::Block
@ Block
llvm::msf::SuperBlock::BlockMapAddr
support::ulittle32_t BlockMapAddr
Definition: MSFCommon.h:48
llvm::pdb::PDBFile::getPDBGlobalsStream
Expected< GlobalsStream & > getPDBGlobalsStream()
Definition: PDBFile.cpp:258
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
SpecialSubKind::string
@ string
llvm::pdb::PDBFile::getBlockMapOffset
uint64_t getBlockMapOffset() const
Definition: PDBFile.cpp:80
llvm::SIInstrFlags::DS
@ DS
Definition: SIDefines.h:60
llvm::msf::MSFStreamLayout
Describes the layout of a stream in an MSF layout.
Definition: MSFCommon.h:77
llvm::pdb::StreamIPI
@ StreamIPI
Definition: RawConstants.h:81