52 NativeSession::NativeSession(std::unique_ptr<PDBFile> PdbFile,
53 std::unique_ptr<BumpPtrAllocator>
Allocator)
54 : Pdb(
std::move(PdbFile)), Allocator(
std::move(Allocator)),
60 std::unique_ptr<IPDBSession> &Session) {
61 StringRef Path = Buffer->getBufferIdentifier();
62 auto Stream = llvm::make_unique<MemoryBufferByteStream>(
65 auto Allocator = llvm::make_unique<BumpPtrAllocator>();
66 auto File = llvm::make_unique<PDBFile>(Path, std::move(Stream), *Allocator);
67 if (
auto EC = File->parseFileHeaders())
69 if (
auto EC = File->parseStreamData())
73 llvm::make_unique<NativeSession>(std::move(File), std::move(Allocator));
79 std::unique_ptr<IPDBSession> &Session) {
91 std::unique_ptr<PDBSymbol>
106 std::unique_ptr<PDBSymbol>
111 std::unique_ptr<PDBSymbol>
116 std::unique_ptr<PDBSymbol>
122 std::unique_ptr<IPDBEnumLineNumbers>
128 std::unique_ptr<IPDBEnumLineNumbers>
134 std::unique_ptr<IPDBEnumLineNumbers>
139 std::unique_ptr<IPDBEnumLineNumbers>
145 std::unique_ptr<IPDBEnumSourceFiles>
152 std::unique_ptr<IPDBSourceFile>
159 std::unique_ptr<IPDBEnumChildren<PDBSymbolCompiland>>
165 std::unique_ptr<PDBSymbolCompiland>
180 std::unique_ptr<IPDBSourceFile>
193 std::unique_ptr<IPDBEnumInjectedSources>
198 std::unique_ptr<IPDBEnumSectionContribs>
203 std::unique_ptr<IPDBEnumFrameData>
208 void NativeSession::initializeExeSymbol() {
std::unique_ptr< IPDBEnumSourceFiles > getAllSourceFiles() const override
static Error createFromExe(StringRef Path, std::unique_ptr< IPDBSession > &Session)
std::unique_ptr< IPDBEnumLineNumbers > findLineNumbersBySectOffset(uint32_t Section, uint32_t Offset, uint32_t Length) const override
This class represents lattice values for constants.
std::unique_ptr< IPDBEnumSectionContribs > getSectionContribs() const override
PDB_NameSearchFlags
Defines flags used for enumerating child symbols.
Error takeError()
Take ownership of the stored error.
This file defines the MallocAllocator and BumpPtrAllocator interfaces.
std::unique_ptr< PDBSymbol > findSymbolByAddress(uint64_t Address, PDB_SymType Type) const override
IPDBSourceFile defines an interface used to represent source files whose information are stored in th...
std::unique_ptr< IPDBEnumSourceFiles > findSourceFiles(const PDBSymbolCompiland *Compiland, llvm::StringRef Pattern, PDB_NameSearchFlags Flags) const override
NativeExeSymbol & getNativeGlobalScope() const
std::unique_ptr< PDBSymbol > getSymbolById(SymIndexId SymbolId) const
Tagged union holding either a T or a Error.
static DbiStream * getDbiStreamPtr(PDBFile &File)
std::unique_ptr< IPDBEnumFrameData > getFrameData() const override
std::unique_ptr< IPDBEnumTables > getEnumTables() const override
std::unique_ptr< IPDBEnumLineNumbers > findLineNumbersByRVA(uint32_t RVA, uint32_t Length) const override
PDB_SymType
These values correspond to the SymTagEnum enumeration, and are documented here: https://msdn.microsoft.com/en-us/library/bkedss5f.aspx.
std::unique_ptr< PDBSymbol > getSymbolById(SymIndexId SymbolId) const override
The instances of the Type class are immutable: once they are created, they are never changed...
std::unique_ptr< PDBSymbol > findSymbolByRVA(uint32_t RVA, PDB_SymType Type) const override
uint64_t getLoadAddress() const override
std::unique_ptr< IPDBEnumLineNumbers > findLineNumbers(const PDBSymbolCompiland &Compiland, const IPDBSourceFile &File) const override
void consumeError(Error Err)
Consume a Error without doing anything.
Expected< DbiStream & > getPDBDbiStream()
std::unique_ptr< PDBSymbol > findSymbolBySectOffset(uint32_t Sect, uint32_t Offset, PDB_SymType Type) const override
static ErrorSuccess success()
Create a success value.
std::unique_ptr< IPDBEnumSourceFiles > getSourceFilesForCompiland(const PDBSymbolCompiland &Compiland) const override
SymIndexId createSymbol(Args &&... ConstructorArgs)
reference get()
Returns a reference to the stored T value.
NativeRawSymbol & getNativeSymbolById(SymIndexId SymbolId) const
std::unique_ptr< PDBSymbolExe > getGlobalScope() override
bool setLoadAddress(uint64_t Address) override
~NativeSession() override
std::unique_ptr< IPDBEnumLineNumbers > findLineNumbersByAddress(uint64_t Address, uint32_t Length) const override
std::unique_ptr< PDBSymbolCompiland > findOneCompilandForSourceFile(llvm::StringRef Pattern, PDB_NameSearchFlags Flags) const override
std::unique_ptr< IPDBSourceFile > getSourceFileById(uint32_t FileId) const override
std::unique_ptr< IPDBEnumChildren< PDBSymbolCompiland > > findCompilandsForSourceFile(llvm::StringRef Pattern, PDB_NameSearchFlags Flags) const override
Provides ErrorOr<T> smart pointer.
std::unique_ptr< IPDBSourceFile > findOneSourceFile(const PDBSymbolCompiland *Compiland, llvm::StringRef Pattern, PDB_NameSearchFlags Flags) const override
Lightweight error class with error context and mandatory checking.
static Error createFromPdb(std::unique_ptr< MemoryBuffer > MB, std::unique_ptr< IPDBSession > &Session)
bool addressForRVA(uint32_t RVA, uint32_t &Section, uint32_t &Offset) const override
StringRef - Represent a constant reference to a string, i.e.
std::unique_ptr< IPDBEnumDataStreams > getDebugStreams() const override
bool addressForVA(uint64_t VA, uint32_t &Section, uint32_t &Offset) const override
std::unique_ptr< IPDBEnumInjectedSources > getInjectedSources() const override