Hide remaining managed EH helpers from the debugger stack - #131446
Open
tommcdon wants to merge 1 commit into
Open
Hide remaining managed EH helpers from the debugger stack#131446tommcdon wants to merge 1 commit into
tommcdon wants to merge 1 commit into
Conversation
After dotnet#130646 replaced DAC-side frame filtering with attribute-based hiding, managed exception-handling helpers that were previously hidden by class-wide DBI filtering now appear in the logical call stack (mdbg `where`, current-location, and stepping) on arm64/interpreter configurations. dotnet#130646 annotated most of these helpers but missed a few: - System.Runtime.EH.AppendExceptionStackFrameViaClasslib - System.Runtime.EH.UpdateStackTrace - System.Runtime.StackFrameIterator.Next (all three overloads) Annotate each with both [StackTraceHidden] and [DebuggerHidden], matching the convention already used by every other annotated helper in this shared code (the 8 EH.* throw/dispatch helpers, StackFrameIterator.Init, and System.Environment.CallEntryPoint). Validated on x64 and arm64: StackWalking.ExceptionStack/BigStackTest and the Exceptions suite (DivZeroTest, FirstChanceSuppressTest, ReflectionTest, TooManyTest) pass. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9db6edb0-ab23-43c8-9a18-192885f442a0
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 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: @agocke, @dotnet/ilc-contrib |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the NativeAOT runtime’s managed exception-handling and stack-walking helpers to be hidden from debugger logical call stacks by consistently applying the same hiding attributes already used for similar helpers in Runtime.Base.
Changes:
- Add
[StackTraceHidden]and[DebuggerHidden]to all threeSystem.Runtime.StackFrameIterator.Nextoverloads. - Add
[StackTraceHidden]and[DebuggerHidden]toSystem.Runtime.EH.AppendExceptionStackFrameViaClasslibandSystem.Runtime.EH.UpdateStackTrace.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/StackFrameIterator.cs | Annotates Next overloads to keep stack-walk iteration helpers out of debugger logical stacks, matching existing Init conventions. |
| src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/ExceptionHandling.cs | Annotates remaining EH stack-trace construction helpers to avoid surfacing internal runtime frames in logical call stacks. |
rcj1
approved these changes
Jul 28, 2026
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.
After #130646 replaced DAC-side frame filtering with attribute-based hiding, managed exception-handling helpers that were previously hidden by class-wide DBI filtering now appear in the logical call stack (mdbg
where, current-location, and stepping) on arm64/interpreter configurations. #130646 annotated most of these helpers but missed a few:Annotate each with both [StackTraceHidden] and [DebuggerHidden], matching the convention already used by every other annotated helper in this shared code (the 8 EH.* throw/dispatch helpers, StackFrameIterator.Init, and System.Environment.CallEntryPoint).
Validated on x64 and arm64: StackWalking.ExceptionStack/BigStackTest and the Exceptions suite (DivZeroTest, FirstChanceSuppressTest, ReflectionTest, TooManyTest) pass.