Skip to content

[net11.0] Keep R2R debug info in Debug for CoreCLR Apple mobile#25599

Closed
kotlarmilos wants to merge 1 commit into
net11.0from
dev/kotlarmilos/r2r-keep-debug-info-in-debug-net11.0
Closed

[net11.0] Keep R2R debug info in Debug for CoreCLR Apple mobile#25599
kotlarmilos wants to merge 1 commit into
net11.0from
dev/kotlarmilos/r2r-keep-debug-info-in-debug-net11.0

Conversation

@kotlarmilos
Copy link
Copy Markdown
Member

The .NET SDK defaults PublishReadyToRunStripDebugInfo=true for ios/tvos/iossimulator/tvossimulator/maccatalyst RIDs, so crossgen2 is invoked with --strip-debug-info and the composite R2R image ships without a READYTORUN_SECTION_DEBUG_INFO section. macios additionally defaults PublishReadyToRun=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::LazyInitBounds never populates m_sequenceMap, line-level breakpoints cannot bind to the right native offset (only method entry), and DebuggerJitInfo::MapILOffsetToNative dereferences 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=false for 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.

Copilot AI review requested due to automatic review settings June 1, 2026 12:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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=false when 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>
@kotlarmilos kotlarmilos force-pushed the dev/kotlarmilos/r2r-keep-debug-info-in-debug-net11.0 branch from 3c18b49 to b248a4f Compare June 1, 2026 12:15
@kotlarmilos kotlarmilos closed this Jun 1, 2026
@kotlarmilos
Copy link
Copy Markdown
Member Author

Moving to dotnet/sdk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants