LLVM 20.0.0git
|
#include "llvm/DebugInfo/PDB/Native/PDBFile.h"
PDBFile::PDBFile | ( | StringRef | Path, |
std::unique_ptr< BinaryStream > | PdbFileBuffer, | ||
BumpPtrAllocator & | Allocator | ||
) |
Definition at line 41 of file PDBFile.cpp.
|
overridedefault |
std::unique_ptr< MappedBlockStream > PDBFile::createIndexedStream | ( | uint16_t | SN | ) | const |
Definition at line 237 of file PDBFile.cpp.
References llvm::msf::MappedBlockStream::createIndexedStream(), and llvm::pdb::kInvalidStreamIndex.
Referenced by safelyCreateIndexedStream().
|
inline |
|
overridevirtual |
Implements llvm::msf::IMSFFile.
Definition at line 60 of file PDBFile.cpp.
References llvm::msf::SuperBlock::NumBlocks, and llvm::msf::MSFLayout::SB.
Referenced by parseFileHeaders().
|
overridevirtual |
Implements llvm::msf::IMSFFile.
Definition at line 103 of file PDBFile.cpp.
References llvm::msf::blockToOffset(), llvm::codeview::EC, and getBlockSize().
uint32_t PDBFile::getBlockMapIndex | ( | ) | const |
Definition at line 68 of file PDBFile.cpp.
References llvm::msf::SuperBlock::BlockMapAddr, and llvm::msf::MSFLayout::SB.
uint64_t PDBFile::getBlockMapOffset | ( | ) | const |
Definition at line 79 of file PDBFile.cpp.
References llvm::msf::SuperBlock::BlockMapAddr, llvm::msf::SuperBlock::BlockSize, and llvm::msf::MSFLayout::SB.
Referenced by parseFileHeaders().
|
overridevirtual |
Implements llvm::msf::IMSFFile.
Definition at line 54 of file PDBFile.cpp.
References llvm::msf::SuperBlock::BlockSize, and llvm::msf::MSFLayout::SB.
Referenced by getBlockData().
ArrayRef< support::ulittle32_t > PDBFile::getDirectoryBlockArray | ( | ) | const |
Definition at line 232 of file PDBFile.cpp.
References llvm::msf::MSFLayout::DirectoryBlocks.
StringRef PDBFile::getFileDirectory | ( | ) | const |
Definition at line 50 of file PDBFile.cpp.
References llvm::sys::path::parent_path().
StringRef PDBFile::getFilePath | ( | ) | const |
Definition at line 48 of file PDBFile.cpp.
Referenced by llvm::pdb::InputFile::getFilePath(), and llvm::pdb::NativeExeSymbol::getSymbolsFileName().
uint64_t PDBFile::getFileSize | ( | ) | const |
Definition at line 101 of file PDBFile.cpp.
Referenced by parseStreamData().
msf::MSFStreamLayout PDBFile::getFpmStreamLayout | ( | ) | const |
Definition at line 252 of file PDBFile.cpp.
References llvm::msf::getFpmStreamLayout().
uint32_t PDBFile::getFreeBlockMapBlock | ( | ) | const |
Definition at line 56 of file PDBFile.cpp.
References llvm::msf::SuperBlock::FreeBlockMapBlock, and llvm::msf::MSFLayout::SB.
Expected< InjectedSourceStream & > PDBFile::getInjectedSourceStream | ( | ) |
Definition at line 383 of file PDBFile.cpp.
References llvm::codeview::EC, getStringTable(), and safelyCreateNamedStream().
uint32_t PDBFile::getMaxStreamSize | ( | ) | const |
Definition at line 88 of file PDBFile.cpp.
References llvm::max_element(), and llvm::msf::MSFLayout::StreamSizes.
|
inline |
|
inline |
uint32_t PDBFile::getNumDirectoryBlocks | ( | ) | const |
Definition at line 74 of file PDBFile.cpp.
References llvm::msf::SuperBlock::BlockSize, llvm::msf::bytesToBlocks(), llvm::msf::SuperBlock::NumDirectoryBytes, and llvm::msf::MSFLayout::SB.
Referenced by parseFileHeaders().
uint32_t PDBFile::getNumDirectoryBytes | ( | ) | const |
Definition at line 64 of file PDBFile.cpp.
References llvm::msf::SuperBlock::NumDirectoryBytes, and llvm::msf::MSFLayout::SB.
|
overridevirtual |
Implements llvm::msf::IMSFFile.
Definition at line 84 of file PDBFile.cpp.
References llvm::msf::MSFLayout::StreamSizes.
Referenced by hasPDBDbiStream(), hasPDBGlobalsStream(), hasPDBInfoStream(), hasPDBInjectedSourceStream(), hasPDBIpiStream(), hasPDBPublicsStream(), hasPDBStringTable(), hasPDBSymbolStream(), hasPDBTpiStream(), and safelyCreateIndexedStream().
Definition at line 287 of file PDBFile.cpp.
References llvm::codeview::EC, safelyCreateIndexedStream(), and llvm::pdb::StreamDBI.
Referenced by getDbiStreamPtr(), getPDBGlobalsStream(), getPDBPublicsStream(), getPDBSymbolStream(), getPointerSize(), llvm::pdb::NativeExeSymbol::hasCTypes(), hasPDBGlobalsStream(), hasPDBPublicsStream(), hasPDBSymbolStream(), and llvm::pdb::NativeExeSymbol::hasPrivateSymbols().
Expected< GlobalsStream & > PDBFile::getPDBGlobalsStream | ( | ) |
Definition at line 256 of file PDBFile.cpp.
References llvm::codeview::EC, getPDBDbiStream(), and safelyCreateIndexedStream().
Referenced by llvm::pdb::NativeEnumGlobals::NativeEnumGlobals().
Expected< InfoStream & > PDBFile::getPDBInfoStream | ( | ) |
Definition at line 274 of file PDBFile.cpp.
References llvm::codeview::EC, safelyCreateIndexedStream(), and llvm::pdb::StreamPDB.
Referenced by llvm::pdb::NativeExeSymbol::getAge(), llvm::pdb::NativeExeSymbol::getGuid(), hasPDBInjectedSourceStream(), hasPDBIpiStream(), hasPDBStringTable(), and safelyCreateNamedStream().
Definition at line 313 of file PDBFile.cpp.
References llvm::codeview::EC, hasPDBIpiStream(), llvm::pdb::no_stream, safelyCreateIndexedStream(), and llvm::pdb::StreamIPI.
Referenced by llvm::pdb::NativeInlineSiteSymbol::getName().
Expected< PublicsStream & > PDBFile::getPDBPublicsStream | ( | ) |
Definition at line 329 of file PDBFile.cpp.
References llvm::codeview::EC, getPDBDbiStream(), and safelyCreateIndexedStream().
Expected< SymbolStream & > PDBFile::getPDBSymbolStream | ( | ) |
Definition at line 347 of file PDBFile.cpp.
References llvm::codeview::EC, getPDBDbiStream(), and safelyCreateIndexedStream().
Referenced by llvm::pdb::SymbolCache::getOrCreateGlobalSymbolByOffset(), and llvm::pdb::NativeEnumGlobals::NativeEnumGlobals().
Definition at line 300 of file PDBFile.cpp.
References llvm::codeview::EC, safelyCreateIndexedStream(), and llvm::pdb::StreamTPI.
Referenced by llvm::pdb::SymbolCache::createTypeEnumerator(), llvm::pdb::SymbolCache::findSymbolByTypeIndex(), and llvm::pdb::NativeInlineSiteSymbol::getName().
uint32_t PDBFile::getPointerSize | ( | ) |
Definition at line 401 of file PDBFile.cpp.
References llvm::pdb::Amd64, getPDBDbiStream(), and Machine.
|
overridevirtual |
Implements llvm::msf::IMSFFile.
Definition at line 97 of file PDBFile.cpp.
References llvm::msf::MSFLayout::StreamMap.
Referenced by getStreamLayout().
Implements llvm::msf::IMSFFile.
Definition at line 92 of file PDBFile.cpp.
References llvm::msf::MSFLayout::StreamSizes.
Referenced by getStreamLayout(), hasPDBDbiStream(), and parseStreamData().
MSFStreamLayout PDBFile::getStreamLayout | ( | uint32_t | StreamIdx | ) | const |
Definition at line 244 of file PDBFile.cpp.
References Blocks, getStreamBlockList(), and getStreamByteSize().
|
inline |
Definition at line 76 of file PDBFile.h.
References llvm::msf::MSFLayout::StreamMap.
|
inline |
Definition at line 73 of file PDBFile.h.
References llvm::msf::MSFLayout::StreamSizes.
Expected< PDBStringTable & > PDBFile::getStringTable | ( | ) |
Definition at line 366 of file PDBFile.cpp.
References assert(), llvm::BinaryStreamReader::bytesRemaining(), llvm::codeview::EC, N, and safelyCreateNamedStream().
Referenced by llvm::pdb::NativeSourceFile::getFileName(), and getInjectedSourceStream().
uint32_t PDBFile::getUnknown1 | ( | ) | const |
Definition at line 72 of file PDBFile.cpp.
References llvm::msf::MSFLayout::SB, and llvm::msf::SuperBlock::Unknown1.
bool PDBFile::hasPDBDbiStream | ( | ) | const |
Definition at line 411 of file PDBFile.cpp.
References getNumStreams(), getStreamByteSize(), and llvm::pdb::StreamDBI.
bool PDBFile::hasPDBGlobalsStream | ( | ) |
Definition at line 415 of file PDBFile.cpp.
References llvm::consumeError(), getNumStreams(), and getPDBDbiStream().
bool PDBFile::hasPDBInfoStream | ( | ) | const |
Definition at line 425 of file PDBFile.cpp.
References getNumStreams(), and llvm::pdb::StreamPDB.
Referenced by hasPDBIpiStream().
bool PDBFile::hasPDBInjectedSourceStream | ( | ) |
Definition at line 469 of file PDBFile.cpp.
References assert(), llvm::consumeError(), getNumStreams(), getPDBInfoStream(), and llvm::Expected< T >::takeError().
bool PDBFile::hasPDBIpiStream | ( | ) | const |
Definition at line 427 of file PDBFile.cpp.
References llvm::cantFail(), llvm::pdb::InfoStream::containsIdStream(), getNumStreams(), getPDBInfoStream(), hasPDBInfoStream(), and llvm::pdb::StreamIPI.
Referenced by getPDBIpiStream(), and llvm::pdb::InputFile::hasIds().
bool PDBFile::hasPDBPublicsStream | ( | ) |
Definition at line 438 of file PDBFile.cpp.
References llvm::consumeError(), getNumStreams(), and getPDBDbiStream().
bool PDBFile::hasPDBStringTable | ( | ) |
Definition at line 456 of file PDBFile.cpp.
References assert(), llvm::consumeError(), getNumStreams(), getPDBInfoStream(), and llvm::Expected< T >::takeError().
bool PDBFile::hasPDBSymbolStream | ( | ) |
Definition at line 447 of file PDBFile.cpp.
References getNumStreams(), and getPDBDbiStream().
bool PDBFile::hasPDBTpiStream | ( | ) | const |
Definition at line 454 of file PDBFile.cpp.
References getNumStreams(), and llvm::pdb::StreamTPI.
Referenced by llvm::pdb::InputFile::hasTypes().
Error PDBFile::parseFileHeaders | ( | ) |
Definition at line 119 of file PDBFile.cpp.
References llvm::msf::SuperBlock::BlockSize, llvm::codeview::Byte, llvm::BinaryStreamReader::bytesRemaining(), llvm::consumeError(), llvm::pdb::corrupt_file, llvm::msf::MappedBlockStream::createFpmStream(), llvm::msf::MSFLayout::DirectoryBlocks, llvm::codeview::EC, llvm::msf::MSFLayout::FreePageMap, getBlockCount(), getBlockMapOffset(), getNumDirectoryBlocks(), I, llvm::msf::SuperBlock::NumBlocks, llvm::BinaryStreamReader::readArray(), llvm::BinaryStreamReader::readBytes(), llvm::BinaryStreamReader::readObject(), llvm::BitVector::resize(), llvm::msf::MSFLayout::SB, llvm::BinaryStreamReader::setOffset(), llvm::Error::success(), and llvm::msf::validateSuperBlock().
Error PDBFile::parseStreamData | ( | ) |
Definition at line 179 of file PDBFile.cpp.
References assert(), llvm::pdb::Block, Blocks, llvm::msf::SuperBlock::BlockSize, llvm::BinaryStreamReader::bytesRemaining(), llvm::msf::bytesToBlocks(), llvm::pdb::corrupt_file, llvm::msf::MappedBlockStream::createDirectoryStream(), llvm::codeview::EC, getFileSize(), getStreamByteSize(), I, llvm::BinaryStreamReader::readArray(), llvm::BinaryStreamReader::readInteger(), llvm::msf::MSFLayout::SB, llvm::msf::MSFLayout::StreamMap, llvm::msf::MSFLayout::StreamSizes, and llvm::Error::success().
Expected< std::unique_ptr< MappedBlockStream > > PDBFile::safelyCreateIndexedStream | ( | uint32_t | StreamIndex | ) | const |
Wrapper around MappedBlockStream::createIndexedStream() that checks if a stream with that index actually exists.
If it does not, the return value will have an MSFError with code msf_error_code::no_stream. Else, the return value will contain the stream returned by createIndexedStream().
Definition at line 487 of file PDBFile.cpp.
References createIndexedStream(), getNumStreams(), and llvm::pdb::no_stream.
Referenced by getPDBDbiStream(), getPDBGlobalsStream(), getPDBInfoStream(), getPDBIpiStream(), getPDBPublicsStream(), getPDBSymbolStream(), getPDBTpiStream(), llvm::pdb::TpiStream::reload(), and safelyCreateNamedStream().
Expected< std::unique_ptr< MappedBlockStream > > PDBFile::safelyCreateNamedStream | ( | StringRef | Name | ) |
Definition at line 495 of file PDBFile.cpp.
References getPDBInfoStream(), Name, safelyCreateIndexedStream(), and llvm::Expected< T >::takeError().
Referenced by getInjectedSourceStream(), and getStringTable().
|
overridevirtual |
Implements llvm::msf::IMSFFile.
Definition at line 113 of file PDBFile.cpp.
References llvm::pdb::not_writable.