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