diff options
-rw-r--r-- | lld/COFF/PDB.cpp | 13 | ||||
-rw-r--r-- | lld/test/COFF/pdb.test | 9 |
2 files changed, 19 insertions, 3 deletions
diff --git a/lld/COFF/PDB.cpp b/lld/COFF/PDB.cpp index 0c38e26a70d..2859c27effb 100644 --- a/lld/COFF/PDB.cpp +++ b/lld/COFF/PDB.cpp @@ -60,8 +60,17 @@ void coff::createPDB(StringRef Path) { ExitOnErr(Builder.getMsfBuilder().addStream(1, {5})); ExitOnErr(Builder.getMsfBuilder().addStream(1, {6})); - // Add an empty IPI stream. - Builder.getInfoBuilder(); + // Add an Info stream. + auto &InfoBuilder = Builder.getInfoBuilder(); + InfoBuilder.setAge(1); + + // Should be a random number, 0 for now. + InfoBuilder.setGuid({}); + + // Should be the current time, but set 0 for reproducibilty. + InfoBuilder.setSignature(0); + + InfoBuilder.setVersion(pdb::PdbRaw_ImplVer::PdbImplVC70); // Add an empty TPI stream. auto &TpiBuilder = Builder.getTpiBuilder(); diff --git a/lld/test/COFF/pdb.test b/lld/test/COFF/pdb.test index ade135af7b9..1747e71f8c9 100644 --- a/lld/test/COFF/pdb.test +++ b/lld/test/COFF/pdb.test @@ -1,6 +1,7 @@ # RUN: yaml2obj %s > %t.obj # RUN: lld-link /debug /pdb:%t.pdb /dll /out:%t.dll /entry:DllMain %t.obj -# RUN: llvm-pdbdump pdb2yaml -stream-metadata -stream-directory %t.pdb | FileCheck %s +# RUN: llvm-pdbdump pdb2yaml -stream-metadata -stream-directory -pdb-stream \ +# RUN: %t.pdb | FileCheck %s # CHECK: MSF: # CHECK-NEXT: SuperBlock: @@ -19,6 +20,12 @@ # CHECK-NEXT: - Stream: [ 4 ] # CHECK-NEXT: - Stream: [ 5 ] # CHECK-NEXT: - Stream: [ 6 ] +# CHECK-NEXT: PdbStream: +# CHECK-NEXT: Age: 1 +# CHECK-NEXT: Guid: '{00000000-0000-0000-0000-000000000000}' +# CHECK-NEXT: Signature: 0 +# CHECK-NEXT: Version: VC70 +# CHECK-NEXT: NamedStreams: --- !COFF header: |