LLVM  15.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 
17 #include "llvm/Support/Error.h"
18 #include <cstdint>
19 #include <memory>
20 
21 namespace llvm {
22 class BinaryStreamReader;
23 namespace codeview {
24 class DebugChecksumsSubsectionRef;
25 }
26 namespace msf {
27 class MappedBlockStream;
28 }
29 namespace pdb {
30 
33 
34 public:
36  std::unique_ptr<msf::MappedBlockStream> Stream);
40 
41  Error reload();
42 
43  uint32_t signature() const { return Signature; }
44 
46  symbols(bool *HadError) const;
47 
48  const codeview::CVSymbolArray &getSymbolArray() const { return SymbolArray; }
50  getSymbolArrayForScope(uint32_t ScopeBegin) const;
51 
56 
58 
60 
63  return Subsections;
64  }
65 
66  bool hasDebugSubsections() const;
67 
68  Error commit();
69 
72 
73 private:
74  Error reloadSerialize(BinaryStreamReader &Reader);
75 
77 
78  uint32_t Signature;
79 
80  std::shared_ptr<msf::MappedBlockStream> Stream;
81 
82  codeview::CVSymbolArray SymbolArray;
83 
84  BinarySubstreamRef SymbolsSubstream;
85  BinarySubstreamRef C11LinesSubstream;
86  BinarySubstreamRef C13LinesSubstream;
87  BinarySubstreamRef GlobalRefsSubstream;
88 
90 };
91 
92 } // end namespace pdb
93 } // end namespace llvm
94 
95 #endif // LLVM_DEBUGINFO_PDB_NATIVE_MODULEDEBUGSTREAM_H
llvm::pdb::ModuleDebugStreamRef::getGlobalRefsSubstream
BinarySubstreamRef getGlobalRefsSubstream() const
Definition: ModuleDebugStream.cpp:107
llvm::pdb::ModuleDebugStreamRef::operator=
ModuleDebugStreamRef & operator=(ModuleDebugStreamRef &&Other)=delete
llvm::pdb::ModuleDebugStreamRef::subsections
iterator_range< DebugSubsectionIterator > subsections() const
Definition: ModuleDebugStream.cpp:123
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
llvm::pdb::ModuleDebugStreamRef::getSymbolArrayForScope
const codeview::CVSymbolArray getSymbolArrayForScope(uint32_t ScopeBegin) const
Definition: ModuleDebugStream.cpp:91
llvm::pdb::ModuleDebugStreamRef::commit
Error commit()
Definition: ModuleDebugStream.cpp:131
llvm::pdb::ModuleDebugStreamRef::readSymbolAtOffset
codeview::CVSymbol readSymbolAtOffset(uint32_t Offset) const
Definition: ModuleDebugStream.cpp:116
llvm::pdb::ModuleDebugStreamRef
Definition: ModuleDebugStream.h:31
llvm::pdb::ModuleDebugStreamRef::signature
uint32_t signature() const
Definition: ModuleDebugStream.h:43
llvm::pdb::ModuleDebugStreamRef::getC13LinesSubstream
BinarySubstreamRef getC13LinesSubstream() const
Definition: ModuleDebugStream.cpp:103
DbiModuleDescriptor.h
Error.h
llvm::pdb::ModuleDebugStreamRef::findChecksumsSubsection
Expected< codeview::DebugChecksumsSubsectionRef > findChecksumsSubsection() const
Definition: ModuleDebugStream.cpp:134
llvm::Expected
Tagged union holding either a T or a Error.
Definition: APFloat.h:41
llvm::pdb::ModuleDebugStreamRef::symbols
iterator_range< codeview::CVSymbolArray::Iterator > symbols(bool *HadError) const
Definition: ModuleDebugStream.cpp:112
llvm::pdb::ModuleDebugStreamRef::~ModuleDebugStreamRef
~ModuleDebugStreamRef()
DebugSubsectionRecord.h
llvm::BinarySubstreamRef
Definition: BinaryStreamRef.h:199
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:95
llvm::BinaryStreamReader
Provides read only access to a subclass of BinaryStream.
Definition: BinaryStreamReader.h:29
llvm::pdb::ModuleDebugStreamRef::reload
Error reload()
Definition: ModuleDebugStream.cpp:38
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:65
llvm::pdb::ModuleDebugStreamRef::getSymbolArray
const codeview::CVSymbolArray & getSymbolArray() const
Definition: ModuleDebugStream.h:48
BinaryStreamRef.h
llvm::codeview::CVRecord
CVRecord is a fat pointer (base + size pair) to a symbol or type record.
Definition: CVRecord.h:29
uint32_t
llvm::pdb::ModuleDebugStreamRef::hasDebugSubsections
bool hasDebugSubsections() const
Definition: ModuleDebugStream.cpp:127
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition: Error.h:155
CVRecord.h
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:99
llvm::pdb::ModuleDebugStreamRef::getSubsectionsArray
codeview::DebugSubsectionArray getSubsectionsArray() const
Definition: ModuleDebugStream.h:62
llvm::pdb::DbiModuleDescriptor
Definition: DbiModuleDescriptor.h:23
Other
Optional< std::vector< StOtherPiece > > Other
Definition: ELFYAML.cpp:1236