1 //===- DIASession.h - DIA implementation of IPDBSession ---------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_DEBUGINFO_PDB_DIA_DIASESSION_H
11 #define LLVM_DEBUGINFO_PDB_DIA_DIASESSION_H
13 #include "DIASupport.h"
14 #include "llvm/DebugInfo/PDB/IPDBSession.h"
15 #include "llvm/Support/Error.h"
17 #include <system_error>
23 class DIASession : public IPDBSession {
25 explicit DIASession(CComPtr<IDiaSession> DiaSession);
27 static Error createFromPdb(StringRef Path,
28 std::unique_ptr<IPDBSession> &Session);
29 static Error createFromExe(StringRef Path,
30 std::unique_ptr<IPDBSession> &Session);
32 uint64_t getLoadAddress() const override;
33 void setLoadAddress(uint64_t Address) override;
34 std::unique_ptr<PDBSymbolExe> getGlobalScope() override;
35 std::unique_ptr<PDBSymbol> getSymbolById(uint32_t SymbolId) const override;
37 std::unique_ptr<PDBSymbol>
38 findSymbolByAddress(uint64_t Address, PDB_SymType Type) const override;
40 std::unique_ptr<IPDBEnumLineNumbers>
41 findLineNumbers(const PDBSymbolCompiland &Compiland,
42 const IPDBSourceFile &File) const override;
43 std::unique_ptr<IPDBEnumLineNumbers>
44 findLineNumbersByAddress(uint64_t Address, uint32_t Length) const override;
46 std::unique_ptr<IPDBEnumSourceFiles>
47 findSourceFiles(const PDBSymbolCompiland *Compiland, llvm::StringRef Pattern,
48 PDB_NameSearchFlags Flags) const override;
49 std::unique_ptr<IPDBSourceFile>
50 findOneSourceFile(const PDBSymbolCompiland *Compiland,
51 llvm::StringRef Pattern,
52 PDB_NameSearchFlags Flags) const override;
53 std::unique_ptr<IPDBEnumChildren<PDBSymbolCompiland>>
54 findCompilandsForSourceFile(llvm::StringRef Pattern,
55 PDB_NameSearchFlags Flags) const override;
56 std::unique_ptr<PDBSymbolCompiland>
57 findOneCompilandForSourceFile(llvm::StringRef Pattern,
58 PDB_NameSearchFlags Flags) const override;
59 std::unique_ptr<IPDBEnumSourceFiles> getAllSourceFiles() const override;
60 std::unique_ptr<IPDBEnumSourceFiles> getSourceFilesForCompiland(
61 const PDBSymbolCompiland &Compiland) const override;
62 std::unique_ptr<IPDBSourceFile>
63 getSourceFileById(uint32_t FileId) const override;
65 std::unique_ptr<IPDBEnumDataStreams> getDebugStreams() const override;
67 std::unique_ptr<IPDBEnumTables> getEnumTables() const override;
69 CComPtr<IDiaSession> Session;