-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Open
Description
Description
This issue outlines work for debugging support on the CoreCLR interpreter.
Entry points
Tasks:
- Add a new optimization tier OptimizationTierInterpreted
- Report this tier through DAC
- After interpreting a method, call
JITCompleteto register it with the debugger using the bytecode address instead of native code
Interpreter
Tasks:
- Implement the
INTOP_BREAKPOINTopcode in the interpreter - Call the debugger interface and raise a
STATUS_BREAKPOINTexception with bytecode IP, frame, stack parameters - In the SEH filter, detect
STATUS_BREAKPOINTand callFirstChanceNativeExceptionso the debugger is notified - Resume normal execution after the debugger handles the breakpoint
- Implement
InterpreterCodeManager::GetFunctionSize()to return the byte length of the interpreted code
Patches
Tasks:
- Add a new patch kind:
PATCH_KIND_NATIVE_INTERPRETERfor interpreter breakpoints - In
ApplyPatch, detect interpreter addresses and and insert anINTOP_BREAKPOINTinstruction into the bytecode - In
UnapplyPatch, restore the original bytecode
IL mapping
Tasks:
- Update
AddBindAndActivateILReplicaPatchto bind breakpoints directly to IL offsets for interpreted methods - In
MatchPatchandScanForTriggers, skip comparing bytecode addresses to native IPs - In
DispatchPatchOrSingleStep, handle interpreter breakpoints separately to avoid false IP-change detection - Initialize
CodeRegionInfofor interpreted methods using the IL bytecode range (no hot/cold split) - Skip native bound initialization in
DebuggerJitInfofor interpreted methods
DoD: Hit breakpoint in a sample desktop app via Debugger.Break() and in VSCode. Run debugger tests in the CI.