[llvm] r269955 - pdbdump: Print out section offsets in the publics stream.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed May 18 09:24:16 PDT 2016


Author: ruiu
Date: Wed May 18 11:24:16 2016
New Revision: 269955

URL: http://llvm.org/viewvc/llvm-project?rev=269955&view=rev
Log:
pdbdump: Print out section offsets in the publics stream.

Modified:
    llvm/trunk/include/llvm/DebugInfo/PDB/Raw/PublicsStream.h
    llvm/trunk/lib/DebugInfo/PDB/Raw/PublicsStream.cpp
    llvm/trunk/test/DebugInfo/PDB/pdbdump-headers.test
    llvm/trunk/tools/llvm-pdbdump/llvm-pdbdump.cpp

Modified: llvm/trunk/include/llvm/DebugInfo/PDB/Raw/PublicsStream.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/Raw/PublicsStream.h?rev=269955&r1=269954&r2=269955&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DebugInfo/PDB/Raw/PublicsStream.h (original)
+++ llvm/trunk/include/llvm/DebugInfo/PDB/Raw/PublicsStream.h Wed May 18 11:24:16 2016
@@ -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;

Modified: llvm/trunk/lib/DebugInfo/PDB/Raw/PublicsStream.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/Raw/PublicsStream.cpp?rev=269955&r1=269954&r2=269955&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/Raw/PublicsStream.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/Raw/PublicsStream.cpp Wed May 18 11:24:16 2016
@@ -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,

Modified: llvm/trunk/test/DebugInfo/PDB/pdbdump-headers.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/PDB/pdbdump-headers.test?rev=269955&r1=269954&r2=269955&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/PDB/pdbdump-headers.test (original)
+++ llvm/trunk/test/DebugInfo/PDB/pdbdump-headers.test Wed May 18 11:24:16 2016
@@ -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 {

Modified: llvm/trunk/tools/llvm-pdbdump/llvm-pdbdump.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbdump/llvm-pdbdump.cpp?rev=269955&r1=269954&r2=269955&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-pdbdump/llvm-pdbdump.cpp (original)
+++ llvm/trunk/tools/llvm-pdbdump/llvm-pdbdump.cpp Wed May 18 11:24:16 2016
@@ -414,6 +414,7 @@ static Error dumpPublicsStream(ScopedPri
   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();
 }
 




More information about the llvm-commits mailing list