15.1 Understanding Windows in CodeView

CodeView divides the screen into logically separate sections called windows. Windows permit a large amount of information to be displayed in an organized and easy-to-read fashion.

Summary: Each window displays a different type of data.

Each CodeView window has a distinct function and operates independently of the others. The name of each window described below appears in the top of the window's frame:

The Source window displays the source code. You can open a second source window to view an include file, another source file, or the same source file at a different location. Any ASCII text file can be viewed in the Source window.

The Command window accepts debugging commands from the keyboard.

The Watch window displays the current values of selected variables.

The Local window lists the values of all variables local to the current procedure.

The Memory window shows the contents of memory. You can open a second Memory window to view a different section of memory.

The Register window displays the contents of the microprocessor's registers, as well as the processor flags.

The 8087 window displays the registers of the coprocessor or its software emulator.

Figure 15.1 shows all CodeView windows.

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. CodeView records which windows were open and how they were positioned at the time you exit. These settings become the default the next time you run CodeView.

There are two ways to open windows. You can choose the desired window from the View menu or press its shortcut key. In addition, some operations (such as selecting a Watch variable) automatically open the appropriate window if it isn't already open.

Summary: All displays are updated automatically.

CodeView continually and automatically updates the contents of all windows. However, if you want to interact with a particular window (such as entering a command, setting a breakpoint, or modifying a variable), you must first select that window.

The selected window is called the “active” window. The active window is marked in three ways:

The window's name is highlighted.

The text cursor appears in the window.

The vertical and horizontal scroll bars move into the window.

Figure 15.2 shows the Source window as the active window.

To select a new active window, click that window (position the mouse pointer in the window and press the left mouse button). You can also press F6 or SHIFT+F6 to move from one window to the next.

Windows often contain more information than can be displayed in the area allotted to the window. There are several ways to view these additional contents.

To view additional contents with the mouse:

Drag the scroll box on the horizontal or vertical scroll bars. (Position the mouse pointer on the scroll box and, while holding down the left mouse button, move the mouse in the appropriate direction.)

Click the arrows at the top and bottom of the scroll bars.

Click the gray area to either side of the scroll box in a scroll bar.

To view additional contents with the keyboard:

Press the direction keys (LEFT, RIGHT, UP, DOWN) to move the cursor.

Press PGUP, PGDN, CTRL+PGUP (page left), and CTRL+PGDN (page right) to move the cursor to a different page of the window's contents.

Press CTRL+HOME to move the cursor to the beginning of the window's contents.

Press CTRL+END to move the cursor to the end of the window's contents.

Typing commands when the Source window is active causes CodeView to temporarily shift its focus to the Command window. Whatever you type is appended to the last line in the Command window. If the Command window is closed, CodeView beeps in response to your entry and ignores the input.

Adjusting the Windows

Although you can't reposition the windows, you can change their size or close them. The Maximize, Size, and Close commands from the View menu perform these functions, or you can press CTRL+F10, CTRL+F8, and CTRL+F4, respectively. Window manipulation is especially easy with a mouse:

To maximize a window (enlarge it so it fills the screen), click the up arrow at the right end of the window's top border, or double-click the window's title. (Position the mouse pointer anywhere on the title and press the left mouse button twice, rapidly.) To restore the window to its original size, click the double arrow at the right end of the top border or press CTRL+F10.

To change the size of a window, position the mouse pointer anywhere along the line at the top of the window. Press and hold down the left mouse button, then drag the mouse to enlarge or reduce the window. The same action on a vertical border widens or narrows the window.

To close a window, click the dot at the left end of the top border. The adjacent windows automatically expand to recover the unused space. You can also close any window whose View menu name has a dot next to it: choose that window from the menu or press the window's shortcut key.

Summary: CodeView remembers the last debugging session.

CodeView stores session information in a file called CURRENT.STS, which is created in the directory pointed to by the INIT environment variable (or in the current directory, if there is no INIT variable). The session information includes such items as the name of the program being debugged, the CodeView windows that were open, breakpoint locations, and other status. This information becomes the default status the next time you run CodeView.