ModuleDebugStream.h revision 319547
1//===- ModuleDebugStream.h - PDB Module Info Stream Access ----------------===//
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_RAW_MODULEDEBUGSTREAM_H
11#define LLVM_DEBUGINFO_PDB_RAW_MODULEDEBUGSTREAM_H
12
13#include "llvm/ADT/iterator_range.h"
14#include "llvm/DebugInfo/CodeView/CVRecord.h"
15#include "llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h"
16#include "llvm/DebugInfo/CodeView/DebugSubsectionRecord.h"
17#include "llvm/DebugInfo/CodeView/SymbolRecord.h"
18#include "llvm/DebugInfo/MSF/MappedBlockStream.h"
19#include "llvm/Support/BinaryStreamArray.h"
20#include "llvm/Support/BinaryStreamRef.h"
21#include "llvm/Support/Error.h"
22
23namespace llvm {
24namespace pdb {
25class PDBFile;
26class DbiModuleDescriptor;
27
28class ModuleDebugStreamRef {
29  typedef codeview::DebugSubsectionArray::Iterator DebugSubsectionIterator;
30
31public:
32  ModuleDebugStreamRef(const DbiModuleDescriptor &Module,
33                       std::unique_ptr<msf::MappedBlockStream> Stream);
34  ~ModuleDebugStreamRef();
35
36  Error reload();
37
38  uint32_t signature() const { return Signature; }
39
40  iterator_range<codeview::CVSymbolArray::Iterator>
41  symbols(bool *HadError) const;
42
43  llvm::iterator_range<DebugSubsectionIterator> subsections() const;
44
45  bool hasDebugSubsections() const;
46
47  Error commit();
48
49  Expected<codeview::DebugChecksumsSubsectionRef>
50  findChecksumsSubsection() const;
51
52private:
53  const DbiModuleDescriptor &Mod;
54
55  uint32_t Signature;
56
57  std::unique_ptr<msf::MappedBlockStream> Stream;
58
59  codeview::CVSymbolArray SymbolsSubstream;
60  BinaryStreamRef C11LinesSubstream;
61  BinaryStreamRef C13LinesSubstream;
62  BinaryStreamRef GlobalRefsSubstream;
63
64  codeview::DebugSubsectionArray Subsections;
65};
66}
67}
68
69#endif
70