LLVM 20.0.0git
Classes | Public Member Functions | Static Public Member Functions | List of all members
llvm::pdb::NativeSession Class Reference

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

Inheritance diagram for llvm::pdb::NativeSession:
Inheritance graph
[legend]

Public Member Functions

 NativeSession (std::unique_ptr< PDBFile > PdbFile, std::unique_ptr< BumpPtrAllocator > Allocator)
 
 ~NativeSession () override
 
uint64_t getLoadAddress () const override
 
bool setLoadAddress (uint64_t Address) override
 
std::unique_ptr< PDBSymbolExegetGlobalScope () override
 
std::unique_ptr< PDBSymbolgetSymbolById (SymIndexId SymbolId) const override
 
bool addressForVA (uint64_t VA, uint32_t &Section, uint32_t &Offset) const override
 
bool addressForRVA (uint32_t RVA, uint32_t &Section, uint32_t &Offset) const override
 
std::unique_ptr< PDBSymbolfindSymbolByAddress (uint64_t Address, PDB_SymType Type) override
 
std::unique_ptr< PDBSymbolfindSymbolByRVA (uint32_t RVA, PDB_SymType Type) override
 
std::unique_ptr< PDBSymbolfindSymbolBySectOffset (uint32_t Sect, uint32_t Offset, PDB_SymType Type) override
 
std::unique_ptr< IPDBEnumLineNumbersfindLineNumbers (const PDBSymbolCompiland &Compiland, const IPDBSourceFile &File) const override
 
std::unique_ptr< IPDBEnumLineNumbersfindLineNumbersByAddress (uint64_t Address, uint32_t Length) const override
 
std::unique_ptr< IPDBEnumLineNumbersfindLineNumbersByRVA (uint32_t RVA, uint32_t Length) const override
 
std::unique_ptr< IPDBEnumLineNumbersfindLineNumbersBySectOffset (uint32_t Section, uint32_t Offset, uint32_t Length) const override
 
std::unique_ptr< IPDBEnumSourceFilesfindSourceFiles (const PDBSymbolCompiland *Compiland, llvm::StringRef Pattern, PDB_NameSearchFlags Flags) const override
 
std::unique_ptr< IPDBSourceFilefindOneSourceFile (const PDBSymbolCompiland *Compiland, llvm::StringRef Pattern, PDB_NameSearchFlags Flags) const override
 
std::unique_ptr< IPDBEnumChildren< PDBSymbolCompiland > > findCompilandsForSourceFile (llvm::StringRef Pattern, PDB_NameSearchFlags Flags) const override
 
std::unique_ptr< PDBSymbolCompilandfindOneCompilandForSourceFile (llvm::StringRef Pattern, PDB_NameSearchFlags Flags) const override
 
std::unique_ptr< IPDBEnumSourceFilesgetAllSourceFiles () const override
 
std::unique_ptr< IPDBEnumSourceFilesgetSourceFilesForCompiland (const PDBSymbolCompiland &Compiland) const override
 
std::unique_ptr< IPDBSourceFilegetSourceFileById (uint32_t FileId) const override
 
std::unique_ptr< IPDBEnumDataStreamsgetDebugStreams () const override
 
std::unique_ptr< IPDBEnumTablesgetEnumTables () const override
 
std::unique_ptr< IPDBEnumInjectedSourcesgetInjectedSources () const override
 
std::unique_ptr< IPDBEnumSectionContribsgetSectionContribs () const override
 
std::unique_ptr< IPDBEnumFrameDatagetFrameData () const override
 
PDBFilegetPDBFile ()
 
const PDBFilegetPDBFile () const
 
NativeExeSymbolgetNativeGlobalScope () const
 
SymbolCachegetSymbolCache ()
 
const SymbolCachegetSymbolCache () const
 
uint32_t getRVAFromSectOffset (uint32_t Section, uint32_t Offset) const
 
uint64_t getVAFromSectOffset (uint32_t Section, uint32_t Offset) const
 
bool moduleIndexForVA (uint64_t VA, uint16_t &ModuleIndex) const
 
bool moduleIndexForSectOffset (uint32_t Sect, uint32_t Offset, uint16_t &ModuleIndex) const
 
Expected< ModuleDebugStreamRefgetModuleDebugStream (uint32_t Index) const
 
- Public Member Functions inherited from llvm::pdb::IPDBSession
virtual ~IPDBSession ()
 
virtual uint64_t getLoadAddress () const =0
 
virtual bool setLoadAddress (uint64_t Address)=0
 
virtual std::unique_ptr< PDBSymbolExegetGlobalScope ()=0
 
