Skip to content

[release/11.0] Fix breakpoint and stepping behavior for runtime async variants - #137874

Merged
steveisok merged 1 commit into
release/11.0from
backport/pr-137764-to-release/11.0
Nov 20, 2026
Merged

steveisok merged 1 commit into
release/11.0from
backport/pr-137764-to-release/11.0

Conversation

@github-actions

@github-actions github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Backport of #137764 to release/11.0

Fixes #137559

/cc @tommcdon

Customer Impact

  • 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

  • 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 Fix breakpoint and stepping behavior for runtime async variants #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.

)

## 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 <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 54e87508-5323-495e-bc5b-d7f7b14605f9
@azure-pipelines

Copy link
Copy Markdown
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.

@tommcdon tommcdon added this to the 11.0.0 milestone Nov 18, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.

@steveisok
steveisok enabled auto-merge (squash) November 20, 2026 19:30
@steveisok

Copy link
Copy Markdown
Member

/ba-g Unrelated and tracked known issues.

@steveisok
steveisok merged commit 33f419e into release/11.0 Nov 20, 2026
119 of 123 checks passed
@steveisok
steveisok deleted the backport/pr-137764-to-release/11.0 branch November 20, 2026 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants