Skip to content

Preserve stepping across runtime-internal callbacks - #137747

Open
tommcdon wants to merge 2 commits into
dotnet:mainfrom
tommcdon:dev/tommcdon/dbg-hide-internal-callbacks-20261117
Open

tommcdon wants to merge 2 commits into
dotnet:mainfrom
tommcdon:dev/tommcdon/dbg-hide-internal-callbacks-20261117

Conversation

@tommcdon

@tommcdon tommcdon commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Hide debugger trace calls for the runtime's thread memory-pressure callback and nested runtime helpers.
  • Restore tracing during first-chance exception notifications.

Validation

  • Built CoreCLR for Windows x64, Release.
  • Exercised visibility nesting, restoration, and thread isolation in a standalone native probe.

Tracking

Note

This description was generated with the assistance of GitHub Copilot.

Registering thread memory pressure can invoke managed runtime helpers while a debugger is stepping through native code. Avoid reporting those internal transitions as step destinations, including nested class initialization. Restore visibility for first-chance exception notifications so user callbacks can still be traced.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 63370845-5cde-4057-ab77-7bfe63f53e2e
@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.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke
See info in area-owners.md if you want to be subscribed.

@jkoritzinsky jkoritzinsky left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we need to use VisibleEvenIfNested for the assembly load user callback as well as the FirstChanceException one?

@tommcdon

Copy link
Copy Markdown
Member Author

Do we need to use VisibleEvenIfNested for the assembly load user callback as well as the FirstChanceException one?

Yes. I’m validating that behavior and checking other callbacks as well, then will push a fix.

Restore debugger visibility when notifying assembly-load subscribers so handlers remain step-in targets within hidden runtime callbacks.

Document visibility inheritance and the direct-call limitation.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: b3c33949-87d3-46e9-a950-50e48ae07c77
@tommcdon

Copy link
Copy Markdown
Member Author

Do we need to use VisibleEvenIfNested for the assembly load user callback as well as the FirstChanceException one?

Yes. I’m validating that behavior and checking other callbacks as well, then will push a fix.

Fix was pushed, this is ready for approval

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants