LLVM 22.0.0git
llvm::pdb::PDBFile Class Reference

#include "llvm/DebugInfo/PDB/Native/PDBFile.h"

Inheritance diagram for llvm::pdb::PDBFile:
[legend]

Public Member Functions

 PDBFile (StringRef Path, std::unique_ptr< BinaryStream > PdbFileBuffer, BumpPtrAllocator &Allocator)
 ~PDBFile () override
StringRef getFileDirectory () const
StringRef getFilePath () const
uint32_t getFreeBlockMapBlock () const
uint32_t getUnknown1 () const
uint32_t getBlockSize () const override
uint32_t getBlockCount () const override
uint32_t getNumDirectoryBytes () const
uint32_t getBlockMapIndex () const
uint32_t getNumDirectoryBlocks () const
uint64_t getBlockMapOffset () const
uint32_t getNumStreams () const override
uint32_t getMaxStreamSize () const
uint32_t getStreamByteSize (uint32_t StreamIndex) const override
ArrayRef< support::ulittle32_tgetStreamBlockList (uint32_t StreamIndex) const override
uint64_t getFileSize () const
Expected< ArrayRef< uint8_t > > getBlockData (uint32_t BlockIndex, uint32_t NumBytes) const override
Error setBlockData (uint32_t BlockIndex, uint32_t Offset, ArrayRef< uint8_t > Data) const override
ArrayRef< support::ulittle32_tgetStreamSizes () const
ArrayRef< ArrayRef< support::ulittle32_t > > getStreamMap () const
const msf::MSFLayoutgetMsfLayout () const
BinaryStreamRef getMsfBuffer () const
ArrayRef< support::ulittle32_tgetDirectoryBlockArray () const
std::unique_ptr< msf::MappedBlockStreamcreateIndexedStream (uint16_t SN) const
Expected< std::unique_ptr< msf::MappedBlockStream > > safelyCreateIndexedStream (uint32_t StreamIndex) const
 Wrapper around MappedBlockStream::createIndexedStream() that checks if a stream with that index actually exists.
Expected< std::unique_ptr< msf::MappedBlockStream > > safelyCreateNamedStream (StringRef Name)
msf::MSFStreamLayout getStreamLayout (uint32_t StreamIdx) const
msf::MSFStreamLayout getFpmStreamLayout () const
Error parseFileHeaders ()
Error parseStreamData ()
Expected< InfoStream & > getPDBInfoStream ()
Expected< DbiStream & > getPDBDbiStream ()
Expected< GlobalsStream & > getPDBGlobalsStream ()
Expected< TpiStream & > getPDBTpiStream ()
Expected< TpiStream & > getPDBIpiStream ()
Expected< PublicsStream & > getPDBPublicsStream ()
Expected< SymbolStream & > getPDBSymbolStream ()
Expected< PDBStringTable & > getStringTable ()
Expected< InjectedSourceStream & > getInjectedSourceStream ()
BumpPtrAllocatorgetAllocator ()
bool hasPDBDbiStream () const
bool hasPDBGlobalsStream ()
bool hasPDBInfoStream () const
bool hasPDBIpiStream () const
bool hasPDBPublicsStream ()
bool hasPDBSymbolStream ()
bool hasPDBTpiStream () const
bool hasPDBStringTable ()
bool hasPDBInjectedSourceStream ()
uint32_t getPointerSize ()
Public Member Functions inherited from llvm::msf::IMSFFile
virtual ~IMSFFile ()=default

Detailed Description

Definition at line 41 of file PDBFile.h.

Constructor & Destructor Documentation

◆ PDBFile()

PDBFile::PDBFile ( StringRef Path,
std::unique_ptr< BinaryStream > PdbFileBuffer,
BumpPtrAllocator & Allocator )

Definition at line 41 of file PDBFile.cpp.

References llvm::move(), and llvm::pdb::Path.

Referenced by hasPDBIpiStream().

◆ ~PDBFile()

Member Function Documentation

◆ createIndexedStream()

std::unique_ptr< MappedBlockStream > PDBFile::createIndexedStream ( uint16_t SN) const

◆ getAllocator()

BumpPtrAllocator & llvm::pdb::PDBFile::getAllocator ( )
inline

Definition at line 109 of file PDBFile.h.

◆ getBlockCount()

uint32_t PDBFile::getBlockCount ( ) const
overridevirtual

Implements llvm::msf::IMSFFile.

Definition at line 60 of file PDBFile.cpp.

Referenced by parseFileHeaders(), and ~PDBFile().

◆ getBlockData()

