Watch Window

The Watch window displays any program variables that you have selected. When you add a variable to the Watch window, the variable name appears in the Variable column, to the left of the variable's value. As the program executes, any changes to the values of the listed variables are displayed.

Note: Placing a watch on a variable does not cause the debugger to break when the value of the variable changes. If you want to monitor a variable and break when its value changes, use the Monitor tab of the Breakpoints window. For details, see Monitoring Variables Using the Breakpoints Dialog Box.

After you start a program in the AcuBench integrated debugger, you can set a watch in either of two ways:

  1. Use the Watch Window toolbar button to open the Watch window, or select Debug Window/Watch from the View menu. Double-click in a blank area of the Watch window to open a blank entry field, then enter the variable name.

    After you enter the name, the value displays automatically in the adjacent field.

  2. Select the desired variable name in your code, then right-click and select Add to Watch Window. You can also invoke this command from the Variable List by selecting a variable name in the box, right-clicking, and choosing Add to Watch Window.

    Note that the Watch window must already be open in order for this command to have an effect.

Once you have added variables to the Watch window, you can choose whether their values are displayed in standard alphanumeric format or hexadecimal format. To toggle between formats, right-click anywhere in the Watch window and select or de-select the Hexadecimal Display check box in the pop-up menu.

The Watch window can also be used to ACCEPT a variable as you debug. With the debugger window active, simply type a new value for the variable in the Value column of the Watch window. Note that you are able to add variables or change values in the Watch window only after you have entered or re-entered the debugger. When the program is in an ACCEPT loop, the Watch window remains visible, but is not enabled for editing.

To remove a variable from the Watch window, highlight the variable and press the Delete key.

Quick Watch Window

If the Watch window is not open, you can still retrieve the value of a variable by performing a quick watch. When you perform a quick watch, the selected variable and its value appear in a Quick Watch window. You can either close the Quick Watch window after viewing a variable's value, or click the Add Watch button to add the variable to the Watch window. If you add a watch on a variable when the Watch window is closed, AcuBench automatically opens the Watch window.

To perform a quick watch on a variable:

  • Double-click the desired variable in the Code Editor to open a Quick Watch window.
  • Highlight the desired variable in the Code Editor and click the Quick Watch toolbar button.
  • Right-click the desired variable in the Code Editor and select Quick Watch.

You can view the values of up to seven previously selected variables by choosing from the drop-down box at the top of the Quick Watch window.