Each CodeView window has a different function and operates independently of the others. Only one window can be active at a time. Commands you choose from the menus or by using shortcut keys affect the active window. The following list briefly describes each window's function:
Source
Displays the source or assembly code for the program you are debugging. You can open a second Source window to view an include file or any ASCII text file.
Command
Accepts debugging commands from the keyboard. CodeView displays the results, including error messages, in the Command window. When you enter a command in a dialog box, CodeView displays any resulting errors in a pop-up window.
Watch
Displays the values of variables and expressions you select. You can modify the value of watched variables, browse the contents of structures and arrays, and follow pointers through memory.
Local
Lists the values of all variables local to the current scope. You can set Local window options to show other scopes. You can modify the values of variables displayed in the Local window.
Memory
Displays the contents of memory. You can open a second Memory window to view a different section of memory. You can set Memory window options to select the format and address of displayed memory. You can directly change the displayed memory by typing in the Memory window.
Register
Displays the contents of the machine's registers and flags. You can directly edit the values in the registers, and you can toggle flags with a single keystroke or mouse click.
8087
Displays the registers of the hardware math coprocessor or the software emulator.
Help
Displays the Microsoft Advisor Help system.
The first time you run CodeView, it displays three windows. The Local window is at the top, the Source window fills the middle of the screen, and the Command window is at the bottom. The Local window is empty until you trace into the main part of the program.
You can open or close any CodeView window. However, at least one Source window must remain open. When you exit CodeView, it records which windows are open and how they are positioned, along with their display options. These settings become the default the next time you run CodeView.
To open a window, choose a window from the Windows menu. Some operations, such as setting a watch expression or requesting help, open the appropriate window automatically.
You can change how CodeView displays information in the Source, Memory, and Local windows. Choose the appropriate window options command from the Options menu. When the cursor is in one of these windows, you can press CTRL+O to display that window's options dialog box.
CodeView automatically updates the windows as you debug your program. To interact with a particular window (such as entering a command or modifying a variable), you must select it. The selected window is the “active” window. The active window is marked in the following ways:
The window's frame is highlighted.
The window casts a shadow over other windows.
The cursor appears in the window.
The horizontal and vertical scroll bars move to the window.
To make a window active, click anywhere in the window or in the window frame. You can also press F6 or SHIFT+F6 to cycle through the open windows, making each one active in turn. You can also choose a window from the Windows menu or press ALT plus a window number. In addition, some CodeView commands make a certain window active.
Moving Around in CodeView Windows
To move the cursor to a specific window location, click that location. You can also use the keyboard to move the cursor as shown in Table 9.1.
Table 9.1 Moving Around with the Keyboard
Action | Keyboard |
Move cursor up, down, left, and right | UP ARROW, DOWN ARROW, LEFT ARROW, RIGHT ARROW |
Move cursor left and right by words | CTRL+LEFT, CTRL+RIGHT |
Move cursor to beginning of line | HOME |
Move cursor to end of line | END |
Page up and down | PAGE UP, PAGE DOWN |
Page left and right | CTRL+PAGE UP, CTRL+PAGE DOWN |
Move cursor to beginning of window | CTRL+HOME |
Move cursor to end of window | CTRL+END |
Move to next window | F6 |
Move to previous window | SHIFT+F6 |
Restore window | CTRL+F5 |
Move window | CTRL+F7 |
Size window | CTRL+F8 |
Minimize window | CTRL+F9 |
Maximize window | CTRL+F10 |
Close window | CTRL+F4 |
Tile windows | SHIFT+F5 |
Arrange windows | ALT+F5 |