[clr-ios] Keep R2R debug and inlining info in Debug for Apple mobile RIDs#54529
Merged
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
dotnet/runtime CoreCLR Apple mobile tests publish for ios-*/tvos-*/etc. without the Microsoft.iOS workload, so DebuggerSupport is empty there. A DebuggerSupport-only gate would still strip in Debug for those tests and defeat the PR's goal of preserving R2R debug info for the CoreCLR debugger. Strip only when both signals say so: DebuggerSupport explicitly not true AND Configuration not Debug. macios SDK consumers (DebuggerSupport set from MtouchDebug) still respect custom configuration names per the earlier review. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
|
@copilot do the same for PublishReadyToRunStripInliningInfo |
Co-authored-by: kotlarmilos <11523312+kotlarmilos@users.noreply.github.com>
Contributor
Done. Applied the same |
Copilot
AI
changed the title
[clr-ios] Keep R2R debug info in Debug for Apple mobile RIDs
[clr-ios] Keep R2R debug and inlining info in Debug for Apple mobile RIDs
Jun 2, 2026
elinor-fung
approved these changes
Jun 2, 2026
Addresses review nit: replace the duplicated RuntimeIdentifier.StartsWith checks across the EmitSymbols, StripInliningInfo, StripDebugInfo, and StripILBodies property defaults with a single _IsIOSLikeRid property. Behavior is unchanged; the osx- EmitSymbols case remains separate. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
elinor-fung
approved these changes
Jun 3, 2026
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
PublishReadyToRunStripDebugInfoandPublishReadyToRunStripInliningInfodefault totruefor Apple mobile RIDs (ios-*,tvos-*,iossimulator-*,tvossimulator-*,maccatalyst-*), which passes--strip-debug-infoand--strip-inlining-infoto crossgen2 and dropsREADYTORUN_SECTION_DEBUG_INFO(and inlining info) from 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.Change
Gate the default
PublishReadyToRunStripDebugInfo=trueandPublishReadyToRunStripInliningInfo=truefor Apple mobile RIDs on'$(DebuggerSupport)' != 'true' and '$(Configuration)' != 'Debug':DebuggerSupportis the canonical property the trimmers use to decide whether to keep debugger support (see trimming options). The macios SDK sets it fromXamarin.Shared.Sdk.targets.Configuration != 'Debug'is kept as a fallback for projects that do not flow through the macios SDK and therefore never populateDebuggerSupport(ref #31918 on custom configuration names is acknowledged; the fallback only relaxes stripping for the literalDebugname, which is the documented default).Release (and other non-Debug, non-
DebuggerSupport=true) builds continue stripping R2R debug and inlining info via--strip-debug-infoand--strip-inlining-info, preserving current size/perf characteristics.