Skip to content
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

Preserve original PDB path in Debug header #947

Closed
wants to merge 3 commits into from

Conversation

sbomer
Copy link
Contributor

@sbomer sbomer commented May 31, 2024

Upstreaming change from dotnet#183

When writing debug symbols, Cecil places them into a .pdb file adjacent to the .dll in the output. It also uses the path of this output .pdb as the path to the PDB in the .dll's CodeView Debug Directory entry, which breaks scenarios using PathMap.

This change fixes the PDB path in the CodeView Debug Directory entry to preserve the original path if it was present in the input .dll (but doesn't otherwise affect where Cecil looks for or writes out .pdb files).

Fixes dotnet/runtime#99594.

@sbomer sbomer changed the title Preserve original PDB path in dll Preserve original PDB path in Debug header Jun 5, 2024
@sbomer
Copy link
Contributor Author

sbomer commented Jun 10, 2024

Closing, see dotnet#183 for context. Seems the supported way to do this is to provide a custom symbol writer.

@jbevain if you would be open to a solution that could be shared by different cecil consumers, I could re-open this and make it conditioned on a flag. But there's no obvious place to pass through settings from WriterParameters to the symbol writer, so it might need some more thought, or changes to the API.

@sbomer sbomer closed this Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Not all built assemblies have deterministic source paths
1 participant