Using the WDB GUI · Using Quick Watch Home and Help Icons Keyword Index Home Using Help
Line Graphic
Line Graphic

Contents

Keyword Index

Using the WDB GUI
Starting and Exiting the WDB GUI
Loading a Program and Changing Program Settings
Opening Source Files
Changing the Working Directory
Saving and Restoring Debug Sessions
Setting Source Paths
Setting Object Paths
Viewing Your Code
Browsing Functions
Setting Signal Handling
Finding Specific Text in Your Code
Using the Command View
Using the Watch View
{short description of image} Using Quick Watch
Using the Local Variables View
Using the Call Stack View
Using the Threads View
Using the Registers View
Examining Memory Use
Using the Program Console
Using Breakpoints
Advancing Through Your Program
Fixing Code from within the Debugger
Starting and Stopping the Debug Process
Setting Debugger Preferences
Customizing Colors and Fonts

Reference Information

Troubleshooting

Using Help



Bullet Overview
Bullet Viewing the Value of a Variable in Quick Watch
Bullet Changing the Value of a Variable in Quick Watch
Bullet Adding a Quick Watch Variable to the Watch View
Bullet Tips
Bullet See Also

Line Graphic

Overview

The Quick Watch dialog box provides a way to quickly examine the value of a variable or expression. You can calculate the current value of a global variable, local variable, or variable not in the current stack. You can also use Quick Watch to edit the value of a variable or add a variable to the Watch view.

Line Graphic

Viewing the Value of a Variable in Quick Watch

You can display a specified variable or expression in the Quick Watch dialog box when your program is paused.

To view the value of a variable

  1. On the Debug menu, click Quick Watch.
  2. In the Expression text box, type the name of the variable you want to calculate, or select one from the drop-down list of variables entered during the current debug session.
  3. Click Recalculate. The value is displayed in the Current Value area.
  4. To expand an expression, click the plus sign (+) to the left of its name or double-click the line. To collapse an expression, click the minus sign (-) or double-click the line.
  5. When you have finished, click Close.

    See Tips for shortcuts to opening and using Quick Watch.
Line Graphic

Changing the Value of a Variable in Quick Watch

When the program is paused at a breakpoint or between steps, you can change the value of any variable in your program. This lets you try changes and see their results in real time or recover from certain logic errors.

To change a variable value in Quick Watch

  1. In the Quick Watch dialog box, click in the Expression text box. Type the name of the variable you want to calculate, or select one from the drop-down list of variables entered during the current debug session.
  2. Click Recalculate. The value is displayed in the Current Value area.
  3. Double-click the value you want to edit. A cursor appears in the Value field.
  4. Edit the variable's value.
  5. Press Enter to update the program with the modified variable value.
  6. When you have finished, click Close.

    See Tips in the Quick Watch Dialog Box reference topic for keyboard shortcuts.

    NOTES:
    • Press the Esc key to cancel the edit.
    • Character string pointers--You cannot change the content of the string, but you can change the address value to point to a string at a different memory address.
    • Character arrays -- You can edit the content of a character array, but there is no safeguard to prevent you from writing past the allocated array size. Also, the value must be entered inside double quotes.
Line Graphic

Adding a Quick Watch Variable to the Watch View

To monitor a specific variable, add it to the Watch view. The Watch view displays the names and values of variables you specify. You can watch global variables, local variables, or variables not in the current stack.

To add a Quick Watch variable to the Watch view

  1. In the Quick Watch dialog box, click in the Expression text box. Type the name of the variable you want to calculate, or select one from the drop-down list of variables entered during the current debug session.
  2. Click Add Watch.
  3. When you have finished, click Close.
Line Graphic

Tips

  • When you click Recalculate, the value of a variable is highlighted in red if it has changed since the previous query.
  • Click the Quick Watch toolbar button to open the Quick Watch dialog box. If you selected a variable name in the Source view, the variable is entered in the Expression text box.
  • From the Source view, highlight a variable name to select it. Right-click the selection and then choose Quick Watch from the pop-up menu. The Quick Watch dialog box is displayed with the selected variable entered in the Expression text box.
  • Keyboard shortcuts are available for moving in the Current Value area and editing a value. See Tips in the Quick Watch Dialog Box reference topic.
  • For viewing the value of a simple variable, the dwell feature is quicker than Quick Watch, but it does not provide as much information.
Line Graphic

See Also

Line Graphic

Return to Top