LLVM 20.0.0git
DIASession.h
Go to the documentation of this file.
1//===- DIASession.h - DIA implementation of IPDBSession ---------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_DEBUGINFO_PDB_DIA_DIASESSION_H
10#define LLVM_DEBUGINFO_PDB_DIA_DIASESSION_H
11
12#include "DIASupport.h"
14#include "llvm/Support/Error.h"
15
16#include <system_error>
17
18namespace llvm {
19class StringRef;
20
21namespace pdb {
22class DIASession : public IPDBSession {
23public:
24 explicit DIASession(CComPtr<IDiaSession> DiaSession);
25
27 std::unique_ptr<IPDBSession> &Session);
29 std::unique_ptr<IPDBSession> &Session);
30
31 uint64_t getLoadAddress() const override;
32 bool setLoadAddress(uint64_t Address) override;
33 std::unique_ptr<PDBSymbolExe> getGlobalScope() override;
34 std::unique_ptr<PDBSymbol> getSymbolById(SymIndexId SymbolId) const override;
35
36 bool addressForVA(uint64_t VA, uint32_t &Section,
37 uint32_t &Offset) const override;
38 bool addressForRVA(uint32_t RVA, uint32_t &Section,
39 uint32_t &Offset) const override;
40
41 std::unique_ptr<PDBSymbol> findSymbolByAddress(uint64_t Address,
42 PDB_SymType Type) override;
43 std::unique_ptr<PDBSymbol> findSymbolByRVA(uint32_t RVA,
44 PDB_SymType Type) override;
45 std::unique_ptr<PDBSymbol> findSymbolBySectOffset(uint32_t Section,
47 PDB_SymType Type) override;
48
49 std::unique_ptr<IPDBEnumLineNumbers>
51 const IPDBSourceFile &File) const override;
52 std::unique_ptr<IPDBEnumLineNumbers>
54 std::unique_ptr<IPDBEnumLineNumbers>
55 findLineNumbersByRVA(uint32_t RVA, uint32_t Length) const override;
56 std::unique_ptr<IPDBEnumLineNumbers>
58 uint32_t Length) const override;
59
60 std::unique_ptr<IPDBEnumSourceFiles>
62 PDB_NameSearchFlags Flags) const override;
63 std::unique_ptr<IPDBSourceFile>
66 PDB_NameSearchFlags Flags) const override;
67 std::unique_ptr<IPDBEnumChildren<PDBSymbolCompiland>>
69 PDB_NameSearchFlags Flags) const override;
70 std::unique_ptr<PDBSymbolCompiland>
72 PDB_NameSearchFlags Flags) const override;
73 std::unique_ptr<IPDBEnumSourceFiles> getAllSourceFiles() const override;
74 std::unique_ptr<IPDBEnumSourceFiles> getSourceFilesForCompiland(
75 const PDBSymbolCompiland &Compiland) const override;
76 std::unique_ptr<IPDBSourceFile>
77 getSourceFileById(uint32_t FileId) const override;
78
79 std::unique_ptr<IPDBEnumDataStreams> getDebugStreams() const override;
80
81 std::unique_ptr<IPDBEnumTables> getEnumTables() const override;
82
83 std::unique_ptr<IPDBEnumInjectedSources> getInjectedSources() const override;
84
85 std::unique_ptr<IPDBEnumSectionContribs> getSectionContribs() const override;
86
87 std::unique_ptr<IPDBEnumFrameData> getFrameData() const override;
88private:
89 CComPtr<IDiaSession> Session;
90};
91} // namespace pdb
92} // namespace llvm
93#endif
Lightweight error class with error context and mandatory checking.
Definition: Error.h:160
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:51
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:45
std::unique_ptr< IPDBSourceFile > findOneSourceFile(const PDBSymbolCompiland *Compiland, llvm::StringRef Pattern, PDB_NameSearchFlags Flags) const override
Definition: DIASession.cpp:305
std::unique_ptr< IPDBEnumSourceFiles > findSourceFiles(const PDBSymbolCompiland *Compiland, llvm::StringRef Pattern, PDB_NameSearchFlags Flags) const override
Definition: DIASession.cpp:283
std::unique_ptr< IPDBEnumLineNumbers > findLineNumbersByRVA(uint32_t RVA, uint32_t Length) const override
Definition: DIASession.cpp:264
std::unique_ptr< IPDBEnumSourceFiles > getSourceFilesForCompiland(const PDBSymbolCompiland &Compiland) const override
Definition: DIASession.cpp:340
std::unique_ptr< IPDBEnumLineNumbers > findLineNumbersByAddress(uint64_t Address, uint32_t Length) const override
Definition: DIASession.cpp:250
static Error createFromExe(StringRef Path, std::unique_ptr< IPDBSession > &Session)
Definition: DIASession.cpp:113
uint64_t getLoadAddress() const override
Definition: DIASession.cpp:138
std::unique_ptr< IPDBEnumSourceFiles > getAllSourceFiles() const override
Definition: DIASession.cpp:332
bool addressForVA(uint64_t VA, uint32_t &Section, uint32_t &Offset) const override
Definition: DIASession.cpp:160
std::unique_ptr< PDBSymbolExe > getGlobalScope() override
Definition: DIASession.cpp:148
std::unique_ptr< PDBSymbol > findSymbolByAddress(uint64_t Address, PDB_SymType Type) override
Definition: DIASession.cpp:192
std::unique_ptr< IPDBEnumInjectedSources > getInjectedSources() const override
Definition: DIASession.cpp:396
std::unique_ptr< PDBSymbolCompiland > findOneCompilandForSourceFile(llvm::StringRef Pattern, PDB_NameSearchFlags Flags) const override
Definition: DIASession.cpp:324
std::unique_ptr< IPDBEnumChildren< PDBSymbolCompiland > > findCompilandsForSourceFile(llvm::StringRef Pattern, PDB_NameSearchFlags Flags) const override
Definition: DIASession.cpp:315
bool setLoadAddress(uint64_t Address) override
Definition: DIASession.cpp:144
static Error createFromPdb(StringRef Path, std::unique_ptr< IPDBSession > &Session)
Definition: DIASession.cpp:87
std::unique_ptr< IPDBEnumLineNumbers > findLineNumbers(const PDBSymbolCompiland &Compiland, const IPDBSourceFile &File) const override
Definition: DIASession.cpp:235
std::unique_ptr< IPDBEnumDataStreams > getDebugStreams() const override
Definition: DIASession.cpp:362
bool addressForRVA(uint32_t RVA, uint32_t &Section, uint32_t &Offset) const override
Definition: DIASession.cpp:171
std::unique_ptr< PDBSymbol > getSymbolById(SymIndexId SymbolId) const override
Definition: DIASession.cpp:183
std::unique_ptr< IPDBSourceFile > getSourceFileById(uint32_t FileId) const override
Definition: DIASession.cpp:354
std::unique_ptr< IPDBEnumFrameData > getFrameData() const override
Definition: DIASession.cpp:416
std::unique_ptr< IPDBEnumLineNumbers > findLineNumbersBySectOffset(uint32_t Section, uint32_t Offset, uint32_t Length) const override
Definition: DIASession.cpp:273
std::unique_ptr< PDBSymbol > findSymbolByRVA(uint32_t RVA, PDB_SymType Type) override
Definition: DIASession.cpp:209
std::unique_ptr< IPDBEnumTables > getEnumTables() const override
Definition: DIASession.cpp:370
std::unique_ptr< PDBSymbol > findSymbolBySectOffset(uint32_t Section, uint32_t Offset, PDB_SymType Type) override
Definition: DIASession.cpp:222
std::unique_ptr< IPDBEnumSectionContribs > getSectionContribs() const override
Definition: DIASession.cpp:406
IPDBSession defines an interface used to provide a context for querying debug information from a debu...
Definition: IPDBSession.h:25
IPDBSourceFile defines an interface used to represent source files whose information are stored in th...
PDB_NameSearchFlags
Defines flags used for enumerating child symbols.
Definition: PDBTypes.h:102
PDB_SymType
These values correspond to the SymTagEnum enumeration, and are documented here: https://msdn....
Definition: PDBTypes.h:243
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
@ Length
Definition: DWP.cpp:480