Sun Studio 12: Debugging a Program With dbx

Monitoring Expressions

Monitoring the value of an expression each time the program stops is an effective technique for learning how and when a particular expression or variable changes. The display command instructs dbx to monitor one or more specified expressions or variables. Monitoring continues until you turn it off with the undisplay command.

To display the value of a variable or expression each time the program stops, type:

display expression, ...

You can monitor more than one variable at a time. The display command used with no options prints a list of all expressions being displayed.

For more information, see display Command.