feat(debugger): add expression evaluation and variable editing tools#51
Merged
CalvinAllen merged 1 commit intomainfrom Mar 24, 2026
Merged
Conversation
Add debugger_evaluate tool for evaluating expressions in the current debug context via Debugger2.GetExpression. Add debugger_set_variable tool for modifying local variable values via Expression.Value setter. Both require the debugger to be in Break mode.
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.
Summary
debugger_evaluatetool for evaluating arbitrary expressions in the current debug context (like the Immediate Window), usingDebugger2.GetExpression()debugger_set_variabletool for modifying local variable values during a debug session, usingExpression.ValuesetterExpressionResultmodel for returning evaluation results with expression, value, type, and validityCloses #47
Test plan
debugger_evaluatewith a simple variable name — should return its value and typedebugger_evaluatewith a complex expression (e.g.,list.Count,x + y) — should evaluate correctlydebugger_evaluatewith an invalid expression — should returnIsValidValue: falsedebugger_evaluatewhen not in Break mode — should return appropriate messagedebugger_set_variableto change a local variable's value, thendebugger_get_localsto verify the changedebugger_set_variablewith a non-existent variable name — should return failuredebugger_set_variablewith an invalid value for the type — should return failure