LLVM  6.0.0svn
IPDBSession.h
Go to the documentation of this file.
1 //===- IPDBSession.h - base interface for a PDB symbol context --*- 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_IPDBSESSION_H
11 #define LLVM_DEBUGINFO_PDB_IPDBSESSION_H
12 
13 #include "PDBSymbol.h"
14 #include "PDBTypes.h"
15 #include "llvm/ADT/StringRef.h"
16 #include "llvm/Support/Casting.h"
17 #include <memory>
18 
19 namespace llvm {
20 namespace pdb {
21 class PDBSymbolCompiland;
22 class PDBSymbolExe;
23 
24 /// IPDBSession defines an interface used to provide a context for querying
25 /// debug information from a debug data source (for example, a PDB).
26 class IPDBSession {
27 public:
28  virtual ~IPDBSession();
29 
30  virtual uint64_t getLoadAddress() const = 0;
31  virtual void setLoadAddress(uint64_t Address) = 0;
32  virtual std::unique_ptr<PDBSymbolExe> getGlobalScope() = 0;
33  virtual std::unique_ptr<PDBSymbol> getSymbolById(uint32_t SymbolId) const = 0;
34 
35  template <typename T>
36  std::unique_ptr<T> getConcreteSymbolById(uint32_t SymbolId) const {
37  return unique_dyn_cast_or_null<T>(getSymbolById(SymbolId));
38  }
39 
40  virtual std::unique_ptr<PDBSymbol>
41  findSymbolByAddress(uint64_t Address, PDB_SymType Type) const = 0;
42 
43  virtual std::unique_ptr<IPDBEnumLineNumbers>
45  const IPDBSourceFile &File) const = 0;
46  virtual std::unique_ptr<IPDBEnumLineNumbers>
47  findLineNumbersByAddress(uint64_t Address, uint32_t Length) const = 0;
48 
49  virtual std::unique_ptr<IPDBEnumSourceFiles>
50  findSourceFiles(const PDBSymbolCompiland *Compiland, llvm::StringRef Pattern,
51  PDB_NameSearchFlags Flags) const = 0;
52  virtual std::unique_ptr<IPDBSourceFile>
53  findOneSourceFile(const PDBSymbolCompiland *Compiland,
54  llvm::StringRef Pattern,
55  PDB_NameSearchFlags Flags) const = 0;
56  virtual std::unique_ptr<IPDBEnumChildren<PDBSymbolCompiland>>
58  PDB_NameSearchFlags Flags) const = 0;
59  virtual std::unique_ptr<PDBSymbolCompiland>
61  PDB_NameSearchFlags Flags) const = 0;
62 
63  virtual std::unique_ptr<IPDBEnumSourceFiles> getAllSourceFiles() const = 0;
64  virtual std::unique_ptr<IPDBEnumSourceFiles>
65  getSourceFilesForCompiland(const PDBSymbolCompiland &Compiland) const = 0;
66  virtual std::unique_ptr<IPDBSourceFile>
67  getSourceFileById(uint32_t FileId) const = 0;
68 
69  virtual std::unique_ptr<IPDBEnumDataStreams> getDebugStreams() const = 0;
70 
71  virtual std::unique_ptr<IPDBEnumTables> getEnumTables() const = 0;
72 };
73 }
74 }
75 
76 #endif
IPDBSession defines an interface used to provide a context for querying debug information from a debu...
Definition: IPDBSession.h:26
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
PDB_NameSearchFlags
Defines flags used for enumerating child symbols.
Definition: PDBTypes.h:92
IPDBSourceFile defines an interface used to represent source files whose information are stored in th...
virtual uint64_t getLoadAddress() const =0
virtual std::unique_ptr< IPDBEnumTables > getEnumTables() const =0
virtual std::unique_ptr< IPDBEnumSourceFiles > getSourceFilesForCompiland(const PDBSymbolCompiland &Compiland) const =0
virtual void setLoadAddress(uint64_t Address)=0
virtual std::unique_ptr< IPDBEnumChildren< PDBSymbolCompiland > > findCompilandsForSourceFile(llvm::StringRef Pattern, PDB_NameSearchFlags Flags) const =0
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:162
virtual std::unique_ptr< IPDBEnumLineNumbers > findLineNumbersByAddress(uint64_t Address, uint32_t Length) const =0
The instances of the Type class are immutable: once they are created, they are never changed...
Definition: Type.h:46
std::unique_ptr< T > getConcreteSymbolById(uint32_t SymbolId) const
Definition: IPDBSession.h:36
virtual std::unique_ptr< PDBSymbolCompiland > findOneCompilandForSourceFile(llvm::StringRef Pattern, PDB_NameSearchFlags Flags) const =0
virtual std::unique_ptr< PDBSymbol > getSymbolById(uint32_t SymbolId) const =0
virtual std::unique_ptr< IPDBSourceFile > getSourceFileById(uint32_t FileId) const =0
virtual std::unique_ptr< IPDBSourceFile > findOneSourceFile(const PDBSymbolCompiland *Compiland, llvm::StringRef Pattern, PDB_NameSearchFlags Flags) const =0
virtual std::unique_ptr< IPDBEnumDataStreams > getDebugStreams() const =0
virtual std::unique_ptr< PDBSymbol > findSymbolByAddress(uint64_t Address, PDB_SymType Type) const =0
virtual std::unique_ptr< PDBSymbolExe > getGlobalScope()=0
virtual std::unique_ptr< IPDBEnumSourceFiles > findSourceFiles(const PDBSymbolCompiland *Compiland, llvm::StringRef Pattern, PDB_NameSearchFlags Flags) const =0
virtual std::unique_ptr< IPDBEnumSourceFiles > getAllSourceFiles() const =0
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
virtual std::unique_ptr< IPDBEnumLineNumbers > findLineNumbers(const PDBSymbolCompiland &Compiland, const IPDBSourceFile &File) const =0