Evaluating expressions

LN Studio enables you to create watch expressions.

When the Virtual Machine suspends a session (due to hitting a breakpoint or stepping through code), you can evaluate these expressions in the context of a stack frame.

Creating watch expressions

To create a watch expression that is executed each time you step through the execution, complete one of these steps:

  • Right-click in the Expressions view. On the shortcut menu, select Add Watch Expression and type the name of the expression you want to evaluate.
  • In the LN Studio Script Editor, select the expression you want to evaluate. Right-click and, on the shortcut menu, select Watch.
  • When you are debugging a session, go to the Variables view. Right-click a variable you want to evaluate and, on the shortcut menu, click Create Watch Expression.
  • Specify a condition or modification watchpoint; a watch expression is added automatically.

The watch expressions you enter are stored automatically. So, the next time you debug a session, the same expressions are available in the Expressions view.

Executing Assignment Expressions

To define an expression that must be executed only once, right-click in the script editor or right-click in the Expressions view and, on the shortcut menu, select Execute Assignment Expression. The Execute Assignment Expression dialog starts. For details, see the dialog's online help.

Note: If you select a variable name in the script editor before you start the Execute Assignment Expression command, this expression is displayed in the dialog: <variable name>:=

For example, you select the task.child.process variable in the script. Then, on the shortcut menu, you click Execute Assignment Expression. The Execute Assignment Expression dialog starts and contains this expression: task.child.process:=

Evaluating expressions

To evaluate expressions:

  1. Switch to the Debug perspective and open the Expressions view.
  2. Start a session in debug mode.
  3. In the Debug view, select the stack frame in which you want to perform an evaluation. The expressions in the Expressions view are evaluated automatically.
    • For the detail pane of the Expressions view, the evaluation context is a selected variable.
    • If you do not select a variable, the selected stack frame is the context.
Note: When you edit a watch expression in the Expressions view, you can use the Reevaluate Watch Expression command in the view's shortcut menu to evaluate the watch expression again.