LLVM  3.7.0
DIASession.h
Go to the documentation of this file.
1 //===- DIASession.h - DIA implementation of IPDBSession ---------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_DEBUGINFO_PDB_DIA_DIASESSION_H
11 #define LLVM_DEBUGINFO_PDB_DIA_DIASESSION_H
12 
13 #include "DIASupport.h"
14 #include "llvm/ADT/StringRef.h"
16 
17 namespace llvm {
18 class DIASession : public IPDBSession {
19 public:
20  explicit DIASession(CComPtr<IDiaSession> DiaSession);
21 
23  std::unique_ptr<IPDBSession> &Session);
25  std::unique_ptr<IPDBSession> &Session);
26 
27  uint64_t getLoadAddress() const override;
28  void setLoadAddress(uint64_t Address) override;
29  std::unique_ptr<PDBSymbolExe> getGlobalScope() const override;
30  std::unique_ptr<PDBSymbol> getSymbolById(uint32_t SymbolId) const override;
31 
32  std::unique_ptr<PDBSymbol>
33  findSymbolByAddress(uint64_t Address, PDB_SymType Type) const override;
34 
35  std::unique_ptr<IPDBEnumLineNumbers>
36  findLineNumbersByAddress(uint64_t Address, uint32_t Length) const override;
37 
38  std::unique_ptr<IPDBEnumSourceFiles> getAllSourceFiles() const override;
39  std::unique_ptr<IPDBEnumSourceFiles> getSourceFilesForCompiland(
40  const PDBSymbolCompiland &Compiland) const override;
41  std::unique_ptr<IPDBSourceFile>
42  getSourceFileById(uint32_t FileId) const override;
43 
44  std::unique_ptr<IPDBEnumDataStreams> getDebugStreams() const override;
45 
46 private:
47  CComPtr<IDiaSession> Session;
48 };
49 }
50 
51 #endif
std::unique_ptr< IPDBEnumSourceFiles > getAllSourceFiles() const override
Definition: DIASession.cpp:169
std::unique_ptr< PDBSymbol > getSymbolById(uint32_t SymbolId) const override
Definition: DIASession.cpp:134
std::unique_ptr< PDBSymbol > findSymbolByAddress(uint64_t Address, PDB_SymType Type) const override
Definition: DIASession.cpp:144
std::unique_ptr< IPDBSourceFile > getSourceFileById(uint32_t FileId) const override
Definition: DIASession.cpp:191
PDB_ErrorCode
Definition: PDBTypes.h:423
The instances of the Type class are immutable: once they are created, they are never changed...
Definition: Type.h:45
void setLoadAddress(uint64_t Address) override
Definition: DIASession.cpp:118
std::unique_ptr< IPDBEnumLineNumbers > findLineNumbersByAddress(uint64_t Address, uint32_t Length) const override
Definition: DIASession.cpp:161
std::unique_ptr< IPDBEnumSourceFiles > getSourceFilesForCompiland(const PDBSymbolCompiland &Compiland) const override
Definition: DIASession.cpp:177
static PDB_ErrorCode createFromPdb(StringRef Path, std::unique_ptr< IPDBSession > &Session)
Definition: DIASession.cpp:27
std::unique_ptr< IPDBEnumDataStreams > getDebugStreams() const override
Definition: DIASession.cpp:199
IPDBSession defines an interface used to provide a context for querying debug information from a debu...
Definition: IPDBSession.h:24
PDB_SymType
These values correspond to the SymTagEnum enumeration, and are documented here: https://msdn.microsoft.com/en-us/library/bkedss5f.aspx.
Definition: PDBTypes.h:270
uint64_t getLoadAddress() const override
Definition: DIASession.cpp:112
std::unique_ptr< PDBSymbolExe > getGlobalScope() const override
Definition: DIASession.cpp:122
DIASession(CComPtr< IDiaSession > DiaSession)
Definition: DIASession.cpp:25
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:40
static PDB_ErrorCode createFromExe(StringRef Path, std::unique_ptr< IPDBSession > &Session)
Definition: DIASession.cpp:68