Debugger Watches

Top  Previous  Next

Watches. The Watches panel enables you to display the current values of several variables. The values of watch variables are updated every time the debugger steps or stops, so the values are constantly up-to-date. If a watch variable is an array, you can include its subscripts, and the subscripts can be algebraic expressions. You also have the option of changing the display format of watch variables.

 

Watch List. To create or configure watch variables, select the Watches tab on the left-hand panel. The panel displays a list of all currently available watch variables and their current values. Double clicking on any item in the list will take you to the point where the variable was declared.

WatchPanel

 

Note: If you close the debugger and make changes to the source code, the variables could be renamed, shift memory positions or change scope in the code. For this reason, the debugger analyzes the variable list every time you enter the debugger. If you make large changes, the debugger may not be able to recover the correct variable. Be sure to check any watches you have previously set when re-entering the debugger.

 

The watch variables are added or manipulated using the buttons on the toolbar at the bottom. Here is a detailed description of each button:

 

SetWatch

Set Watch. Pressing the Set Watch button adds a new watch variable based on where the cursor is in the Source Code Panel. If you've highlighted a variable, that variable will be added to the watch list. If the variable is an array variable and you've highlighted array subscripts, those subscripts will be included with the watch variable. If you right click on the Source Panel, there is also a menu option that does the same thing.

 

NewWatchBtn

Enter New Watch. Pressing the Enter New Watch button lets you type a new variable into the list. The program enters a new dummy variable into the list and displays the Watch Properties Dialog for that variable. You can then set the variable name, subscripts, and display format for that variable.

 

WatchProperties

Watch Properties. Highlighting a variable in the watch list and pressing the Watch Properties button displays the Watch Properties Dialog for that variable. This lets you change the variable name, subscripts, and display format for that variable. It also lets you examine the underlying properties of the variable, such as its memory address, its variable type and where the variable was declared.

 

VarDisplay

Expanded Variable Display. Pressing this button brings up the Expanded Variable Display

 

ModifyBtn

Modify Variable. Pressing the Modify Button displays the Modify Variables Dialog, which lets you modify the value of the currently selected variable.

 

 

ImageBtn

Image Display. Pressing the Display Image button treats the currently selected variable as the handle to a bitmap image and displays the image in the Image Dialog.

 

VariablesBtn

Variable List. Pressing the Variable List button displays the Variable List Dialog, which contains a list of all variables used in the program. It enables you to select one or more variables to "watch."

 

CopyWatchesBtn

Copy Values. Pressing this button copies all the variables in the Watch List and their current values to the Windows clipboard.

 

ArrowBtns

Arrow Buttons. These buttons let you move watch items up and down in the list. This is useful for organizing your watches and putting them into a logical order. For example, you might want to keep a pair of Cartesian coordinate variables together and in the proper X-Y order.

DeleteBtn

Delete Button. Pressing the Delete Button deletes the currently selected Watch Variable from the list.

 

ClearBtn

Clear Button. Pressing the Clear Button removes all Watch Variables from the list, emptying the list.