Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add instructions how to debug NativeAOT exceptions on the ARM64 #112006

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/coreclr/nativeaot/docs/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ You can launch a NativeAOT-compiled executable under the VS debugger by opening

To set a breakpoint that breaks whenever an exception is thrown, choose the `Breakpoints` option from the `Debug` -> `Windows` menu. In the new window, select `New` -> `Function breakpoint`. Specify `RhThrowEx` as the Function Name and leave the Language option at "All Languages" (do not select C#).

To see what exception was thrown, start debugging (`Debug` -> `Start Debugging` or `F5`), open the Watches window (`Debug` -> `Windows` -> `Watch`) and add following expression as one of the watches: `(S_P_CoreLib_System_Exception*)@rcx`. This leverages the fact that at the time `RhThrowEx` is called, the x64 CPU register RCX contains the thrown exception. You can also paste the expression into the `Immediate Window`; the syntax is the same as for watches.
To see what exception was thrown, start debugging (`Debug` -> `Start Debugging` or `F5`), open the Watches window (`Debug` -> `Windows` -> `Watch`) and add following expression as one of the watches: `(S_P_CoreLib_System_Exception*)@rcx` on x64, or `(S_P_CoreLib_System_Exception*)x0` on ARM64. This leverages the fact that at the time `RhThrowEx` is called, the registers RCX and X0 contain the thrown exception, on x64 and ARM64, respectively. You can also paste the expression into the `Immediate Window`; the syntax is the same as for watches.