[net11.0] Keep R2R debug info in Debug for CoreCLR Apple mobile#25599
Closed
kotlarmilos wants to merge 1 commit into
Closed
[net11.0] Keep R2R debug info in Debug for CoreCLR Apple mobile#25599kotlarmilos wants to merge 1 commit into
kotlarmilos wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts the Apple workload MSBuild defaults so that CoreCLR Debug builds keep ReadyToRun (R2R) debug info instead of stripping it, improving CoreCLR remote debugging (accurate IL-to-native mappings / line-level breakpoints) for composite R2R images on Apple mobile targets.
Changes:
- Default
PublishReadyToRunStripDebugInfo=falsewhen building Debug for CoreCLR on non-macOS Apple platforms (iOS/tvOS/MacCatalyst). - Add in-file documentation explaining the debugging impact of stripping
READYTORUN_SECTION_DEBUG_INFO.
Show a summary per file
| File | Description |
|---|---|
| dotnet/targets/Xamarin.Shared.Sdk.props | In CoreCLR (non-macOS) property defaults, disables stripping R2R debug info in Debug builds to preserve debugger IL↔native mapping data. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 0
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>
3c18b49 to
b248a4f
Compare
Member
Author
|
Moving to dotnet/sdk. |
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.