LLVM  10.0.0svn
Public Member Functions | List of all members
llvm::pdb::PDBFile Class Reference

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

Inheritance diagram for llvm::pdb::PDBFile:
Inheritance graph
[legend]
Collaboration diagram for llvm::pdb::PDBFile:
Collaboration graph
[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
 
uint32_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. More...
 
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 42 of file PDBFile.h.

Constructor & Destructor Documentation

◆ PDBFile()

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

Definition at line 42 of file PDBFile.cpp.

References ~PDBFile().

◆ ~PDBFile()

PDBFile::~PDBFile ( )
overridedefault

Referenced by PDBFile().

Member Function Documentation

◆ createIndexedStream()

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

Definition at line 238 of file PDBFile.cpp.

References llvm::pdb::kInvalidStreamIndex.

Referenced by safelyCreateIndexedStream().

◆ getAllocator()

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

Definition at line 110 of file PDBFile.h.

References Allocator, getPointerSize(), Info, and llvm::pdb::InjectedSources.

◆ getBlockCount()

uint32_t PDBFile::getBlockCount ( ) const
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().

◆ getBlockData()

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

Implements llvm::msf::IMSFFile.

Definition at line 104 of file PDBFile.cpp.

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

◆ getBlockMapIndex()

uint32_t PDBFile::getBlockMapIndex ( ) const

Definition at line 68 of file PDBFile.cpp.

References llvm::msf::SuperBlock::BlockMapAddr, and llvm::msf::MSFLayout::SB.

◆ getBlockMapOffset()

uint64_t PDBFile::getBlockMapOffset ( ) const

◆ getBlockSize()

uint32_t PDBFile::getBlockSize ( ) const
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().

◆ getDirectoryBlockArray()

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

Definition at line 233 of file PDBFile.cpp.

References llvm::msf::MSFLayout::DirectoryBlocks.

◆ getFileDirectory()

StringRef PDBFile::getFileDirectory ( ) const

Definition at line 50 of file PDBFile.cpp.

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

◆ getFilePath()

StringRef PDBFile::getFilePath ( ) const

Definition at line 48 of file PDBFile.cpp.

Referenced by llvm::pdb::NativeExeSymbol::getSymbolsFileName().

◆ getFileSize()

uint32_t PDBFile::getFileSize ( ) const

Definition at line 102 of file PDBFile.cpp.

Referenced by parseStreamData().

◆ getFpmStreamLayout()

msf::MSFStreamLayout PDBFile::getFpmStreamLayout ( ) const

Definition at line 253 of file PDBFile.cpp.

References llvm::msf::getFpmStreamLayout().

◆ getFreeBlockMapBlock()

uint32_t PDBFile::getFreeBlockMapBlock ( ) const

◆ getInjectedSourceStream()

Expected< InjectedSourceStream & > PDBFile::getInjectedSourceStream ( )

Definition at line 384 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::msf::MSFLayout::StreamSizes.

◆ getMsfBuffer()

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

Definition at line 83 of file PDBFile.h.

References llvm::msf::getFpmStreamLayout(), and Name.

◆ getMsfLayout()

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

Definition at line 82 of file PDBFile.h.

◆ getNumDirectoryBlocks()

uint32_t PDBFile::getNumDirectoryBlocks ( ) const

◆ getNumDirectoryBytes()

uint32_t PDBFile::getNumDirectoryBytes ( ) const

◆ getNumStreams()

uint32_t PDBFile::getNumStreams ( ) const
overridevirtual

◆ getPDBDbiStream()

Expected< DbiStream & > PDBFile::getPDBDbiStream ( )

◆ getPDBGlobalsStream()

Expected< GlobalsStream & > PDBFile::getPDBGlobalsStream ( )

◆ getPDBInfoStream()

Expected< InfoStream & > PDBFile::getPDBInfoStream ( )

◆ getPDBIpiStream()

Expected< TpiStream & > PDBFile::getPDBIpiStream ( )

◆ getPDBPublicsStream()

Expected< PublicsStream & > PDBFile::getPDBPublicsStream ( )

Definition at line 330 of file PDBFile.cpp.

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

◆ getPDBSymbolStream()

Expected< SymbolStream & > PDBFile::getPDBSymbolStream ( )

◆ getPDBTpiStream()

Expected< TpiStream & > PDBFile::getPDBTpiStream ( )

◆ getPointerSize()

uint32_t PDBFile::getPointerSize ( )

Definition at line 402 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 98 of file PDBFile.cpp.

References llvm::msf::MSFLayout::StreamMap.

Referenced by getStreamLayout().

◆ getStreamByteSize()

uint32_t PDBFile::getStreamByteSize ( uint32_t  StreamIndex) const
overridevirtual

Implements llvm::msf::IMSFFile.

Definition at line 93 of file PDBFile.cpp.

References llvm::msf::MSFLayout::StreamSizes.

Referenced by getStreamLayout(), and parseStreamData().

◆ getStreamLayout()

MSFStreamLayout PDBFile::getStreamLayout ( uint32_t  StreamIdx) const

◆ getStreamMap()

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

Definition at line 78 of file PDBFile.h.

◆ getStreamSizes()

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

Definition at line 75 of file PDBFile.h.

◆ getStringTable()

Expected< PDBStringTable & > PDBFile::getStringTable ( )

Definition at line 367 of file PDBFile.cpp.

References assert(), llvm::codeview::EC, N, and safelyCreateNamedStream().

Referenced by getInjectedSourceStream().

◆ getUnknown1()

uint32_t PDBFile::getUnknown1 ( ) const

Definition at line 72 of file PDBFile.cpp.

References llvm::msf::MSFLayout::SB, and llvm::msf::SuperBlock::Unknown1.

◆ hasPDBDbiStream()

bool PDBFile::hasPDBDbiStream ( ) const

Definition at line 412 of file PDBFile.cpp.

◆ hasPDBGlobalsStream()

bool PDBFile::hasPDBGlobalsStream ( )

Definition at line 416 of file PDBFile.cpp.

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

◆ hasPDBInfoStream()

bool PDBFile::hasPDBInfoStream ( ) const

Definition at line 426 of file PDBFile.cpp.

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

Referenced by hasPDBIpiStream().

◆ hasPDBInjectedSourceStream()

bool PDBFile::hasPDBInjectedSourceStream ( )

◆ hasPDBIpiStream()

bool PDBFile::hasPDBIpiStream ( ) const

◆ hasPDBPublicsStream()

bool PDBFile::hasPDBPublicsStream ( )

Definition at line 439 of file PDBFile.cpp.

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

◆ hasPDBStringTable()

bool PDBFile::hasPDBStringTable ( )

◆ hasPDBSymbolStream()

bool PDBFile::hasPDBSymbolStream ( )

Definition at line 448 of file PDBFile.cpp.

References getNumStreams(), and getPDBDbiStream().

◆ hasPDBTpiStream()

bool PDBFile::hasPDBTpiStream ( ) const

Definition at line 455 of file PDBFile.cpp.

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

◆ parseFileHeaders()

Error PDBFile::parseFileHeaders ( )

◆ parseStreamData()

Error PDBFile::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 488 of file PDBFile.cpp.

References createIndexedStream(), getNumStreams(), and llvm::pdb::no_stream.

Referenced by llvm::pdb::DbiStream::getECName(), getPDBDbiStream(), getPDBGlobalsStream(), getPDBInfoStream(), getPDBIpiStream(), getPDBPublicsStream(), getPDBSymbolStream(), getPDBTpiStream(), llvm::pdb::TpiStream::reload(), 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 114 of file PDBFile.cpp.

References llvm::pdb::not_writable.


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