Anjuta IDE Manual
<<< Previous | Debugging | Next >>>

# 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.

<<< Previous | Home | Next >>>
Breakpoints | Up | Stack Trace