[clr-interp] Add initial CoreCLR interpreter func-eval support#126576
Draft
matouskozak wants to merge 4 commits intodotnet:mainfrom
Draft
[clr-interp] Add initial CoreCLR interpreter func-eval support#126576matouskozak wants to merge 4 commits intodotnet:mainfrom
matouskozak wants to merge 4 commits intodotnet:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds initial debugger func-eval support when the target thread is stopped in CoreCLR interpreter code, by avoiding native-context hijacking and instead running queued evals from the interpreter breakpoint path.
Changes:
- Adds a pending func-eval slot to the interpreter thread context and triggers execution after the breakpoint debugger callback returns.
- Extends
DebugInterface/Debuggerwith an interpreter-specific hook to execute pending evals. - Adjusts
FuncEvalSetup/DebuggerEvalinitialization to skip native-only setup (e.g., executable breakpoint segment allocation, SP alignment checks) for interpreter evals.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/vm/interpexec.h | Adds InterpThreadContext::m_pPendingFuncEval storage for interpreter-thread func-evals. |
| src/coreclr/vm/interpexec.cpp | Executes pending interpreter func-evals from the INTOP_BREAKPOINT handler using a synthetic filter context. |
| src/coreclr/vm/dbginterface.h | Adds ExecutePendingInterpreterFuncEval(Thread*) to the debug interface under FEATURE_INTERPRETER. |
| src/coreclr/debug/ee/debugger.h | Declares the Debugger implementation of ExecutePendingInterpreterFuncEval. |
| src/coreclr/debug/ee/debugger.cpp | Implements pending-eval execution and updates FuncEvalSetup/DebuggerEval to support interpreter eval flow. |
jkotas
reviewed
Apr 6, 2026
| // FuncEvalHijackWorker needs it to identify the thread as stopped in managed | ||
| // code and at a GC-safe point. Set a synthetic filter context here so that | ||
| // nested/subsequent func evals can pass the safety checks in FuncEvalSetup. | ||
| if (pThreadContext->m_pPendingFuncEval != NULL && g_pDebugInterface != NULL) |
Member
There was a problem hiding this comment.
Can this be done inside InterpBreakpoint?
CONTEXT is a very large structure. We do not want to add it to the main interpreter executor loop native frame. It would likely regress performance of the interpreter executor loop.
Contributor
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
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.
Description
This adds initial func-eval support for threads stopped in CoreCLR interpreter code.
Testing:
Future Work
#125959