virtual std::unique_ptr< PDBSymbolgetSymbolById (SymIndexId SymbolId) const =0
 
virtual bool addressForVA (uint64_t VA, uint32_t &Section, uint32_t &Offset) const =0
 
virtual bool addressForRVA (uint32_t RVA, uint32_t &Section, uint32_t &Offset) const =0
 
template<typename T >
std::unique_ptr< TgetConcreteSymbolById (SymIndexId SymbolId) const
 
virtual std::unique_ptr< PDBSymbolfindSymbolByAddress (uint64_t Address, PDB_SymType Type)=0
 
virtual std::unique_ptr< PDBSymbolfindSymbolByRVA (uint32_t RVA, PDB_SymType Type)=0
 
virtual std::unique_ptr< PDBSymbolfindSymbolBySectOffset (uint32_t Sect, uint32_t Offset, PDB_SymType Type)=0
 
virtual std::unique_ptr< IPDBEnumLineNumbersfindLineNumbers (const PDBSymbolCompiland &Compiland, const IPDBSourceFile &File) const =0
 
virtual std::unique_ptr< IPDBEnumLineNumbersfindLineNumbersByAddress (uint64_t Address, uint32_t Length) const =0
 
virtual std::unique_ptr< IPDBEnumLineNumbersfindLineNumbersByRVA (uint32_t RVA, uint32_t Length) const =0
 
virtual std::unique_ptr< IPDBEnumLineNumbersfindLineNumbersBySectOffset (uint32_t Section, uint32_t Offset, uint32_t Length) const =0
 
virtual std::unique_ptr< IPDBEnumSourceFilesfindSourceFiles (const PDBSymbolCompiland *Compiland, llvm::StringRef Pattern, PDB_NameSearchFlags Flags) const =0
 
virtual std::unique_ptr< IPDBSourceFilefindOneSourceFile (const PDBSymbolCompiland *Compiland, llvm::StringRef Pattern, PDB_NameSearchFlags Flags) const =0
 
virtual std::unique_ptr< IPDBEnumChildren< PDBSymbolCompiland > > findCompilandsForSourceFile (llvm::StringRef Pattern, PDB_NameSearchFlags Flags) const =0
 
virtual std::unique_ptr< PDBSymbolCompilandfindOneCompilandForSourceFile (llvm::StringRef Pattern, PDB_NameSearchFlags Flags) const =0
 
virtual std::unique_ptr< IPDBEnumSourceFilesgetAllSourceFiles () const =0
 
virtual std::unique_ptr< IPDBEnumSourceFilesgetSourceFilesForCompiland (const PDBSymbolCompiland &Compiland) const =0
 
virtual std::unique_ptr< IPDBSourceFilegetSourceFileById (uint32_t FileId) const =0
 
virtual std::unique_ptr< IPDBEnumDataStreamsgetDebugStreams () const =0
 
virtual std::unique_ptr< IPDBEnumTablesgetEnumTables () const =0
 
virtual std::unique_ptr< IPDBEnumInjectedSourcesgetInjectedSources () const =0
 
virtual std::unique_ptr< IPDBEnumSectionContribsgetSectionContribs () const =0
 
virtual std::unique_ptr< IPDBEnumFrameDatagetFrameData () const =0
 

Static Public Member Functions

static Error createFromPdb (std::unique_ptr< MemoryBuffer > MB, std::unique_ptr< IPDBSession > &Session)
 
static Error createFromPdbPath (StringRef PdbPath, std::unique_ptr< IPDBSession > &Session)
 
static Error createFromExe (StringRef Path, std::unique_ptr< IPDBSession > &Session)
 
static Expected< std::string > searchForPdb (const PdbSearchOptions &Opts)
 

Detailed Description

Definition at line 32 of file NativeSession.h.

Constructor & Destructor Documentation

◆ NativeSession()

NativeSession::NativeSession ( std::unique_ptr< PDBFile PdbFile,
std::unique_ptr< BumpPtrAllocator Allocator 
)

Definition at line 66 of file NativeSession.cpp.

References Allocator.

◆ ~NativeSession()

NativeSession::~NativeSession ( )
overridedefault

Member Function Documentation

◆ addressForRVA()

bool NativeSession::addressForRVA ( uint32_t  RVA,
uint32_t Section,
uint32_t Offset 
) const
overridevirtual

Implements llvm::pdb::IPDBSession.

Definition at line 227 of file NativeSession.cpp.

References llvm::pdb::Offset, and llvm::size().

Referenced by addressForVA(), and findSymbolByRVA().

