[PDB] Support executables and source/line info.
[oota-llvm.git] / include / llvm / DebugInfo / PDB / DIA / DIASession.h
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"
15 #include "llvm/DebugInfo/PDB/IPDBSession.h"
16
17 namespace llvm {
18 class DIASession : public IPDBSession {
19 public:
20   explicit DIASession(CComPtr<IDiaSession> DiaSession);
21
22   static PDB_ErrorCode createFromPdb(StringRef Path,
23                                      std::unique_ptr<IPDBSession> &Session);
24   static PDB_ErrorCode createFromExe(StringRef Path,
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) const override;
34   std::unique_ptr<IPDBEnumLineNumbers>
35   findLineNumbersByAddress(uint64_t Address, uint32_t Length) const override;
36
37   std::unique_ptr<IPDBEnumSourceFiles> getAllSourceFiles() const override;
38   std::unique_ptr<IPDBEnumSourceFiles> getSourceFilesForCompiland(
39       const PDBSymbolCompiland &Compiland) const override;
40   std::unique_ptr<IPDBSourceFile>
41   getSourceFileById(uint32_t FileId) const override;
42
43   std::unique_ptr<IPDBEnumDataStreams> getDebugStreams() const override;
44
45 private:
46   CComPtr<IDiaSession> Session;
47 };
48 }
49
50 #endif