-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[WIP][clr-interp] Add User Breakpoint Support for Interpreter Debugging #121911
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
base: main
Are you sure you want to change the base?
[WIP][clr-interp] Add User Breakpoint Support for Interpreter Debugging #121911
Conversation
| #ifdef FEATURE_INTERPRETER | ||
| EECodeInfo codeInfo((PCODE)patch->address); | ||
| IJitManager* pJitManager = codeInfo.GetJitManager(); | ||
| if (pJitManager != NULL && pJitManager == ExecutionManager::GetInterpreterJitManager()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once the JIT abstraction is implemented, can we remove this condition?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, if we implement the HardwareExecutionControl, we should be able to just call pJitManager->GetExecutionControl()->ApplyPatch(patch); without any checks.
This reverts commit 4bbc946.
Co-authored-by: Milos Kotlar <[email protected]>
0d9c6bc to
5b087e1
Compare
This PR implements support for setting and handling user breakpoints (
System.Diagnostics.Debugger.Break()) in interpreted code.Key Changes
Execution Control Abstraction (
executioncontrol.h/cpp)IExecutionControlinterface to abstract breakpoint operations across different execution strategies. Currently just for interpreter but will be extended to other codegens.InterpreterExecutionControlclass for interpreter-specific bytecode patchingApplyPatch(): Replaces bytecode instruction withINTOP_BREAKPOINTopcodeUnapplyPatch(): Restores original bytecode instructionPatch Mechanism:
INTOP_BREAKPOINTinstructionException Flow:
INTOP_BREAKPOINTopcodeSTATUS_BREAKPOINTexception with bytecode contextFirstChanceNativeException()Address Handling:
TODOs
FirstChanceNativeException()directly fromInterpBreakpoint, I hit issues with thread and stack limit asserts, thus I went back to raising and filtering the exception.