-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[LLD][COFF] Add /nodbgdirmerge to control debug directory section #159235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| RUN: yaml2obj %p/Inputs/pdb1.yaml -o %t1.obj | ||
| RUN: yaml2obj %p/Inputs/pdb2.yaml -o %t2.obj | ||
| RUN: rm -f %t.dll %t.pdb | ||
|
|
||
| ## Check that it emits the debug directory in .cvinfo section when | ||
| ## /nodbgdirmerge is specified | ||
| RUN: lld-link /debug /pdb:%t.pdb /pdbaltpath:test.pdb /dll /out:%t.dll \ | ||
| RUN: /entry:main /nodefaultlib /nodbgdirmerge %t1.obj %t2.obj | ||
| RUN: llvm-readobj --sections %t.dll | FileCheck -check-prefix=CHECKNOTMERGED %s | ||
|
|
||
| CHECKNOTMERGED: Section { | ||
| CHECKNOTMERGED: Number: 3 | ||
| CHECKNOTMERGED-NEXT: Name: .cvinfo | ||
| CHECKNOTMERGED-NEXT: VirtualSize: 0x3D | ||
| CHECKNOTMERGED-NEXT: VirtualAddress: 0x3000 | ||
| CHECKNOTMERGED-NEXT: RawDataSize: 512 | ||
| CHECKNOTMERGED-NEXT: PointerToRawData: 0x800 | ||
| CHECKNOTMERGED-NEXT: PointerToRelocations: 0 | ||
| CHECKNOTMERGED-NEXT: PointerToLineNumbers: 0 | ||
| CHECKNOTMERGED-NEXT: RelocationCount: 0 | ||
| CHECKNOTMERGED-NEXT: LineNumberCount: 0 | ||
| CHECKNOTMERGED-NEXT: Characteristics [ (0x40000040) | ||
| CHECKNOTMERGED-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA (0x40) | ||
| CHECKNOTMERGED-NEXT: IMAGE_SCN_MEM_READ (0x40000000) | ||
| CHECKNOTMERGED-NEXT: ] | ||
| CHECKNOTMERGED-NEXT: } | ||
|
|
||
| ## Check that it triggers merge on when /nodbgdirmerge is not specified | ||
| RUN: lld-link /debug /pdb:%t.pdb /pdbaltpath:test.pdb /dll /out:%t.dll \ | ||
| RUN: /entry:main /nodefaultlib %t1.obj %t2.obj | ||
| RUN: llvm-readobj --sections %t.dll | FileCheck -check-prefix=CHECKMERGED %s | ||
|
|
||
| CHECKMERGED-NOT: Name: .cvinfo | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine as is - but as a general comment; it's also possible to make the test less prone to breaking on unrelated changes, by entirely omitting the values on the lines we're not interested in - it still matches the line so we can use
-NEXTto keep things connected, but still matching those lines fuzzily.Another potential approach is to skip
-NEXTfor the section we're not that interested in, then have e.g.CHECKNOTMERGED: LineNumberCount:CHECKNOTMERGED-NEXT: Characteristics [ (0x40000040), so the check forLineNumberCount:certainly will match the next such line, and force the full exact match onCharacteristicsto still be the next one (i.e. in the same section).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We just need to check the presense of
.cvinfosection and that's all, perhaps it should suffice we just have single lineCHECKNOTMERGED: Name: .cvinfoas well as the negate test?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that would probably also suffice. I guess technically we maybe also could want to check the contents of the section (not only that the section exists but also contains roughly the expected contents), but you're right that the rest of these checks here are kinda redundant.