1 //===- ModuleDebugStream.h - PDB Module Info Stream Access ----------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_DEBUGINFO_PDB_RAW_MODULEDEBUGSTREAM_H
11 #define LLVM_DEBUGINFO_PDB_RAW_MODULEDEBUGSTREAM_H
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"
26 class DbiModuleDescriptor;
28 class ModuleDebugStreamRef {
29 typedef codeview::DebugSubsectionArray::Iterator DebugSubsectionIterator;
32 ModuleDebugStreamRef(const DbiModuleDescriptor &Module,
33 std::unique_ptr<msf::MappedBlockStream> Stream);
34 ModuleDebugStreamRef(ModuleDebugStreamRef &&Other) = default;
35 ~ModuleDebugStreamRef();
39 uint32_t signature() const { return Signature; }
41 iterator_range<codeview::CVSymbolArray::Iterator>
42 symbols(bool *HadError) const;
44 const codeview::CVSymbolArray &getSymbolArray() const { return SymbolArray; }
46 BinarySubstreamRef getSymbolsSubstream() const;
47 BinarySubstreamRef getC11LinesSubstream() const;
48 BinarySubstreamRef getC13LinesSubstream() const;
49 BinarySubstreamRef getGlobalRefsSubstream() const;
51 ModuleDebugStreamRef &operator=(ModuleDebugStreamRef &&Other) = default;
53 llvm::iterator_range<DebugSubsectionIterator> subsections() const;
55 bool hasDebugSubsections() const;
59 Expected<codeview::DebugChecksumsSubsectionRef>
60 findChecksumsSubsection() const;
63 const DbiModuleDescriptor &Mod;
67 std::shared_ptr<msf::MappedBlockStream> Stream;
69 codeview::CVSymbolArray SymbolArray;
71 BinarySubstreamRef SymbolsSubstream;
72 BinarySubstreamRef C11LinesSubstream;
73 BinarySubstreamRef C13LinesSubstream;
74 BinarySubstreamRef GlobalRefsSubstream;
76 codeview::DebugSubsectionArray Subsections;