LLVM  10.0.0svn
ModuleDebugStream.h
Go to the documentation of this file.
1 //===- ModuleDebugStream.h - PDB Module Info Stream Access ------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_DEBUGINFO_PDB_NATIVE_MODULEDEBUGSTREAM_H
10 #define LLVM_DEBUGINFO_PDB_NATIVE_MODULEDEBUGSTREAM_H
11 
19 #include "llvm/Support/Error.h"
20 #include <cstdint>
21 #include <memory>
22 
23 namespace llvm {
24 namespace pdb {
25 
26 class DbiModuleDescriptor;
27 
30 
31 public:
33  std::unique_ptr<msf::MappedBlockStream> Stream);
37 
38  Error reload();
39 
40  uint32_t signature() const { return Signature; }
41 
43  symbols(bool *HadError) const;
44 
45  const codeview::CVSymbolArray &getSymbolArray() const { return SymbolArray; }
47  getSymbolArrayForScope(uint32_t ScopeBegin) const;
48 
53 
55 
57 
60  return Subsections;
61  }
62 
63  bool hasDebugSubsections() const;
64 
65  Error commit();
66 
69 
70 private:
71  Error reloadSerialize(BinaryStreamReader &Reader);
72 
74 
75  uint32_t Signature;
76 
77  std::shared_ptr<msf::MappedBlockStream> Stream;
78 
79  codeview::CVSymbolArray SymbolArray;
80 
81  BinarySubstreamRef SymbolsSubstream;
82  BinarySubstreamRef C11LinesSubstream;
83  BinarySubstreamRef C13LinesSubstream;
84  BinarySubstreamRef GlobalRefsSubstream;
85 
87 };
88 
89 } // end namespace pdb
90 } // end namespace llvm
91 
92 #endif // LLVM_DEBUGINFO_PDB_NATIVE_MODULEDEBUGSTREAM_H
ModuleDebugStreamRef(const DbiModuleDescriptor &Module, std::unique_ptr< msf::MappedBlockStream > Stream)
const codeview::CVSymbolArray getSymbolArrayForScope(uint32_t ScopeBegin) const
This class represents lattice values for constants.
Definition: AllocatorList.h:23
A Module instance is used to store all the information related to an LLVM module. ...
Definition: Module.h:65
Expected< codeview::DebugChecksumsSubsectionRef > findChecksumsSubsection() const
This provides a very simple, boring adaptor for a begin and end iterator into a range type...
BinarySubstreamRef getC13LinesSubstream() const
iterator_range< DebugSubsectionIterator > subsections() const
codeview::CVSymbol readSymbolAtOffset(uint32_t Offset) const
ModuleDebugStreamRef & operator=(ModuleDebugStreamRef &&Other)=delete
Tagged union holding either a T or a Error.
Definition: yaml2obj.h:21
ELFYAML::ELF_STO Other
Definition: ELFYAML.cpp:877
VarStreamArrayIterator< DebugSubsectionRecord, VarStreamArrayExtractor< DebugSubsectionRecord > > Iterator
const codeview::CVSymbolArray & getSymbolArray() const
codeview::DebugSubsectionArray getSubsectionsArray() const
iterator_range< codeview::CVSymbolArray::Iterator > symbols(bool *HadError) const
VarStreamArray represents an array of variable length records backed by a stream. ...
BinarySubstreamRef getC11LinesSubstream() const
BinarySubstreamRef getSymbolsSubstream() const
A range adaptor for a pair of iterators.
BinarySubstreamRef getGlobalRefsSubstream() const
Lightweight error class with error context and mandatory checking.
Definition: Error.h:157
Provides read only access to a subclass of BinaryStream.
CVRecord is a fat pointer (base + size pair) to a symbol or type record.
Definition: CVRecord.h:30