Repository navigation
[release/11.0] Fix breakpoint and stepping behavior for runtime async variants - #137874
Merged
Merged
Conversation
) ## Summary - Bind breakpoints to async variants that execute user code, including variants compiled before debugger attachment. - Preserve stepping through synthetic async thunks without skipping user-code async variants. Fixes #137559 --------- 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 |
This was referenced Nov 19, 2026
steveisok
approved these changes
Nov 20, 2026
steveisok
enabled auto-merge (squash)
November 20, 2026 19:30
Member
|
/ba-g Unrelated and tracked known issues. |
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.
Backport of #137764 to release/11.0
Fixes #137559
/cc @tommcdon
Customer Impact
Reported in #137559. In .NET 11, a breakpoint in a method that returns
Task/ValueTask(and is not itselfasync) 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 aStream.ReadAsyncoverride awaited byStreamReader.ReadToEndAsyncis 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
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
MethodDescfrom breakpoint binding, which now also excludes those IL-backed variants.Testing
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.