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 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 .
- 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 .
- 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 . The Execute Assignment Expression dialog starts. For details, see the dialog's online help.
<variable name>:=
For example, you select the
task.child.process
variable in the script. Then, on
the shortcut menu, you click
. The
Execute Assignment Expression dialog starts and
contains this expression:
task.child.process:=
Evaluating expressions
To evaluate expressions:
- Switch to the Debug perspective and open the Expressions view.
- Start a session in debug mode.
- 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.