Evaluate Expression
evaluate_expressionEvaluate expressions like variables or calculations during debugging sessions to inspect program state and diagnose issues.
Instructions
Evaluates an expression in the context of the debuggee's current state. Requires an active DAP connection and typically works best when the debuggee is stopped. The context parameter restricts what kind of evaluation is performed: "hover" (default, safe, no side effects) or "watch".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| expression | Yes | The expression to evaluate (e.g. "user.name", "arr.length", "x + y"). | |
| frame_id | No | The stack frame ID in which to evaluate the expression. If omitted, uses the top frame of the last stopped thread. | |
| context | No | The evaluation context. "hover" is safe and read-only. "watch" is also read-only but may format results differently. | hover |