◆ addressForVA()

bool NativeSession::addressForVA ( uint64_t  VA,
uint32_t Section,
uint32_t Offset 
) const
overridevirtual

◆ createFromExe()

Error NativeSession::createFromExe ( StringRef  Path,
std::unique_ptr< IPDBSession > &  Session 
)
static

◆ createFromPdb()

Error NativeSession::createFromPdb ( std::unique_ptr< MemoryBuffer MB,
std::unique_ptr< IPDBSession > &  Session 
)
static

Definition at line 73 of file NativeSession.cpp.

References Allocator, llvm::little, llvm::pdb::Path, and llvm::Error::success().

◆ createFromPdbPath()

Error NativeSession::createFromPdbPath ( StringRef  PdbPath,
std::unique_ptr< IPDBSession > &  Session 
)
static

◆ findCompilandsForSourceFile()

std::unique_ptr< IPDBEnumChildren< PDBSymbolCompiland > > NativeSession::findCompilandsForSourceFile ( llvm::StringRef  Pattern,
PDB_NameSearchFlags  Flags 
) const
overridevirtual

Implements llvm::pdb::IPDBSession.

Definition at line 313 of file NativeSession.cpp.

◆ findLineNumbers()

std::unique_ptr< IPDBEnumLineNumbers > NativeSession::findLineNumbers ( const PDBSymbolCompiland Compiland,
const IPDBSourceFile File 
) const
overridevirtual

Implements llvm::pdb::IPDBSession.

Definition at line 275 of file NativeSession.cpp.

◆ findLineNumbersByAddress()

std::unique_ptr< IPDBEnumLineNumbers > NativeSession::findLineNumbersByAddress ( uint64_t  Address,
uint32_t  Length 
) const
overridevirtual

◆ findLineNumbersByRVA()

std::unique_ptr< IPDBEnumLineNumbers > NativeSession::findLineNumbersByRVA ( uint32_t  RVA,
uint32_t  Length 
) const
overridevirtual

◆ findLineNumbersBySectOffset()

std::unique_ptr< IPDBEnumLineNumbers > NativeSession::findLineNumbersBySectOffset ( uint32_t  Section,
uint32_t  Offset,
uint32_t  Length 
) const
overridevirtual

◆ findOneCompilandForSourceFile()

std::unique_ptr< PDBSymbolCompiland > NativeSession::findOneCompilandForSourceFile ( llvm::StringRef  Pattern,
PDB_NameSearchFlags  Flags 
) const
overridevirtual

Implements llvm::pdb::IPDBSession.

Definition at line 319 of file NativeSession.cpp.

◆ findOneSourceFile()

std::unique_ptr< IPDBSourceFile > NativeSession::findOneSourceFile ( const PDBSymbolCompiland Compiland,
llvm::StringRef  Pattern,
PDB_NameSearchFlags  Flags 
) const
overridevirtual

Implements llvm::pdb::IPDBSession.

Definition at line 306 of file NativeSession.cpp.

◆ findSourceFiles()

std::unique_ptr< IPDBEnumSourceFiles > NativeSession::findSourceFiles ( const PDBSymbolCompiland Compiland,
llvm::StringRef  Pattern,
PDB_NameSearchFlags  Flags 
) const
overridevirtual

Implements llvm::pdb::IPDBSession.

Definition at line 299 of file NativeSession.cpp.

◆ findSymbolByAddress()

std::unique_ptr< PDBSymbol > NativeSession::findSymbolByAddress ( uint64_t  Address,
PDB_SymType  Type 
)
overridevirtual

◆ findSymbolByRVA()

std::unique_ptr< PDBSymbol > NativeSession::findSymbolByRVA ( uint32_t  RVA,
PDB_SymType  Type 
)
overridevirtual

◆ findSymbolBySectOffset()

std::unique_ptr< PDBSymbol > NativeSession::findSymbolBySectOffset ( uint32_t  Sect,
uint32_t  Offset,
PDB_SymType  Type 
)
overridevirtual

◆ getAllSourceFiles()

std::unique_ptr< IPDBEnumSourceFiles > NativeSession::getAllSourceFiles ( ) const
overridevirtual

Implements llvm::pdb::IPDBSession.

Definition at line 324 of file NativeSession.cpp.

◆ getDebugStreams()

std::unique_ptr< IPDBEnumDataStreams > NativeSession::getDebugStreams ( ) const
overridevirtual

Implements llvm::pdb::IPDBSession.

Definition at line 338 of file NativeSession.cpp.

◆ getEnumTables()

