Preserve document custom debug information #981
Loading…
Reference in a new issue
No description provided.
Delete branch "sbomer/cecil-sourcelink-fix-jbevain"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes dotnet/runtime#115145.
This ports dotnet/cecil#495 to the upstream repository.
Portable PDB documents are preserved even when they are no longer referenced by sequence points, but their custom debug information was only loaded when resolving a referenced document. Consequently, documents left unreferenced after trimming could be written without records such as
EmbeddedSource.Before writing the complete document collection, load custom debug information for documents that have not already been resolved. This keeps read-only PDB usage lazy while ensuring all document records are preserved during a rewrite. Embedded-source content remains lazy and is copied from its original raw blob when written.
The regression test removes the entry point and types containing a document’s sequence points without first accessing their debug information, writes the module, and verifies the output PDB still contains that document’s embedded source.
Testing
dotnet test Test/Mono.Cecil.Tests.csproj -f net8.0 --filter FullyQualifiedName~PortablePdbTests(36 passed)View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.