Oracle® Solaris Studio 12.4: Debugging a Program With dbx

Exit Print View

Updated: January 2015
 
 

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 stop it with the undisplay command. The watch command evaluates and prints expressions at every stopping point in the scope current at that stop point.

Use the display command to display the value of a variable or expression each time the program stops:

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.

Use the watch command to watch the value of the expression at every stopping point:

watch expression, ...

For more information, see watch Command.