[clr-ios] Keep R2R debug info in Debug for Apple mobile RIDs#54529
Open
kotlarmilos wants to merge 2 commits into
Open
[clr-ios] Keep R2R debug info in Debug for Apple mobile RIDs#54529kotlarmilos wants to merge 2 commits into
kotlarmilos wants to merge 2 commits into
Conversation
PublishReadyToRunStripDebugInfo defaults to true for ios/tvos/iossimulator/ tvossimulator/maccatalyst, which passes --strip-debug-info to crossgen2 and drops READYTORUN_SECTION_DEBUG_INFO from the R2R image. Without that section, the CoreCLR debugger cannot map IL offsets to native offsets for R2R'd methods, so line-level breakpoints fail to bind to anything other than the method entry. Gate the default on Configuration != Debug so debug builds keep the IL-to-native map. Release builds are unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adjusts the default ReadyToRun (R2R) behavior for Apple mobile RuntimeIdentifiers so Debug publishes retain R2R debug-info sections needed for IL-to-native mapping in the CoreCLR debugger, while keeping existing stripping behavior for non-Debug configurations.
Changes:
- Gates the default
PublishReadyToRunStripDebugInfo=trueforios/tvos/iossimulator/tvossimulator/maccatalystRIDs on$(Configuration) != 'Debug'. - Keeps Release (and other non-Debug) builds stripping R2R debug info via
--strip-debug-info, preserving current size/perf characteristics outside Debug.
Show a summary per file
| File | Description |
|---|---|
| src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.CrossGen.targets | Changes the default PublishReadyToRunStripDebugInfo behavior for Apple mobile RIDs so Debug builds keep R2R debug info, while non-Debug builds continue stripping. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 0
rolfbjarne
reviewed
Jun 1, 2026
Per review feedback: customers can use configuration names other than 'Debug'. DebuggerSupport is the canonical trimmer-aware signal; Xamarin.Shared.Sdk.targets in dotnet/macios already sets it from MtouchDebug/MmpDebug/Configuration, so relying on it correctly handles custom debug configurations. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
elinor-fung
reviewed
Jun 1, 2026
| <PublishReadyToRunStripDebugInfo Condition="'$(PublishReadyToRunStripDebugInfo)' == '' and '$(DebuggerSupport)' != 'true' and $(RuntimeIdentifier.StartsWith('tvos-'))">true</PublishReadyToRunStripDebugInfo> | ||
| <PublishReadyToRunStripDebugInfo Condition="'$(PublishReadyToRunStripDebugInfo)' == '' and '$(DebuggerSupport)' != 'true' and $(RuntimeIdentifier.StartsWith('iossimulator-'))">true</PublishReadyToRunStripDebugInfo> | ||
| <PublishReadyToRunStripDebugInfo Condition="'$(PublishReadyToRunStripDebugInfo)' == '' and '$(DebuggerSupport)' != 'true' and $(RuntimeIdentifier.StartsWith('tvossimulator-'))">true</PublishReadyToRunStripDebugInfo> | ||
| <PublishReadyToRunStripDebugInfo Condition="'$(PublishReadyToRunStripDebugInfo)' == '' and '$(DebuggerSupport)' != 'true' and $(RuntimeIdentifier.StartsWith('maccatalyst-'))">true</PublishReadyToRunStripDebugInfo> |
Member
There was a problem hiding this comment.
I assume DebuggerSupport will always set by macios SDK targets from https://github.com/dotnet/macios/blob/53ffc7202a22a069931b5ef744224c2c772a096b/dotnet/targets/Xamarin.Shared.Sdk.targets#L127? Unlike for projects that don't use that 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.
Description
PublishReadyToRunStripDebugInfodefaults totruefor Apple mobile RIDs, which passes--strip-debug-infoto crossgen2 and dropsREADYTORUN_SECTION_DEBUG_INFOfrom the R2R image.Without that section, the CoreCLR debugger cannot map IL offsets to native offsets for R2R'd methods:
ReadyToRunInfo::GetDebugInforeturns NULL,ReadyToRunJitManager::GetBoundariesAndVarsreturns FALSE,DebuggerJitInfo::LazyInitBoundsnever populatesm_sequenceMap, and line-level breakpoints cannot bind to anything other than the method entry.