Debugging Tools for Windows

Watch Window

The Watch window displays information about global variables, local variables, and registers. You can customize this window to show the items that you are tracking.

Opening the Watch Window

To open or switch to the Watch window, in the WinDbg window, on the View menu, click Watch. (You can also press ALT+2 or click the Watch (ALT+2) button () on the toolbar. ALT+SHIFT+2 will close the Watch window.)

The following figure shows an example of a Watch window.

The Watch window can contain four columns. The Name and Value columns are always displayed, and the Type and Location columns are optional. To display the Type and Location columns, click the Typecast and Locations buttons, respectively, on the toolbar.

Using the Watch Window

In the Watch window, you can do the following:

Unlike the Locals window, the Watch window is not affected by changes to the register context. In the Watch window, you can see and modify only those variables that are defined in the scope of the current program counter.

If you open a new workspace, the Watch window contents are discarded and replaced with those in the new workspace.

Toolbar and Shortcut Menu

The Watch window has a toolbar that contains two buttons (Typecast and Locations) and a shortcut menu with additional commands. To access the menu, right-click the title bar of the window or click the icon near the upper-right corner of the window (). The toolbar and menu contain the following buttons and commands:

Additional Information

For more information about controlling variables and a description of other memory-related commands, see Reading and Writing Memory. For more information about registers and their manipulation, see Reading and Writing Registers and Flags. For more information about docked, tabbed, and floating windows, see Positioning the Windows. For more information about all techniques that you can use to control debugging information windows, see Using Debugging Information Windows.

Build machine: CAPEBUILD