LLVM  4.0.0
PDBContext.h
Go to the documentation of this file.
1 //===-- PDBContext.h --------------------------------------------*- 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_PDBCONTEXT_H
11 #define LLVM_DEBUGINFO_PDB_PDBCONTEXT_H
12 
15 #include <cstdint>
16 #include <memory>
17 #include <string>
18 
19 namespace llvm {
20 
21 namespace object {
22 class COFFObjectFile;
23 } // end namespace object
24 
25 namespace pdb {
26 
27  /// PDBContext
28  /// This data structure is the top level entity that deals with PDB debug
29  /// information parsing. This data structure exists only when there is a
30  /// need for a transparent interface to different debug information formats
31  /// (e.g. PDB and DWARF). More control and power over the debug information
32  /// access can be had by using the PDB interfaces directly.
33  class PDBContext : public DIContext {
34  public:
35  PDBContext(const object::COFFObjectFile &Object,
36  std::unique_ptr<IPDBSession> PDBSession);
37  PDBContext(PDBContext &) = delete;
38  PDBContext &operator=(PDBContext &) = delete;
39 
40  static bool classof(const DIContext *DICtx) {
41  return DICtx->getKind() == CK_PDB;
42  }
43 
44  void dump(raw_ostream &OS, DIDumpType DumpType = DIDT_All,
45  bool DumpEH = false, bool SummarizeTypes = false) override;
46 
48  uint64_t Address,
49  DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
51  uint64_t Address, uint64_t Size,
52  DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
54  uint64_t Address,
55  DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
56 
57  private:
58  std::string getFunctionName(uint64_t Address, DINameKind NameKind) const;
59  std::unique_ptr<IPDBSession> Session;
60  };
61 
62 } // end namespace pdb
63 
64 } // end namespace llvm
65 
66 #endif // LLVM_DEBUGINFO_PDB_PDBCONTEXT_H
DINameKind
A DINameKind is passed to name search methods to specify a preference regarding the type of name reso...
Definition: DIContext.h:97
DILineInfo - a format-neutral container for source line information.
Definition: DIContext.h:32
DIContextKind getKind() const
Definition: DIContext.h:157
static bool classof(const DIContext *DICtx)
Definition: PDBContext.h:40
PDBContext This data structure is the top level entity that deals with PDB debug information parsing...
Definition: PDBContext.h:33
DILineInfo getLineInfoForAddress(uint64_t Address, DILineInfoSpecifier Specifier=DILineInfoSpecifier()) override
Definition: PDBContext.cpp:35
PDBContext & operator=(PDBContext &)=delete
DILineInfoSpecifier - controls which fields of DILineInfo container should be filled with data...
Definition: DIContext.h:101
void dump(raw_ostream &OS, DIDumpType DumpType=DIDT_All, bool DumpEH=false, bool SummarizeTypes=false) override
Definition: PDBContext.cpp:32
DIInliningInfo - a format-neutral container for inlined code description.
Definition: DIContext.h:61
DIDumpType
Selects which debug sections get dumped.
Definition: DIContext.h:114
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Definition: SmallVector.h:843
DIInliningInfo getInliningInfoForAddress(uint64_t Address, DILineInfoSpecifier Specifier=DILineInfoSpecifier()) override
Definition: PDBContext.cpp:87
PDBContext(const object::COFFObjectFile &Object, std::unique_ptr< IPDBSession > PDBSession)
Definition: PDBContext.cpp:24
DILineInfoTable getLineInfoForAddressRange(uint64_t Address, uint64_t Size, DILineInfoSpecifier Specifier=DILineInfoSpecifier()) override
Definition: PDBContext.cpp:68
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:44