Expected< ArrayRef< uint8_t > > PDBFile::getBlockData ( uint32_t BlockIndex,
uint32_t NumBytes ) const
overridevirtual

Implements llvm::msf::IMSFFile.

Definition at line 103 of file PDBFile.cpp.

References llvm::msf::blockToOffset(), llvm::codeview::EC, and getBlockSize().

Referenced by ~PDBFile().

◆ getBlockMapIndex()

uint32_t PDBFile::getBlockMapIndex ( ) const

Definition at line 68 of file PDBFile.cpp.

Referenced by ~PDBFile().

◆ getBlockMapOffset()

uint64_t PDBFile::getBlockMapOffset ( ) const

Definition at line 79 of file PDBFile.cpp.

Referenced by parseFileHeaders(), and ~PDBFile().

◆ getBlockSize()

uint32_t PDBFile::getBlockSize ( ) const
overridevirtual

Implements llvm::msf::IMSFFile.

Definition at line 54 of file PDBFile.cpp.

Referenced by getBlockData(), and ~PDBFile().

◆ getDirectoryBlockArray()

ArrayRef< support::ulittle32_t > PDBFile::getDirectoryBlockArray ( ) const

Definition at line 232 of file PDBFile.cpp.

◆ getFileDirectory()

StringRef PDBFile::getFileDirectory ( ) const

Definition at line 50 of file PDBFile.cpp.

References llvm::sys::path::parent_path().

Referenced by ~PDBFile().

◆ getFilePath()

StringRef PDBFile::getFilePath ( ) const

Definition at line 48 of file PDBFile.cpp.

Referenced by llvm::pdb::InputFile::getFilePath(), and ~PDBFile().

◆ getFileSize()

uint64_t PDBFile::getFileSize ( ) const

Definition at line 101 of file PDBFile.cpp.

Referenced by parseStreamData(), and ~PDBFile().

◆ getFpmStreamLayout()

msf::MSFStreamLayout PDBFile::getFpmStreamLayout ( ) const

Definition at line 252 of file PDBFile.cpp.

References llvm::msf::getFpmStreamLayout().

◆ getFreeBlockMapBlock()

uint32_t PDBFile::getFreeBlockMapBlock ( ) const

Definition at line 56 of file PDBFile.cpp.

Referenced by ~PDBFile().

◆ getInjectedSourceStream()

Expected< InjectedSourceStream & > PDBFile::getInjectedSourceStream ( )

Definition at line 383 of file PDBFile.cpp.

References llvm::codeview::EC, getStringTable(), and safelyCreateNamedStream().

◆ getMaxStreamSize()

uint32_t PDBFile::getMaxStreamSize ( ) const

Definition at line 88 of file PDBFile.cpp.

References llvm::max_element().

Referenced by ~PDBFile().

◆ getMsfBuffer()

BinaryStreamRef llvm::pdb::PDBFile::getMsfBuffer ( ) const
inline

Definition at line 82 of file PDBFile.h.

◆ getMsfLayout()

const msf::MSFLayout & llvm::pdb::PDBFile::getMsfLayout ( ) const
inline

Definition at line 81 of file PDBFile.h.

◆ getNumDirectoryBlocks()

uint32_t PDBFile::getNumDirectoryBlocks ( ) const

Definition at line 74 of file PDBFile.cpp.

References llvm::msf::bytesToBlocks().

Referenced by parseFileHeaders(), and ~PDBFile().

◆ getNumDirectoryBytes()

uint32_t PDBFile::getNumDirectoryBytes ( ) const

Definition at line 64 of file PDBFile.cpp.

Referenced by ~PDBFile().

◆ getNumStreams()

◆ getPDBDbiStream()

◆ getPDBGlobalsStream()

Expected< GlobalsStream & > PDBFile::getPDBGlobalsStream ( )

Definition at line 256 of file PDBFile.cpp.

References llvm::codeview::EC, getPDBDbiStream(), and safelyCreateIndexedStream().

◆ getPDBInfoStream()

◆ getPDBIpiStream()

◆ getPDBPublicsStream()

Expected< PublicsStream & > PDBFile::getPDBPublicsStream ( )

Definition at line 329 of file PDBFile.cpp.

References llvm::codeview::EC, getPDBDbiStream(), and safelyCreateIndexedStream().

◆ getPDBSymbolStream()

Expected< SymbolStream & > PDBFile::getPDBSymbolStream ( )

Definition at line 347 of file PDBFile.cpp.

References llvm::codeview::EC, getPDBDbiStream(), and safelyCreateIndexedStream().

◆ getPDBTpiStream()

Expected< TpiStream & > PDBFile::getPDBTpiStream ( )

