Working with Expressions

FIXME:

Evaluating expressions

When control is returned from a program — possibly at a breakpoint — it is possible to evaluate expressions or inspect the values of variables in the program. Choose the menu item Debug->Inspect/Evaluate …, or click the Inspect button on the Debug Toolbar. A dialog prompting for the expression will appear. Supply a valid C expression, or a variable name, and click on OK.

Figure 5. Inspect/Evaluate dialog

A window will appear showing the result of the evaluation.

Figure 6. Evaluation result

Alternatively, it is possible to highlight the expression in the editor and perform the above steps. This will save typing the expression in the Inspect dialog.

The expression may be any valid C expression and may include function calls from the program, library calls, system calls, etc..

Expression Watch

Inspecting or evaluating an expression provides the result only once. To continuously monitor some variables or expressions, use expression watch.

Add all the expressions and variables to monitor in the watch. These values will be automatically updated and shown in the expression watch window.

Figure 7. Expression Watch window

Adding an expression to watch

Choose the menu item View->Watch Window. Right-click on the expression watch window to open the Operation menu. Choose the menu item Add. A dialog prompting for the expression will appear. Enter the expression and click OK.

Figure 8. Add Expression dialog

If the expression was selected in the editor prior to the addition, it will automatically appear in the dialog.

Removing an expression from watch

Choose the menu item View->Watch Window. Right-click on the expression watch window to open the Operation menu. Choose the menu item Remove to remove the entry.

Clearing the watch

Choose the menu item View->Watch Window. Right-click on the expression watch window to open the Operation menu. Choose the menu item Clear to update or clear.

Local varables

Local variables of the current frame (the current funtion in which the program control is present), displayed and updated in the Locals pane of the message manager. During execution of the program (eg. during single stepping), local variables will be updated. If any varialble value was changed in the last debugging step, its value will be highlight in red. The variables are presented in a tree form for easy view.

Figure 9. Local variables

Varables tips

Variable tips is a quick way to find out the value of a variable. Hover the mouse cursor over the variable name whose value you would like to have and wait for a couple of seconds. The value of the variable (if availabe with the debugger) will be displayed as a tip.

Figure 10. variable-tip