-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Fix the issue where PDBs generated by ILSpy do not match certain asse… #3629
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
siegfriedpammer
merged 1 commit into
icsharpcode:master
from
sonyps5201314:fix_pdb_mismatch
Dec 21, 2025
+2
−1
Merged
Changes from all commits
Commits
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
Oops, something went wrong.
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.
is it always guaranteed to be the last entry? Wouldn't it make more sense to check that the extension is not
.ni.pdb?I did some testing by scanning all the .dlls on my machine and reading the DebugDirectory and it seems that at least the Microsoft compiler puts the non-native image entry last.
Uh oh!
There was an error while loading. Please reload this page.
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, I actually considered adding a line like
Debug.Assert(!portable.Path.EndsWith("ni.pdb"));for more robust verification, or to alert us to unexpected scenarios in the future.However, after checking
dotPeek's code, I noticed that they always iterate from the end. Trusting their implementation, I decided to simply omit that assertion.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.
Sounds good, could you add a comment to document the assumption? Thank you!
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.
Of course, feel free to modify this further, or we can wait until an unexpected scenario arises before making adjustments.
Arguably, the most reliable method would be to reverse engineer the relevant code in the VS debugger to confirm the exact matching logic. However, I suspect that
dotPeekhas already done this, which is why I decided to adopt an approach similar to theirs.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.
I didn't know how to describe this assumption, so I simply added a call to
Debug.Assertin the latest commit to execute this assumption.