std::unique_ptr< IPDBEnumTables > NativeSession::getEnumTables ( ) const
overridevirtual

Implements llvm::pdb::IPDBSession.

Definition at line 342 of file NativeSession.cpp.

◆ getFrameData()

std::unique_ptr< IPDBEnumFrameData > NativeSession::getFrameData ( ) const
overridevirtual

Implements llvm::pdb::IPDBSession.

Definition at line 367 of file NativeSession.cpp.

◆ getGlobalScope()

std::unique_ptr< PDBSymbolExe > NativeSession::getGlobalScope ( )
overridevirtual

Implements llvm::pdb::IPDBSession.

Definition at line 212 of file NativeSession.cpp.

References getNativeGlobalScope().

◆ getInjectedSources()

std::unique_ptr< IPDBEnumInjectedSources > NativeSession::getInjectedSources ( ) const
overridevirtual

Implements llvm::pdb::IPDBSession.

Definition at line 347 of file NativeSession.cpp.

References llvm::consumeError().

◆ getLoadAddress()

uint64_t NativeSession::getLoadAddress ( ) const
overridevirtual

Implements llvm::pdb::IPDBSession.

Definition at line 205 of file NativeSession.cpp.

Referenced by addressForVA(), and findLineNumbersByRVA().

◆ getModuleDebugStream()

Expected< ModuleDebugStreamRef > NativeSession::getModuleDebugStream ( uint32_t  Index) const

◆ getNativeGlobalScope()

NativeExeSymbol & NativeSession::getNativeGlobalScope ( ) const

Definition at line 376 of file NativeSession.cpp.

References llvm::pdb::SymbolCache::getNativeSymbolById().

Referenced by getGlobalScope().

◆ getPDBFile() [1/2]

PDBFile & llvm::pdb::NativeSession::getPDBFile ( )
inline

◆ getPDBFile() [2/2]

const PDBFile & llvm::pdb::NativeSession::getPDBFile ( ) const
inline

Definition at line 110 of file NativeSession.h.

◆ getRVAFromSectOffset()

uint32_t NativeSession::getRVAFromSectOffset ( uint32_t  Section,
uint32_t  Offset 
) const

◆ getSectionContribs()

std::unique_ptr< IPDBEnumSectionContribs > NativeSession::getSectionContribs ( ) const
overridevirtual

Implements llvm::pdb::IPDBSession.

Definition at line 362 of file NativeSession.cpp.

◆ getSourceFileById()

std::unique_ptr< IPDBSourceFile > NativeSession::getSourceFileById ( uint32_t  FileId) const
overridevirtual

Implements llvm::pdb::IPDBSession.

Definition at line 334 of file NativeSession.cpp.

References llvm::pdb::SymbolCache::getSourceFileById().

◆ getSourceFilesForCompiland()

std::unique_ptr< IPDBEnumSourceFiles > NativeSession::getSourceFilesForCompiland ( const PDBSymbolCompiland Compiland) const
overridevirtual

Implements llvm::pdb::IPDBSession.

Definition at line 328 of file NativeSession.cpp.

◆ getSymbolById()

std::unique_ptr< PDBSymbol > NativeSession::getSymbolById ( SymIndexId  SymbolId) const
overridevirtual

Implements llvm::pdb::IPDBSession.

Definition at line 217 of file NativeSession.cpp.

References llvm::pdb::SymbolCache::getSymbolById().

◆ getSymbolCache() [1/2]

SymbolCache & llvm::pdb::NativeSession::getSymbolCache ( )
inline

◆ getSymbolCache() [2/2]

const SymbolCache & llvm::pdb::NativeSession::getSymbolCache ( ) const
inline

Definition at line 114 of file NativeSession.h.

◆ getVAFromSectOffset()

uint64_t NativeSession::getVAFromSectOffset ( uint32_t  Section,
uint32_t  Offset 
) const

◆ moduleIndexForSectOffset()

bool NativeSession::moduleIndexForSectOffset ( uint32_t  Sect,
uint32_t  Offset,
uint16_t ModuleIndex 
) const

◆ moduleIndexForVA()

bool NativeSession::moduleIndexForVA ( uint64_t  VA,
uint16_t ModuleIndex 
) const

◆ searchForPdb()

Expected< std::string > NativeSession::searchForPdb ( const PdbSearchOptions &  Opts)
static

◆ setLoadAddress()

bool NativeSession::setLoadAddress ( uint64_t  Address)
overridevirtual

Implements llvm::pdb::IPDBSession.

Definition at line 207 of file NativeSession.cpp.

References llvm::pdb::Address.


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