OSDN Git Service

pdbdump: print out the name of the stream 0.
authorRui Ueyama <ruiu@google.com>
Fri, 27 May 2016 00:32:07 +0000 (00:32 +0000)
committerRui Ueyama <ruiu@google.com>
Fri, 27 May 2016 00:32:07 +0000 (00:32 +0000)
Differential Revision: http://reviews.llvm.org/D20712

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270943 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/DebugInfo/PDB/Raw/RawConstants.h
test/DebugInfo/PDB/pdbdump-headers.test
tools/llvm-pdbdump/llvm-pdbdump.cpp

index 5c512f1..6263bf9 100644 (file)
@@ -45,6 +45,11 @@ enum PdbRaw_TpiVer : uint32_t {
 };
 
 enum SpecialStream : uint32_t {
+  // Stream 0 contains the copy of previous version of the MSF directory.
+  // We are not currently using it, but technically if we find the main
+  // MSF is corrupted, we could fallback to it.
+  OldMSFDirectory = 0,
+
   StreamPDB = 1,
   StreamTPI = 2,
   StreamDBI = 3,
index 2e23388..a5904fa 100644 (file)
@@ -21,7 +21,7 @@
 ; EMPTY-NEXT:   NumStreams: 17
 ; EMPTY-NEXT: }
 ; EMPTY-NEXT: Streams [
-; EMPTY-NEXT:   Stream 0: [???] (40 bytes)
+; EMPTY-NEXT:   Stream 0: [Old MSF Directory] (40 bytes)
 ; EMPTY-NEXT:   Stream 1: [PDB Stream] (118 bytes)
 ; EMPTY-NEXT:   Stream 2: [TPI Stream] (5392 bytes)
 ; EMPTY-NEXT:   Stream 3: [DBI Stream] (739 bytes)
 ; ALL:   NumStreams: 17
 ; ALL: }
 ; ALL: Streams [
-; ALL:   Stream 0: [???] (40 bytes)
+; ALL:   Stream 0: [Old MSF Directory] (40 bytes)
 ; ALL:   Stream 1: [PDB Stream] (118 bytes)
 ; ALL:   Stream 2: [TPI Stream] (5392 bytes)
 ; ALL:   Stream 3: [DBI Stream] (739 bytes)
index 7ba991a..b3f73cc 100644 (file)
@@ -254,7 +254,9 @@ static Error dumpStreamSummary(ScopedPrinter &P, PDBFile &File) {
     std::string Label("Stream ");
     Label += to_string(StreamIdx);
     std::string Value;
-    if (StreamIdx == StreamPDB)
+    if (StreamIdx == OldMSFDirectory)
+      Value = "Old MSF Directory";
+    else if (StreamIdx == StreamPDB)
       Value = "PDB Stream";
     else if (StreamIdx == StreamDBI)
       Value = "DBI Stream";