Skip to content

feat(debugger): add expression evaluation and variable editing tools#51

Merged
CalvinAllen merged 1 commit intomainfrom
feat/debugger/evaluate-and-set-variable
Mar 24, 2026
Merged

feat(debugger): add expression evaluation and variable editing tools#51
CalvinAllen merged 1 commit intomainfrom
feat/debugger/evaluate-and-set-variable

Conversation

@CalvinAllen
Copy link
Contributor

Summary

  • Adds debugger_evaluate tool for evaluating arbitrary expressions in the current debug context (like the Immediate Window), using Debugger2.GetExpression()
  • Adds debugger_set_variable tool for modifying local variable values during a debug session, using Expression.Value setter
  • Adds ExpressionResult model for returning evaluation results with expression, value, type, and validity
  • Both tools require the debugger to be in Break mode

Closes #47

Test plan

  • Break at a breakpoint, use debugger_evaluate with a simple variable name — should return its value and type
  • Use debugger_evaluate with a complex expression (e.g., list.Count, x + y) — should evaluate correctly
  • Use debugger_evaluate with an invalid expression — should return IsValidValue: false
  • Call debugger_evaluate when not in Break mode — should return appropriate message
  • Use debugger_set_variable to change a local variable's value, then debugger_get_locals to verify the change
  • Use debugger_set_variable with a non-existent variable name — should return failure
  • Use debugger_set_variable with an invalid value for the type — should return failure

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.
@CalvinAllen CalvinAllen merged commit 263e158 into main Mar 24, 2026
2 checks passed
@CalvinAllen CalvinAllen deleted the feat/debugger/evaluate-and-set-variable branch March 24, 2026 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Edit and evaluate locals/memory

1 participant