2020-08-21 06:00:25 +08:00
|
|
|
# RUN: yaml2obj %s -o %t.obj
|
2016-08-30 05:20:46 +08:00
|
|
|
|
[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.dll %t.pdb
|
2018-09-16 02:37:22 +08:00
|
|
|
# RUN: lld-link /debug /pdbaltpath:test.pdb /dll /out:%t.dll /entry:DllMain %t.obj
|
2019-05-01 13:49:01 +08:00
|
|
|
# RUN: llvm-readobj --coff-debug-directory %t.dll > %t.1.txt
|
2018-09-16 02:37:22 +08:00
|
|
|
# RUN: lld-link /debug /pdbaltpath:test.pdb /dll /out:%t.dll /entry:DllMain %t.obj
|
2019-05-01 13:49:01 +08:00
|
|
|
# RUN: llvm-readobj --coff-debug-directory %t.dll > %t.2.txt
|
[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: cat %t.1.txt %t.2.txt | FileCheck %s
|
2016-08-30 05:20:46 +08:00
|
|
|
|
[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.dll %t.pdb
|
2018-04-18 07:28:38 +08:00
|
|
|
# RUN: lld-link /debug /pdb:%t1.pdb /dll /out:%t.dll /entry:DllMain %t.obj
|
2019-05-01 13:49:01 +08:00
|
|
|
# RUN: llvm-readobj --coff-debug-directory %t.dll > %t.3.txt
|
2018-04-18 07:28:38 +08:00
|
|
|
# RUN: lld-link /debug /pdb:%t2.pdb /dll /out:%t.dll /entry:DllMain %t.obj
|
2019-05-01 13:49:01 +08:00
|
|
|
# RUN: llvm-readobj --coff-debug-directory %t.dll > %t.4.txt
|
2018-09-16 02:37:22 +08:00
|
|
|
# RUN: cat %t.3.txt %t.4.txt | FileCheck --check-prefix TWOPDBS %s
|
2016-08-30 05:20:46 +08:00
|
|
|
|
2018-09-06 02:02:43 +08:00
|
|
|
# RUN: rm -f %t.dll %t.pdb
|
|
|
|
# RUN: lld-link /Brepro /dll /out:%t.dll /entry:DllMain %t.obj
|
2019-05-01 13:49:01 +08:00
|
|
|
# RUN: llvm-readobj --coff-debug-directory %t.dll | FileCheck --check-prefix REPRO %s
|
2018-09-06 02:02:43 +08:00
|
|
|
|
|
|
|
# RUN: rm -f %t.dll %t.pdb
|
|
|
|
# RUN: lld-link /Brepro /debug /dll /out:%t.dll /entry:DllMain %t.obj
|
2019-05-01 13:49:01 +08:00
|
|
|
# RUN: llvm-readobj --coff-debug-directory %t.dll | FileCheck --check-prefix REPRODEBUG %s
|
2018-09-06 02:02:43 +08:00
|
|
|
|
2018-11-27 17:20:55 +08:00
|
|
|
# RUN: rm -f %t.dll %t.pdb
|
|
|
|
# RUN: lld-link /lldmingw /debug:dwarf /dll /out:%t.dll /entry:DllMain %t.obj
|
2019-05-01 13:49:01 +08:00
|
|
|
# RUN: llvm-readobj --coff-debug-directory %t.dll | FileCheck --check-prefix MINGW %s
|
2018-11-27 17:20:55 +08:00
|
|
|
|
[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: File: [[FILE:.*]].dll
|
2016-08-30 05:20:46 +08:00
|
|
|
# CHECK: DebugDirectory [
|
|
|
|
# CHECK: DebugEntry {
|
|
|
|
# CHECK: Characteristics: 0x0
|
2018-03-09 03:33:47 +08:00
|
|
|
# CHECK: TimeDateStamp:
|
2016-08-30 05:20:46 +08:00
|
|
|
# CHECK: MajorVersion: 0x0
|
|
|
|
# CHECK: MinorVersion: 0x0
|
|
|
|
# CHECK: Type: CodeView (0x2)
|
2017-08-03 07:32:26 +08:00
|
|
|
# CHECK: SizeOfData: 0x{{[^0]}}
|
|
|
|
# CHECK: AddressOfRawData: 0x{{[^0]}}
|
|
|
|
# CHECK: PointerToRawData: 0x{{[^0]}}
|
2016-08-30 05:20:46 +08:00
|
|
|
# CHECK: PDBInfo {
|
|
|
|
# CHECK: PDBSignature: 0x53445352
|
[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: PDBGUID: [[GUID:\(([A-Za-z0-9]{2} ?){16}\)]]
|
2016-08-30 05:20:46 +08:00
|
|
|
# CHECK: PDBAge: 1
|
2018-09-16 02:37:22 +08:00
|
|
|
# CHECK: PDBFileName: {{.*}}.pdb
|
2016-08-30 05:20:46 +08:00
|
|
|
# CHECK: }
|
|
|
|
# CHECK: }
|
|
|
|
# CHECK: ]
|
[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: File: [[FILE]].dll
|
|
|
|
# CHECK: DebugDirectory [
|
|
|
|
# CHECK: DebugEntry {
|
|
|
|
# CHECK: Characteristics: 0x0
|
2018-03-09 03:33:47 +08:00
|
|
|
# CHECK: TimeDateStamp:
|
[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: MajorVersion: 0x0
|
|
|
|
# CHECK: MinorVersion: 0x0
|
|
|
|
# CHECK: Type: CodeView (0x2)
|
|
|
|
# CHECK: SizeOfData: 0x{{[^0]}}
|
|
|
|
# CHECK: AddressOfRawData: 0x{{[^0]}}
|
|
|
|
# CHECK: PointerToRawData: 0x{{[^0]}}
|
|
|
|
# CHECK: PDBInfo {
|
|
|
|
# CHECK: PDBSignature: 0x53445352
|
|
|
|
# CHECK: PDBGUID: [[GUID]]
|
2018-09-16 02:37:22 +08:00
|
|
|
# CHECK: PDBAge: 1
|
|
|
|
# CHECK: PDBFileName: {{.*}}.pdb
|
[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: }
|
|
|
|
# CHECK: }
|
|
|
|
# CHECK: ]
|
2016-08-30 05:20:46 +08:00
|
|
|
|
2018-09-16 02:37:22 +08:00
|
|
|
# TWOPDBS: File: [[FILE:.*]].dll
|
|
|
|
# TWOPDBS: DebugDirectory [
|
|
|
|
# TWOPDBS: DebugEntry {
|
|
|
|
# TWOPDBS: Characteristics: 0x0
|
|
|
|
# TWOPDBS: TimeDateStamp:
|
|
|
|
# TWOPDBS: MajorVersion: 0x0
|
|
|
|
# TWOPDBS: MinorVersion: 0x0
|
|
|
|
# TWOPDBS: Type: CodeView (0x2)
|
|
|
|
# TWOPDBS: SizeOfData: 0x{{[^0]}}
|
|
|
|
# TWOPDBS: AddressOfRawData: 0x{{[^0]}}
|
|
|
|
# TWOPDBS: PointerToRawData: 0x{{[^0]}}
|
|
|
|
# TWOPDBS: PDBInfo {
|
|
|
|
# TWOPDBS: PDBSignature: 0x53445352
|
|
|
|
# TWOPDBS: PDBGUID: [[GUID:\(([A-Za-z0-9]{2} ?){16}\)]]
|
|
|
|
# TWOPDBS: PDBAge: 1
|
|
|
|
# TWOPDBS: PDBFileName: {{.*}}.pdb
|
|
|
|
# TWOPDBS: }
|
|
|
|
# TWOPDBS: }
|
|
|
|
# TWOPDBS: ]
|
|
|
|
# TWOPDBS: File: [[FILE]].dll
|
|
|
|
# TWOPDBS: DebugDirectory [
|
|
|
|
# TWOPDBS: DebugEntry {
|
|
|
|
# TWOPDBS: Characteristics: 0x0
|
|
|
|
# TWOPDBS: TimeDateStamp:
|
|
|
|
# TWOPDBS: MajorVersion: 0x0
|
|
|
|
# TWOPDBS: MinorVersion: 0x0
|
|
|
|
# TWOPDBS: Type: CodeView (0x2)
|
|
|
|
# TWOPDBS: SizeOfData: 0x{{[^0]}}
|
|
|
|
# TWOPDBS: AddressOfRawData: 0x{{[^0]}}
|
|
|
|
# TWOPDBS: PointerToRawData: 0x{{[^0]}}
|
|
|
|
# TWOPDBS: PDBInfo {
|
|
|
|
# TWOPDBS: PDBSignature: 0x53445352
|
|
|
|
# TWOPDBS-NOT: PDBGUID: [[GUID]]
|
|
|
|
# TWOPDBS: PDBAge: 1
|
|
|
|
# TWOPDBS: PDBFileName: {{.*}}.pdb
|
|
|
|
# TWOPDBS: }
|
|
|
|
# TWOPDBS: }
|
|
|
|
# TWOPDBS: ]
|
|
|
|
|
2018-09-06 02:02:43 +08:00
|
|
|
# REPRO: File: {{.*}}.dll
|
|
|
|
# REPRO: DebugDirectory [
|
|
|
|
# REPRO: DebugEntry {
|
|
|
|
# REPRO: Characteristics: 0x0
|
|
|
|
# REPRO: TimeDateStamp:
|
|
|
|
# REPRO: MajorVersion: 0x0
|
|
|
|
# REPRO: MinorVersion: 0x0
|
|
|
|
# REPRO: Type: Repro (0x10)
|
|
|
|
# REPRO: SizeOfData: 0x0
|
|
|
|
# REPRO: AddressOfRawData: 0x0
|
|
|
|
# REPRO: PointerToRawData: 0x0
|
|
|
|
# REPRO: }
|
|
|
|
# REPRO: ]
|
|
|
|
|
|
|
|
# REPRODEBUG: File: {{.*}}.dll
|
|
|
|
# REPRODEBUG: DebugDirectory [
|
|
|
|
# REPRODEBUG: DebugEntry {
|
|
|
|
# REPRODEBUG: Characteristics: 0x0
|
|
|
|
# REPRODEBUG: TimeDateStamp:
|
|
|
|
# REPRODEBUG: MajorVersion: 0x0
|
|
|
|
# REPRODEBUG: MinorVersion: 0x0
|
|
|
|
# REPRODEBUG: Type: CodeView (0x2)
|
|
|
|
# REPRODEBUG: SizeOfData: 0x{{[^0]}}
|
|
|
|
# REPRODEBUG: AddressOfRawData: 0x{{[^0]}}
|
|
|
|
# REPRODEBUG: PointerToRawData: 0x{{[^0]}}
|
|
|
|
# REPRODEBUG: PDBInfo {
|
|
|
|
# REPRODEBUG: PDBSignature: 0x53445352
|
|
|
|
# REPRODEBUG: PDBGUID:
|
|
|
|
# REPRODEBUG: PDBAge: 1
|
|
|
|
# REPRODEBUG: PDBFileName:
|
|
|
|
# REPRODEBUG: }
|
|
|
|
# REPRODEBUG: }
|
|
|
|
# REPRODEBUG: DebugEntry {
|
|
|
|
# REPRODEBUG: Characteristics: 0x0
|
|
|
|
# REPRODEBUG: TimeDateStamp:
|
|
|
|
# REPRODEBUG: MajorVersion: 0x0
|
|
|
|
# REPRODEBUG: MinorVersion: 0x0
|
|
|
|
# REPRODEBUG: Type: Repro (0x10)
|
|
|
|
# REPRODEBUG: SizeOfData: 0x0
|
|
|
|
# REPRODEBUG: AddressOfRawData: 0x0
|
|
|
|
# REPRODEBUG: PointerToRawData: 0x0
|
|
|
|
# REPRODEBUG: }
|
|
|
|
# REPRODEBUG: ]
|
2018-11-27 17:20:55 +08:00
|
|
|
|
|
|
|
# MINGW: File: {{.*}}.dll
|
|
|
|
# MINGW: DebugDirectory [
|
|
|
|
# MINGW: DebugEntry {
|
|
|
|
# MINGW: Characteristics: 0x0
|
|
|
|
# MINGW: TimeDateStamp:
|
|
|
|
# MINGW: MajorVersion: 0x0
|
|
|
|
# MINGW: MinorVersion: 0x0
|
|
|
|
# MINGW: Type: CodeView (0x2)
|
|
|
|
# MINGW: SizeOfData: 0x{{[^0]}}
|
|
|
|
# MINGW: AddressOfRawData: 0x{{[^0]}}
|
|
|
|
# MINGW: PointerToRawData: 0x{{[^0]}}
|
|
|
|
# MINGW: PDBInfo {
|
|
|
|
# MINGW: PDBSignature: 0x53445352
|
|
|
|
# MINGW: PDBGUID: [[GUID:\(([A-Za-z0-9]{2} ?){16}\)]]
|
|
|
|
# MINGW: PDBAge: 1
|
|
|
|
# MINGW: PDBFileName:
|
|
|
|
# MINGW: }
|
|
|
|
# MINGW: }
|
|
|
|
# MINGW: ]
|
2016-08-30 05:20:46 +08:00
|
|
|
--- !COFF
|
|
|
|
header:
|
|
|
|
Machine: IMAGE_FILE_MACHINE_I386
|
|
|
|
Characteristics: [ ]
|
|
|
|
sections:
|
|
|
|
- Name: .text
|
|
|
|
Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
|
|
|
|
Alignment: 4
|
|
|
|
SectionData: 31C0C3
|
|
|
|
- Name: .data
|
|
|
|
Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
|
|
|
|
Alignment: 4
|
|
|
|
SectionData: ''
|
|
|
|
- Name: .bss
|
|
|
|
Characteristics: [ IMAGE_SCN_CNT_UNINITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
|
|
|
|
Alignment: 4
|
|
|
|
SectionData: ''
|
|
|
|
symbols:
|
|
|
|
- Name: .text
|
|
|
|
Value: 0
|
|
|
|
SectionNumber: 1
|
|
|
|
SimpleType: IMAGE_SYM_TYPE_NULL
|
|
|
|
ComplexType: IMAGE_SYM_DTYPE_NULL
|
|
|
|
StorageClass: IMAGE_SYM_CLASS_STATIC
|
|
|
|
SectionDefinition:
|
|
|
|
Length: 3
|
|
|
|
NumberOfRelocations: 0
|
|
|
|
NumberOfLinenumbers: 0
|
|
|
|
CheckSum: 3963538403
|
|
|
|
Number: 1
|
|
|
|
- Name: .data
|
|
|
|
Value: 0
|
|
|
|
SectionNumber: 2
|
|
|
|
SimpleType: IMAGE_SYM_TYPE_NULL
|
|
|
|
ComplexType: IMAGE_SYM_DTYPE_NULL
|
|
|
|
StorageClass: IMAGE_SYM_CLASS_STATIC
|
|
|
|
SectionDefinition:
|
|
|
|
Length: 0
|
|
|
|
NumberOfRelocations: 0
|
|
|
|
NumberOfLinenumbers: 0
|
|
|
|
CheckSum: 0
|
|
|
|
Number: 2
|
|
|
|
- Name: .bss
|
|
|
|
Value: 0
|
|
|
|
SectionNumber: 3
|
|
|
|
SimpleType: IMAGE_SYM_TYPE_NULL
|
|
|
|
ComplexType: IMAGE_SYM_DTYPE_NULL
|
|
|
|
StorageClass: IMAGE_SYM_CLASS_STATIC
|
|
|
|
SectionDefinition:
|
|
|
|
Length: 0
|
|
|
|
NumberOfRelocations: 0
|
|
|
|
NumberOfLinenumbers: 0
|
|
|
|
CheckSum: 0
|
|
|
|
Number: 3
|
|
|
|
- Name: '@feat.00'
|
|
|
|
Value: 1
|
|
|
|
SectionNumber: -1
|
|
|
|
SimpleType: IMAGE_SYM_TYPE_NULL
|
|
|
|
ComplexType: IMAGE_SYM_DTYPE_NULL
|
|
|
|
StorageClass: IMAGE_SYM_CLASS_STATIC
|
|
|
|
- Name: _DllMain
|
|
|
|
Value: 0
|
|
|
|
SectionNumber: 1
|
|
|
|
SimpleType: IMAGE_SYM_TYPE_NULL
|
|
|
|
ComplexType: IMAGE_SYM_DTYPE_FUNCTION
|
|
|
|
StorageClass: IMAGE_SYM_CLASS_EXTERNAL
|
|
|
|
...
|