summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/DebugInfo/PDB/Raw/PublicsStream.h2
-rw-r--r--lib/DebugInfo/PDB/Raw/PublicsStream.cpp8
-rw-r--r--test/DebugInfo/PDB/pdbdump-headers.test1
-rw-r--r--tools/llvm-pdbdump/llvm-pdbdump.cpp1
4 files changed, 10 insertions, 2 deletions
diff --git a/include/llvm/DebugInfo/PDB/Raw/PublicsStream.h b/include/llvm/DebugInfo/PDB/Raw/PublicsStream.h
index a3cfdb81170..522a32fdb53 100644
--- a/include/llvm/DebugInfo/PDB/Raw/PublicsStream.h
+++ b/include/llvm/DebugInfo/PDB/Raw/PublicsStream.h
@@ -39,6 +39,7 @@ public:
ArrayRef<uint32_t> getHashBuckets() const { return HashBuckets; }
ArrayRef<uint32_t> getAddressMap() const { return AddressMap; }
ArrayRef<uint32_t> getThunkMap() const { return ThunkMap; }
+ ArrayRef<uint32_t> getSectionOffsets() const { return SectionOffsets; }
private:
uint32_t StreamNum;
@@ -47,6 +48,7 @@ private:
std::vector<uint32_t> HashBuckets;
std::vector<uint32_t> AddressMap;
std::vector<uint32_t> ThunkMap;
+ std::vector<uint32_t> SectionOffsets;
std::unique_ptr<HeaderInfo> Header;
std::unique_ptr<GSIHashHeader> HashHdr;
diff --git a/lib/DebugInfo/PDB/Raw/PublicsStream.cpp b/lib/DebugInfo/PDB/Raw/PublicsStream.cpp
index 8e984058fff..eef5b1d79b2 100644
--- a/lib/DebugInfo/PDB/Raw/PublicsStream.cpp
+++ b/lib/DebugInfo/PDB/Raw/PublicsStream.cpp
@@ -164,10 +164,14 @@ Error PublicsStream::reload() {
std::copy(TempThunkMap.begin(), TempThunkMap.end(), ThunkMap.begin());
// Something called "section map" follows.
- std::vector<SectionOffset> SectionMap(Header->NumSections);
- if (auto EC = Reader.readArray<SectionOffset>(SectionMap))
+ std::vector<SectionOffset> Offsets(Header->NumSections);
+ if (auto EC = Reader.readArray<SectionOffset>(Offsets))
return make_error<RawError>(raw_error_code::corrupt_file,
"Could not read a section map.");
+ for (auto &SO : Offsets) {
+ SectionOffsets.push_back(SO.Off);
+ SectionOffsets.push_back(SO.Isect);
+ }
if (Reader.bytesRemaining() > 0)
return make_error<RawError>(raw_error_code::corrupt_file,
diff --git a/test/DebugInfo/PDB/pdbdump-headers.test b/test/DebugInfo/PDB/pdbdump-headers.test
index facbc200c36..1b11f7adcef 100644
--- a/test/DebugInfo/PDB/pdbdump-headers.test
+++ b/test/DebugInfo/PDB/pdbdump-headers.test
@@ -316,6 +316,7 @@
; EMPTY-NEXT: Hash Buckets: [0, 12]
; EMPTY-NEXT: Address Map: [36, 0]
; EMPTY-NEXT: Thunk Map: [4112]
+; EMPTY-NEXT: Section Offsets: [4096, 1]
; EMPTY-NEXT: }
; BIG: FileHeaders {
diff --git a/tools/llvm-pdbdump/llvm-pdbdump.cpp b/tools/llvm-pdbdump/llvm-pdbdump.cpp
index 362b03dab32..960accfa779 100644
--- a/tools/llvm-pdbdump/llvm-pdbdump.cpp
+++ b/tools/llvm-pdbdump/llvm-pdbdump.cpp
@@ -414,6 +414,7 @@ static Error dumpPublicsStream(ScopedPrinter &P, PDBFile &File) {
P.printList("Hash Buckets", Publics.getHashBuckets());
P.printList("Address Map", Publics.getAddressMap());
P.printList("Thunk Map", Publics.getThunkMap());
+ P.printList("Section Offsets", Publics.getSectionOffsets());
return Error::success();
}