1 //===- ModuleDebugStream.h - PDB Module Info Stream Access ------*- C++ -*-===//
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_NATIVE_MODULEDEBUGSTREAM_H
11 #define LLVM_DEBUGINFO_PDB_NATIVE_MODULEDEBUGSTREAM_H
13 #include "llvm/ADT/iterator_range.h"
14 #include "llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h"
15 #include "llvm/DebugInfo/CodeView/DebugSubsectionRecord.h"
16 #include "llvm/DebugInfo/CodeView/SymbolRecord.h"
17 #include "llvm/DebugInfo/MSF/MappedBlockStream.h"
18 #include "llvm/Support/BinaryStreamRef.h"
19 #include "llvm/Support/Error.h"
26 class DbiModuleDescriptor;
28 class ModuleDebugStreamRef {
29 using DebugSubsectionIterator = codeview::DebugSubsectionArray::Iterator;
32 ModuleDebugStreamRef(const DbiModuleDescriptor &Module,
33 std::unique_ptr<msf::MappedBlockStream> Stream);
34 ModuleDebugStreamRef(ModuleDebugStreamRef &&Other) = default;
35 ModuleDebugStreamRef(const ModuleDebugStreamRef &Other) = default;
36 ~ModuleDebugStreamRef();
40 uint32_t signature() const { return Signature; }
42 iterator_range<codeview::CVSymbolArray::Iterator>
43 symbols(bool *HadError) const;
45 const codeview::CVSymbolArray &getSymbolArray() const { return SymbolArray; }
47 BinarySubstreamRef getSymbolsSubstream() const;
48 BinarySubstreamRef getC11LinesSubstream() const;
49 BinarySubstreamRef getC13LinesSubstream() const;
50 BinarySubstreamRef getGlobalRefsSubstream() const;
52 ModuleDebugStreamRef &operator=(ModuleDebugStreamRef &&Other) = delete;
54 iterator_range<DebugSubsectionIterator> subsections() const;
55 codeview::DebugSubsectionArray getSubsectionsArray() const {
59 bool hasDebugSubsections() const;
63 Expected<codeview::DebugChecksumsSubsectionRef>
64 findChecksumsSubsection() const;
67 const DbiModuleDescriptor &Mod;
71 std::shared_ptr<msf::MappedBlockStream> Stream;
73 codeview::CVSymbolArray SymbolArray;
75 BinarySubstreamRef SymbolsSubstream;
76 BinarySubstreamRef C11LinesSubstream;
77 BinarySubstreamRef C13LinesSubstream;
78 BinarySubstreamRef GlobalRefsSubstream;
80 codeview::DebugSubsectionArray Subsections;
83 } // end namespace pdb
84 } // end namespace llvm
86 #endif // LLVM_DEBUGINFO_PDB_NATIVE_MODULEDEBUGSTREAM_H