diff options
Diffstat (limited to 'include/llvm/DebugInfo/PDB')
13 files changed, 57 insertions, 17 deletions
diff --git a/include/llvm/DebugInfo/PDB/DIA/DIASession.h b/include/llvm/DebugInfo/PDB/DIA/DIASession.h index 3f5818631e7bc..350442556bef8 100644 --- a/include/llvm/DebugInfo/PDB/DIA/DIASession.h +++ b/include/llvm/DebugInfo/PDB/DIA/DIASession.h @@ -31,7 +31,7 @@ public: uint64_t getLoadAddress() const override; void setLoadAddress(uint64_t Address) override; - std::unique_ptr<PDBSymbolExe> getGlobalScope() const override; + std::unique_ptr<PDBSymbolExe> getGlobalScope() override; std::unique_ptr<PDBSymbol> getSymbolById(uint32_t SymbolId) const override; std::unique_ptr<PDBSymbol> diff --git a/include/llvm/DebugInfo/PDB/IPDBSession.h b/include/llvm/DebugInfo/PDB/IPDBSession.h index 85d9fe1248599..cf195095c8d22 100644 --- a/include/llvm/DebugInfo/PDB/IPDBSession.h +++ b/include/llvm/DebugInfo/PDB/IPDBSession.h @@ -29,7 +29,7 @@ public: virtual uint64_t getLoadAddress() const = 0; virtual void setLoadAddress(uint64_t Address) = 0; - virtual std::unique_ptr<PDBSymbolExe> getGlobalScope() const = 0; + virtual std::unique_ptr<PDBSymbolExe> getGlobalScope() = 0; virtual std::unique_ptr<PDBSymbol> getSymbolById(uint32_t SymbolId) const = 0; template <typename T> diff --git a/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.h b/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.h index a89e26ae943c9..e4cb1b24e30d0 100644 --- a/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.h +++ b/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.h @@ -14,6 +14,7 @@ #include "llvm/DebugInfo/CodeView/DebugChecksumsSubsection.h" #include "llvm/DebugInfo/CodeView/DebugInlineeLinesSubsection.h" #include "llvm/DebugInfo/CodeView/DebugLinesSubsection.h" +#include "llvm/DebugInfo/CodeView/DebugSubsectionRecord.h" #include "llvm/DebugInfo/CodeView/SymbolRecord.h" #include "llvm/DebugInfo/PDB/Native/RawTypes.h" #include "llvm/Support/Error.h" @@ -52,6 +53,9 @@ public: void addDebugSubsection(std::shared_ptr<codeview::DebugSubsection> Subsection); + void + addDebugSubsection(const codeview::DebugSubsectionRecord &SubsectionContents); + uint16_t getStreamIndex() const; StringRef getModuleName() const { return ModuleName; } StringRef getObjFileName() const { return ObjFileName; } diff --git a/include/llvm/DebugInfo/PDB/Native/DbiStream.h b/include/llvm/DebugInfo/PDB/Native/DbiStream.h index 7123e88cd6423..3bf7907266564 100644 --- a/include/llvm/DebugInfo/PDB/Native/DbiStream.h +++ b/include/llvm/DebugInfo/PDB/Native/DbiStream.h @@ -63,6 +63,13 @@ public: PDB_Machine getMachineType() const; + BinarySubstreamRef getSectionContributionData() const; + BinarySubstreamRef getSecMapSubstreamData() const; + BinarySubstreamRef getModiSubstreamData() const; + BinarySubstreamRef getFileInfoSubstreamData() const; + BinarySubstreamRef getTypeServerMapSubstreamData() const; + BinarySubstreamRef getECSubstreamData() const; + /// If the given stream type is present, returns its stream index. If it is /// not present, returns InvalidStreamIndex. uint32_t getDebugStreamIndex(DbgHeaderType Type) const; @@ -87,10 +94,12 @@ private: PDBStringTable ECNames; - BinaryStreamRef SecContrSubstream; - BinaryStreamRef SecMapSubstream; - BinaryStreamRef TypeServerMapSubstream; - BinaryStreamRef ECSubstream; + BinarySubstreamRef SecContrSubstream; + BinarySubstreamRef SecMapSubstream; + BinarySubstreamRef ModiSubstream; + BinarySubstreamRef FileInfoSubstream; + BinarySubstreamRef TypeServerMapSubstream; + BinarySubstreamRef ECSubstream; DbiModuleList Modules; diff --git a/include/llvm/DebugInfo/PDB/Native/DbiStreamBuilder.h b/include/llvm/DebugInfo/PDB/Native/DbiStreamBuilder.h index aeb2e2ab026a5..744411854181f 100644 --- a/include/llvm/DebugInfo/PDB/Native/DbiStreamBuilder.h +++ b/include/llvm/DebugInfo/PDB/Native/DbiStreamBuilder.h @@ -58,6 +58,7 @@ public: Expected<DbiModuleDescriptorBuilder &> addModuleInfo(StringRef ModuleName); Error addModuleSourceFile(StringRef Module, StringRef File); + Error addModuleSourceFile(DbiModuleDescriptorBuilder &Module, StringRef File); Expected<uint32_t> getSourceFileNameIndex(StringRef FileName); Error finalizeMsfLayout(); diff --git a/include/llvm/DebugInfo/PDB/Native/InfoStream.h b/include/llvm/DebugInfo/PDB/Native/InfoStream.h index fc91fc7097bd4..37bf5f3b573c3 100644 --- a/include/llvm/DebugInfo/PDB/Native/InfoStream.h +++ b/include/llvm/DebugInfo/PDB/Native/InfoStream.h @@ -47,6 +47,8 @@ public: const NamedStreamMap &getNamedStreams() const; + BinarySubstreamRef getNamedStreamsBuffer() const; + uint32_t getNamedStreamIndex(llvm::StringRef Name) const; iterator_range<StringMapConstIterator<uint32_t>> named_streams() const; @@ -71,6 +73,8 @@ private: // universally unique. PDB_UniqueId Guid; + BinarySubstreamRef SubNamedStreams; + std::vector<PdbRaw_FeatureSig> FeatureSignatures; PdbRaw_Features Features = PdbFeatureNone; diff --git a/include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h b/include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h index c744696ae2508..5565cd5582bc9 100644 --- a/include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h +++ b/include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h @@ -41,9 +41,12 @@ public: iterator_range<codeview::CVSymbolArray::Iterator> symbols(bool *HadError) const; - const codeview::CVSymbolArray &getSymbolArray() const { - return SymbolsSubstream; - } + const codeview::CVSymbolArray &getSymbolArray() const { return SymbolArray; } + + BinarySubstreamRef getSymbolsSubstream() const; + BinarySubstreamRef getC11LinesSubstream() const; + BinarySubstreamRef getC13LinesSubstream() const; + BinarySubstreamRef getGlobalRefsSubstream() const; ModuleDebugStreamRef &operator=(ModuleDebugStreamRef &&Other) = default; @@ -63,10 +66,12 @@ private: std::shared_ptr<msf::MappedBlockStream> Stream; - codeview::CVSymbolArray SymbolsSubstream; - BinaryStreamRef C11LinesSubstream; - BinaryStreamRef C13LinesSubstream; - BinaryStreamRef GlobalRefsSubstream; + codeview::CVSymbolArray SymbolArray; + + BinarySubstreamRef SymbolsSubstream; + BinarySubstreamRef C11LinesSubstream; + BinarySubstreamRef C13LinesSubstream; + BinarySubstreamRef GlobalRefsSubstream; codeview::DebugSubsectionArray Subsections; }; diff --git a/include/llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h b/include/llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h index 22ed61910d94a..1687737f0e7f9 100644 --- a/include/llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h +++ b/include/llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h @@ -18,7 +18,11 @@ namespace pdb { class NativeCompilandSymbol : public NativeRawSymbol { public: - NativeCompilandSymbol(NativeSession &Session, DbiModuleDescriptor MI); + NativeCompilandSymbol(NativeSession &Session, uint32_t SymbolId, + DbiModuleDescriptor MI); + + std::unique_ptr<NativeRawSymbol> clone() const override; + PDB_SymType getSymTag() const override; bool isEditAndContinueEnabled() const override; uint32_t getLexicalParentId() const override; diff --git a/include/llvm/DebugInfo/PDB/Native/NativeExeSymbol.h b/include/llvm/DebugInfo/PDB/Native/NativeExeSymbol.h index 9516810539b6b..15bac78df191b 100644 --- a/include/llvm/DebugInfo/PDB/Native/NativeExeSymbol.h +++ b/include/llvm/DebugInfo/PDB/Native/NativeExeSymbol.h @@ -18,7 +18,9 @@ namespace pdb { class NativeExeSymbol : public NativeRawSymbol { public: - NativeExeSymbol(NativeSession &Session); + NativeExeSymbol(NativeSession &Session, uint32_t SymbolId); + + std::unique_ptr<NativeRawSymbol> clone() const override; std::unique_ptr<IPDBEnumSymbols> findChildren(PDB_SymType Type) const override; diff --git a/include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h b/include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h index e1e78035ff389..5e4aaafff1a90 100644 --- a/include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h +++ b/include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h @@ -19,7 +19,9 @@ class NativeSession; class NativeRawSymbol : public IPDBRawSymbol { public: - explicit NativeRawSymbol(NativeSession &PDBSession); + NativeRawSymbol(NativeSession &PDBSession, uint32_t SymbolId); + + virtual std::unique_ptr<NativeRawSymbol> clone() const = 0; void dump(raw_ostream &OS, int Indent) const override; @@ -201,6 +203,7 @@ public: protected: NativeSession &Session; + uint32_t SymbolId; }; } diff --git a/include/llvm/DebugInfo/PDB/Native/NativeSession.h b/include/llvm/DebugInfo/PDB/Native/NativeSession.h index e6da266f796d5..bbe207738e021 100644 --- a/include/llvm/DebugInfo/PDB/Native/NativeSession.h +++ b/include/llvm/DebugInfo/PDB/Native/NativeSession.h @@ -32,7 +32,7 @@ public: uint64_t getLoadAddress() const override; void setLoadAddress(uint64_t Address) override; - std::unique_ptr<PDBSymbolExe> getGlobalScope() const override; + std::unique_ptr<PDBSymbolExe> getGlobalScope() override; std::unique_ptr<PDBSymbol> getSymbolById(uint32_t SymbolId) const override; std::unique_ptr<PDBSymbol> diff --git a/include/llvm/DebugInfo/PDB/Native/PDBFile.h b/include/llvm/DebugInfo/PDB/Native/PDBFile.h index 4d3c569c3cdfb..4f6ad115e7dfd 100644 --- a/include/llvm/DebugInfo/PDB/Native/PDBFile.h +++ b/include/llvm/DebugInfo/PDB/Native/PDBFile.h @@ -13,6 +13,7 @@ #include "llvm/ADT/DenseMap.h" #include "llvm/DebugInfo/MSF/IMSFFile.h" #include "llvm/DebugInfo/MSF/MSFCommon.h" +#include "llvm/DebugInfo/MSF/MSFStreamLayout.h" #include "llvm/Support/Allocator.h" #include "llvm/Support/BinaryStreamRef.h" #include "llvm/Support/Endian.h" @@ -85,6 +86,8 @@ public: ArrayRef<support::ulittle32_t> getDirectoryBlockArray() const; + msf::MSFStreamLayout getStreamLayout(uint32_t StreamIdx) const; + Error parseFileHeaders(); Error parseStreamData(); diff --git a/include/llvm/DebugInfo/PDB/Native/TpiStream.h b/include/llvm/DebugInfo/PDB/Native/TpiStream.h index 0ee697696ca54..d3475205a6c26 100644 --- a/include/llvm/DebugInfo/PDB/Native/TpiStream.h +++ b/include/llvm/DebugInfo/PDB/Native/TpiStream.h @@ -16,6 +16,7 @@ #include "llvm/DebugInfo/PDB/Native/RawTypes.h" #include "llvm/DebugInfo/PDB/PDBTypes.h" #include "llvm/Support/BinaryStreamArray.h" +#include "llvm/Support/BinaryStreamRef.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Support/Error.h" @@ -57,6 +58,8 @@ public: codeview::LazyRandomTypeCollection &typeCollection() { return *Types; } + BinarySubstreamRef getTypeRecordsSubstream() const; + Error commit(); private: @@ -65,6 +68,8 @@ private: std::unique_ptr<codeview::LazyRandomTypeCollection> Types; + BinarySubstreamRef TypeRecordsSubstream; + codeview::CVTypeArray TypeRecords; std::unique_ptr<BinaryStream> HashStream; |