Evaluating Expressions

To compute values of arithmetic expressions or function calls, use expression evaluators in the Expressions view.

You can examine static variables that the debuggers don't pick up as local variables. For example, if you define static int staticVar = 42; in a source file and then add staticVar as an evaluated expression, you should see 42 in the view when the debugger stops in the source file.

{Expressions view}

Adding Expression Evaluators

To add expression evaluators, drag an expression from the code editor to the Expressions view.

You can also:

  • Double-click in the Expressions or Locals view.
  • Select Add New Expression Evaluator from the context menu.

Enter the expression in the New Evaluated Expression dialog:

{New Evaluated Expression dialog}

The set of evaluated expressions is saved in your session.

Note: Expression evaluators are powerful, but slow down debugger operation significantly. Use them sparingly and remove them when you no longer need them.

Expression evaluators are re-evaluated whenever the current frame changes. The functions used in the expressions are called each time, even if they have side-effects.

JavaScript Expressions

The QML debugger can evaluate JavaScript expressions.

Available under certain Qt licenses.
Find out more.