2020-08-21 06:00:25 +08:00
|
|
|
# RUN: yaml2obj %p/Inputs/pdb1.yaml -o %t1.obj
|
|
|
|
# RUN: yaml2obj %p/Inputs/pdb2.yaml -o %t2.obj
|
[LLD COFF/PDB] Incrementally update the build id.
Previously, our algorithm to compute a build id involved hashing the
executable and storing that as the GUID in the CV Debug Record chunk,
and setting the age to 1.
This breaks down in one very obvious case: a user adds some newlines to
a file, rebuilds, but changes nothing else. This causes new line
information and new file checksums to get written to the PDB, meaning
that the debug info is different, but the generated code would be the
same, so we would write the same build over again with an age of 1.
Anyone using a symbol cache would have a problem now, because the
debugger would open the executable, look at the age and guid, find a
matching PDB in the symbol cache and then load it. It would never copy
the new PDB to the symbol cache.
This patch implements the canonical Windows algorithm for updating
a build id, which is to check the existing executable first, and
re-use an existing GUID while bumping the age if it already
exists.
Differential Revision: https://reviews.llvm.org/D36758
llvm-svn: 310961
2017-08-16 05:31:41 +08:00
|
|
|
# RUN: rm -f %t.pdb %t.dll
|
2017-02-07 12:28:02 +08:00
|
|
|
# RUN: lld-link /debug /debugtype:pdata /pdb:%t.pdb /dll /out:%t.dll /entry:main /nodefaultlib \
|
2017-05-18 23:15:10 +08:00
|
|
|
# RUN: %t1.obj %t2.obj
|
2017-02-07 12:28:02 +08:00
|
|
|
|
2017-06-10 04:46:17 +08:00
|
|
|
# RUN: llvm-pdbutil pdb2yaml -pdb-stream %t.pdb | FileCheck %s
|
2017-02-07 12:28:02 +08:00
|
|
|
|
|
|
|
# CHECK: PdbStream:
|
[LLD COFF/PDB] Incrementally update the build id.
Previously, our algorithm to compute a build id involved hashing the
executable and storing that as the GUID in the CV Debug Record chunk,
and setting the age to 1.
This breaks down in one very obvious case: a user adds some newlines to
a file, rebuilds, but changes nothing else. This causes new line
information and new file checksums to get written to the PDB, meaning
that the debug info is different, but the generated code would be the
same, so we would write the same build over again with an age of 1.
Anyone using a symbol cache would have a problem now, because the
debugger would open the executable, look at the age and guid, find a
matching PDB in the symbol cache and then load it. It would never copy
the new PDB to the symbol cache.
This patch implements the canonical Windows algorithm for updating
a build id, which is to check the existing executable first, and
re-use an existing GUID while bumping the age if it already
exists.
Differential Revision: https://reviews.llvm.org/D36758
llvm-svn: 310961
2017-08-16 05:31:41 +08:00
|
|
|
# CHECK-NEXT: Age: 1
|
2017-07-08 04:25:39 +08:00
|
|
|
# CHECK-NEXT: Guid:
|
|
|
|
# CHECK-NEXT: Signature:
|
2017-06-13 08:30:09 +08:00
|
|
|
# CHECK-NEXT: Features: [ VC140 ]
|
2017-02-07 12:28:02 +08:00
|
|
|
# CHECK-NEXT: Version: VC70
|
|
|
|
|