[net11.0] Keep R2R debug info in Debug for CoreCLR Apple mobile#25598
Closed
kotlarmilos wants to merge 1 commit into
Closed
[net11.0] Keep R2R debug info in Debug for CoreCLR Apple mobile#25598kotlarmilos wants to merge 1 commit into
kotlarmilos wants to merge 1 commit into
Conversation
The .NET SDK defaults PublishReadyToRunStripDebugInfo=true for ios/tvos/ iossimulator/tvossimulator/maccatalyst RIDs, which passes --strip-debug-info to crossgen2 and drops READYTORUN_SECTION_DEBUG_INFO from the composite R2R image. macios additionally defaults PublishReadyToRun=true (composite) for CoreCLR even in Debug, so user code ends up R2R'd with no IL-to-native map. The result under the CoreCLR remote debugger is that DebuggerJitInfo::LazyInitBounds cannot populate m_sequenceMap, line-level breakpoints fail to bind to a native offset, and (without dotnet/runtime#128764) MapILOffsetToNative crashes on a NULL map entry. Default PublishReadyToRunStripDebugInfo=false for CoreCLR apple-mobile Debug builds so the re-composited R2R image keeps debug info and the debugger gets accurate IL-to-native mappings. Release builds are unaffected and still strip. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts the Apple workload MSBuild defaults so CoreCLR Debug builds on Apple mobile platforms keep ReadyToRun (R2R) debug info, improving CoreCLR remote debugging by preserving IL-to-native sequence point mappings in composite R2R images.
Changes:
- Set
PublishReadyToRunStripDebugInfo=falseby default for CoreCLR + non-macOS Debug builds when the user hasn’t specified a value. - Add an MSBuild comment documenting why stripping debug info breaks/degrades line-level breakpoint binding for R2R methods under the CoreCLR remote debugger.
Show a summary per file
| File | Description |
|---|---|
| dotnet/targets/Xamarin.Shared.Sdk.props | Defaults PublishReadyToRunStripDebugInfo to false for CoreCLR Debug builds on non-macOS Apple platforms to preserve R2R debug info for better debugging. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 0
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.
The .NET SDK defaults
PublishReadyToRunStripDebugInfo=truefor ios/tvos/iossimulator/tvossimulator/maccatalyst RIDs, so crossgen2 is invoked with--strip-debug-infoand the composite R2R image ships without aREADYTORUN_SECTION_DEBUG_INFOsection. macios additionally defaultsPublishReadyToRun=true(composite) for CoreCLR even in Debug, so the user assembly itself is composite-R2R'd with no IL-to-native map.Under the CoreCLR remote debugger this means
DebuggerJitInfo::LazyInitBoundsnever populatesm_sequenceMap, line-level breakpoints cannot bind to the right native offset (only method entry), andDebuggerJitInfo::MapILOffsetToNativedereferences a NULL map entry on the first R2R load that matches an IL primary patch (see dotnet/runtime#128764 for the defensive runtime fix).Default
PublishReadyToRunStripDebugInfo=falsefor the CoreCLR apple-mobile + Debug combination so the re-composited R2R image keeps debug info and the debugger gets accurate IL-to-native mappings. Release builds are unaffected and still strip.