Repository navigation
Conversation
Allow debugger breakpoints and stepping to reach IL-backed async variants while continuing to skip synthetic async thunks. Related to dotnet#137559 Co-authored-by: Copilot <[email protected]> Copilot-Session: 54e87508-5323-495e-bc5b-d7f7b14605f9
Create debugger JIT information for already-compiled async variants when binding breakpoints after attachment. Co-authored-by: Copilot <[email protected]> Copilot-Session: 54e87508-5323-495e-bc5b-d7f7b14605f9
|
Azure Pipelines: Successfully started running 3 pipeline(s). 12 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
rcj1
approved these changes
Nov 17, 2026
Member
Author
|
/ba-g Only failures are iOS device Helix work items (iOS.CoreCLR.Interpreter.Test, iOS.Device.ExportManagedSymbols.Test, iOS.Device.ParallelForEachAsync.Test, System.Runtime.Tests on osx.15.amd64.iphone.open) failing with XHarness exit 78 PACKAGE_INSTALLATION_FAILURE (devicectl: Can't assign requested address) on four different machines; the app never installed. The same iOS device failures occur on unrelated PR #137747. This PR only changes CoreCLR debugger code. |
Member
Author
|
/backport to release/11.0 |
Contributor
|
Started backporting to |
2 of 4 tasks
steveisok
pushed a commit
that referenced
this pull request
Nov 20, 2026
… variants (#137874) Backport of #137764 to release/11.0 Fixes #137559 /cc @tommcdon ## Customer Impact - [x] Customer reported - [ ] Found internally Reported in #137559. In .NET 11, a breakpoint in a method that returns `Task`/`ValueTask` (and is not itself `async`) is not hit when the method is awaited by a runtime-async caller, even though the breakpoint is reported as bound and the code runs. Because the .NET 11 BCL is compiled with runtime async, this affects ordinary apps that never opt into the feature: for example, a breakpoint in a `Stream.ReadAsync` override awaited by `StreamReader.ReadToEndAsync` is never hit. Stepping into and out of such methods through the runtime-async thunks is also affected. The same scenario works on .NET 10. The fix binds breakpoints to async variants that are compiled from the method's own IL (including variants jitted before the debugger attached), and keeps stepping working through synthetic async thunks without skipping user-code async variants. ## Regression - [x] Yes - [ ] No Regression from .NET 10, introduced when the runtime began compiling async variants of Task-returning methods from the method's own IL (#128384). The debugger excluded every async thunk `MethodDesc` from breakpoint binding, which now also excludes those IL-backed variants. ## Testing - Reproduced the issue scenario on .NET 11 and on main, and verified with the fix that breakpoints in Task/ValueTask-returning methods awaited by runtime-async callers are hit, that step-in and step-out work through the async thunks, and that breakpoints bind when the debugger attaches after the variant was already jitted. - Ran the managed debugger async and stepping test suite against main with and without the fix; the fix introduced no new failures. - Full CI on #137764 in main. - This backport is a clean cherry-pick of the main commit (same three files). The scenario was missed because existing debugger tests did not cover breakpoints in non-async Task-returning methods awaited through runtime-async callers. ## Risk Low. The change is limited to the debugger's breakpoint binding and stepping logic (`controller.cpp`, `functioninfo.cpp`) and debugger stub tracing (`stubmgr.cpp`), which only run with a managed debugger attached. It narrows an existing exclusion so that it skips only thunks that are not compiled from user IL. No code generation or runtime behavior changes when no debugger is attached. Co-authored-by: Tom McDonald <[email protected]> Co-authored-by: Copilot <[email protected]> Copilot-Session: 54e87508-5323-495e-bc5b-d7f7b14605f9
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.
Summary
Fixes #137559