Skip to content

Evaluate

Evaluate is for one-off questions: type an expression, get an answer, move on. Ctrl+E opens the panel, Enter enters the input field, Esc leaves it.

How it differs from Watches

Evaluate Watches
Runs when you ask on every stop
Lives until the next question until you remove it
Good for a question, a side effect tracking a value over time

If you find yourself typing the same expression after every step, it belongs in Watches.

The frame matters

The expression is evaluated in the frame currently selected in the Call Stack. Select a different frame and the same expression can give a different answer — or stop resolving entirely, because the names in scope have changed.

Side effects are allowed here

An expression that calls a function really calls it, in the debuggee. That is often the point: nudging state to reproduce a condition, invoking a getter that formats a value, calling a validation routine to see what it says.

Because this happens exactly when you ask — not repeatedly, in the background — Evaluate is the right place for it. Just remember that you have changed the program's state, and the run is no longer pristine.

While the program is running

Expressions need a stopped program with a frame to evaluate in. While the program runs there is no frame, and evaluation has no context — stop the program first, at a breakpoint or with a pause.

Reading results

A result that is a structure or a collection is expandable, like a node in Variables. For a long value — a large JSON string, a big buffer — the Inspector is more comfortable: it shows the value in full and can copy or reformat it.