◆ getPointerSize()

uint32_t PDBFile::getPointerSize ( )

Definition at line 401 of file PDBFile.cpp.

References llvm::pdb::Amd64, getPDBDbiStream(), and Machine.

◆ getStreamBlockList()

ArrayRef< support::ulittle32_t > PDBFile::getStreamBlockList ( uint32_t StreamIndex) const
overridevirtual

Implements llvm::msf::IMSFFile.

Definition at line 97 of file PDBFile.cpp.

Referenced by getStreamLayout(), and ~PDBFile().

◆ getStreamByteSize()

uint32_t PDBFile::getStreamByteSize ( uint32_t StreamIndex) const
overridevirtual

Implements llvm::msf::IMSFFile.

Definition at line 92 of file PDBFile.cpp.

Referenced by getStreamLayout(), hasPDBDbiStream(), parseStreamData(), and ~PDBFile().

◆ getStreamLayout()

MSFStreamLayout PDBFile::getStreamLayout ( uint32_t StreamIdx) const

Definition at line 244 of file PDBFile.cpp.

References getStreamBlockList(), and getStreamByteSize().

◆ getStreamMap()

ArrayRef< ArrayRef< support::ulittle32_t > > llvm::pdb::PDBFile::getStreamMap ( ) const
inline

Definition at line 77 of file PDBFile.h.

◆ getStreamSizes()

ArrayRef< support::ulittle32_t > llvm::pdb::PDBFile::getStreamSizes ( ) const
inline

Definition at line 74 of file PDBFile.h.

◆ getStringTable()

Expected< PDBStringTable & > PDBFile::getStringTable ( )

◆ getUnknown1()

uint32_t PDBFile::getUnknown1 ( ) const

Definition at line 72 of file PDBFile.cpp.

Referenced by ~PDBFile().

◆ hasPDBDbiStream()

bool PDBFile::hasPDBDbiStream ( ) const

Definition at line 411 of file PDBFile.cpp.

References getNumStreams(), getStreamByteSize(), and llvm::pdb::StreamDBI.

◆ hasPDBGlobalsStream()

bool PDBFile::hasPDBGlobalsStream ( )

Definition at line 415 of file PDBFile.cpp.

References llvm::consumeError(), getNumStreams(), and getPDBDbiStream().

◆ hasPDBInfoStream()

bool PDBFile::hasPDBInfoStream ( ) const

Definition at line 425 of file PDBFile.cpp.

References getNumStreams(), and llvm::pdb::StreamPDB.

Referenced by hasPDBIpiStream().

◆ hasPDBInjectedSourceStream()

bool PDBFile::hasPDBInjectedSourceStream ( )

◆ hasPDBIpiStream()

◆ hasPDBPublicsStream()

bool PDBFile::hasPDBPublicsStream ( )

Definition at line 438 of file PDBFile.cpp.

References llvm::consumeError(), getNumStreams(), and getPDBDbiStream().

◆ hasPDBStringTable()

bool PDBFile::hasPDBStringTable ( )

◆ hasPDBSymbolStream()

bool PDBFile::hasPDBSymbolStream ( )

Definition at line 447 of file PDBFile.cpp.

References getNumStreams(), and getPDBDbiStream().

◆ hasPDBTpiStream()

bool PDBFile::hasPDBTpiStream ( ) const

Definition at line 454 of file PDBFile.cpp.

References getNumStreams(), and llvm::pdb::StreamTPI.

Referenced by llvm::pdb::InputFile::hasTypes().

◆ parseFileHeaders()

◆ parseStreamData()

◆ safelyCreateIndexedStream()

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(), llvm::make_error(), and llvm::pdb::no_stream.

Referenced by getPDBDbiStream(), getPDBGlobalsStream(), getPDBInfoStream(), getPDBIpiStream(), getPDBPublicsStream(), getPDBSymbolStream(), getPDBTpiStream(), and safelyCreateNamedStream().

◆ safelyCreateNamedStream()

Expected< std::unique_ptr< MappedBlockStream > > PDBFile::safelyCreateNamedStream ( StringRef Name)

◆ setBlockData()

Error PDBFile::setBlockData ( uint32_t BlockIndex,
uint32_t Offset,
ArrayRef< uint8_t > Data ) const
overridevirtual

Implements llvm::msf::IMSFFile.

Definition at line 113 of file PDBFile.cpp.

References llvm::pdb::Data, llvm::make_error(), llvm::pdb::not_writable, and llvm::pdb::Offset.

Referenced by ~PDBFile().


The documentation for this class was generated from the following files: