LLVM  14.0.0git
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
llvm::pdb::ModuleDebugStreamRef::getGlobalRefsSubstream
BinarySubstreamRef getGlobalRefsSubstream() const
Definition: ModuleDebugStream.cpp:106
llvm::pdb::ModuleDebugStreamRef::operator=
ModuleDebugStreamRef & operator=(ModuleDebugStreamRef &&Other)=delete
llvm::pdb::ModuleDebugStreamRef::subsections
iterator_range< DebugSubsectionIterator > subsections() const
Definition: ModuleDebugStream.cpp:122
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
llvm::pdb::ModuleDebugStreamRef::getSymbolArrayForScope
const codeview::CVSymbolArray getSymbolArrayForScope(uint32_t ScopeBegin) const
Definition: ModuleDebugStream.cpp:90
llvm::pdb::ModuleDebugStreamRef::commit
Error commit()
Definition: ModuleDebugStream.cpp:130
llvm::pdb::ModuleDebugStreamRef::readSymbolAtOffset
codeview::CVSymbol readSymbolAtOffset(uint32_t Offset) const
Definition: ModuleDebugStream.cpp:115
llvm::pdb::ModuleDebugStreamRef
Definition: ModuleDebugStream.h:28
llvm::pdb::ModuleDebugStreamRef::signature
uint32_t signature() const
Definition: ModuleDebugStream.h:40
llvm::pdb::ModuleDebugStreamRef::getC13LinesSubstream
BinarySubstreamRef getC13LinesSubstream() const
Definition: ModuleDebugStream.cpp:102
SymbolRecord.h
DbiModuleDescriptor.h
Error.h
Offset
uint64_t Offset
Definition: ELFObjHandler.cpp:81
llvm::pdb::ModuleDebugStreamRef::findChecksumsSubsection
Expected< codeview::DebugChecksumsSubsectionRef > findChecksumsSubsection() const
Definition: ModuleDebugStream.cpp:133
llvm::Expected
Tagged union holding either a T or a Error.
Definition: APFloat.h:42
llvm::pdb::ModuleDebugStreamRef::symbols
iterator_range< codeview::CVSymbolArray::Iterator > symbols(bool *HadError) const
Definition: ModuleDebugStream.cpp:111
llvm::pdb::ModuleDebugStreamRef::~ModuleDebugStreamRef
~ModuleDebugStreamRef()
DebugChecksumsSubsection.h
DebugSubsectionRecord.h
llvm::BinarySubstreamRef
Definition: BinaryStreamRef.h:200
llvm::VarStreamArray< CVSymbol >
llvm::pdb::ModuleDebugStreamRef::ModuleDebugStreamRef
ModuleDebugStreamRef(const DbiModuleDescriptor &Module, std::unique_ptr< msf::MappedBlockStream > Stream)
llvm::VarStreamArray< DebugSubsectionRecord >::Iterator
VarStreamArrayIterator< DebugSubsectionRecord, VarStreamArrayExtractor< DebugSubsectionRecord > > Iterator
Definition: BinaryStreamArray.h:96
llvm::pdb::ModuleDebugStreamRef::getSymbolsSubstream
BinarySubstreamRef getSymbolsSubstream() const
Definition: ModuleDebugStream.cpp:94
llvm::BinaryStreamReader
Provides read only access to a subclass of BinaryStream.
Definition: BinaryStreamReader.h:31
llvm::pdb::ModuleDebugStreamRef::reload
Error reload()
Definition: ModuleDebugStream.cpp:37
MappedBlockStream.h
llvm::VarStreamArrayIterator
VarStreamArray represents an array of variable length records backed by a stream.
Definition: BinaryStreamArray.h:88
iterator_range.h
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:67
llvm::pdb::ModuleDebugStreamRef::getSymbolArray
const codeview::CVSymbolArray & getSymbolArray() const
Definition: ModuleDebugStream.h:45
BinaryStreamRef.h
llvm::codeview::CVRecord
CVRecord is a fat pointer (base + size pair) to a symbol or type record.
Definition: CVRecord.h:30
uint32_t
llvm::pdb::ModuleDebugStreamRef::hasDebugSubsections
bool hasDebugSubsections() const
Definition: ModuleDebugStream.cpp:126
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition: Error.h:157
llvm::iterator_range
A range adaptor for a pair of iterators.
Definition: iterator_range.h:30
llvm::pdb::ModuleDebugStreamRef::getC11LinesSubstream
BinarySubstreamRef getC11LinesSubstream() const
Definition: ModuleDebugStream.cpp:98
llvm::pdb::ModuleDebugStreamRef::getSubsectionsArray
codeview::DebugSubsectionArray getSubsectionsArray() const
Definition: ModuleDebugStream.h:59
llvm::pdb::DbiModuleDescriptor
Definition: DbiModuleDescriptor.h:23
Other
Optional< std::vector< StOtherPiece > > Other
Definition: ELFYAML.cpp:1172