Preserve document custom debug information - #981
Open
sbomer wants to merge 1 commit into
Open
Conversation
* Preserve document custom debug information Load custom debug information for every preserved portable PDB document so embedded sources survive a round trip. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 01ec6ff9-132e-45df-95c2-9cedbce405cb Assisted-by: GitHub Copilot CLI:GPT-5.6-Sol [code-review] * Hydrate document debug information when writing Read missing document custom debug information only when producing a portable PDB, and verify embedded sources survive after their sequence points are trimmed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 01ec6ff9-132e-45df-95c2-9cedbce405cb Assisted-by: GitHub Copilot CLI:GPT-5.6-Sol [code-review] --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 01ec6ff9-132e-45df-95c2-9cedbce405cb
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes dotnet/runtime#115145.
This ports dotnet#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)Note
This content was created with assistance from AI.