This chapter describes the interactions you need in order to use the debugger. Topics include the interface in general:
as well as the windows and menus that are widely used:
The debugger displays its information in windows. You can use a mouse or the keyboard to access all the features in the user interface.
In Photon, wd's windows appear as character panels in a graphical window. Don't resize the graphical window, as wd won't refresh its character panels properly. |
A sample of a wd window is shown below:
Each window has the following controls:
You can activate a window's System Menu by clicking once on the close button.
The current window is the one whose title bar is colored. Press Ctrl-Tab to move from window to window.
You can also choose Size from the System Menu to change the size of a window. Use the cursor keys to resize the window, and press Enter when the window is the right size.
When you use the Size command, only the right and bottom sides of the window can be moved. |
If you've memorized the highlighted menu character, you can bypass the menu and activate the menu item directly by pressing the Ctrl key in conjunction with that character. The items that appear in the menu depend on the current window. These menus are described in detail throughout this manual.
In Photon, the combinations Ctrl-C, Ctrl-H, and Ctrl-I don't work. All the other shortcuts work. |
The Action item in the main menu is identical to the context-sensitive popup menu for the current window, so you can use whichever is more convenient. |
You can select text with either the left or right mouse button. If you use the right button, the popup menu appears when you release the button. With the keyboard, hold Shift while using the cursor keys. You can select a single character, and the debugger automatically extends the selection to include the entire surrounding word.
You can use the Shift key to select text only if wd is running on a console device. |
You'll find a number of menu items at the top of the debugger window. You can select a menu item with the mouse, or with the Alt key and the highlighted character from the menu title. Use the cursor keys to move between menus and menu items. To select an item, press Enter; to close a menu without choosing an item, press Esc.
Many menu items have accelerators or keyboard equivalents. They appear to the right of the menu item. As you learn the debugger, take time to learn the accelerators - they'll help you use the debugger more effectively.
Dialogs appear when you choose a menu item that doesn't perform an immediate action. They allow you to make choices and set options. To give focus to an item in a dialog, click on it, or use Tab or Shift-Tab to move to it. The dialogs contain the following:
Accelerators are keys that you can press instead of selecting a menu item or typing commands. The debugger comes with a standard set of accelerators that you can view by choosing Accelerators from the Window menu.
If you're used to the CodeView debugger, you should be comfortable with the Watcom Debugger's default set of accelerators. If you're used to using Turbo Debugger, you can select accelerators that are similar to its accelerator definitions. To select Turbo accelerators, choose Accelerator from the Window menu, then select TD Keys from the Action menu.
Accelerator | Equivalent command |
---|---|
/ | Search/Find... |
CTRL-\ | Search/Next (see note below) |
? | add a new expression to the Watch window |
F1 | invoke the Help facility |
F2 | Data/Registers |
F3 | toggle between source level and assembly level debugging |
F4 | Window/Application |
F5 | Run/Go |
F6 | Window/Next |
F8 | Run/Trace Into |
F9 | Break/Toggle |
F10 | Run/Step Over |
SHIFT-F9 | add a new item to the watch window |
CTRL-F4 | close the current window |
CTRL-F5 | restore the current window to its normal size |
CTRL-F6 | rotate the current window |
CTRL-F9 | minimize the current window |
CTRL-F10 | maximize the current window |
ALT-F10 | display the floating popup menu for the current window |
CTRL-TAB | rotate the current window |
CTRL-LEFT | Undo/Undo |
CTRL-RIGHT | Undo/Redo |
CTRL-UP | Undo/Unwind Stack |
CTRL-DOWN | Undo/Rewind Stack |
CTRL-BACKSPACE | Undo/Home |
ALT-1 | Data/Locals |
ALT-2 | Data/Watches |
ALT-3 | Code/Source |
ALT-4 | File/View... |
ALT-5 | Data/Memory at... |
ALT-6 | Data/Memory at... |
ALT-7 | Data/Registers |
ALT-8 | Data/80x87 FPU |
ALT-9 | File/Command... |
CTRL-z | Window/Zoom |
SPACE | Run/Step Over |
. | display the floating popup menu for the current window |
: | File/Command... |
= | Search/Match |
n | Search/Next |
N | Search/Previous |
u | Undo/Undo |
U | Undo/Redo |
b | Break/At Cursor |
e | Data/Memory at... |
g | Run/Execute to... |
h | move cursor left one |
i | Run/Trace Into |
j | move cursor down one |
k | move cursor up one |
l | move cursor right one |
t | Break/Toggle |
x | Run/Next Sequential |
Don't use the CTRL-\ accelerator in a pterm window; it kills wd. |
Accelerator | Equivalent command |
---|---|
F2 | Break/Toggle |
F3 | Code/Modules |
F4 | Run/Run to Cursor |
F5 | Window/Zoom |
F6 | Window/Next |
F7 | Run/Trace Into |
F8 | Run/Step Over |
F9 | Run/Go |
ALT-F2 | Break/New... |
ALT-F3 | close the current window |
ALT-F4 | Undo/Undo |
ALT-F5 | Window/Application |
ALT-F7 | trace one assembly instruction |
ALT-F8 | Run/Until Return |
ALT-F9 | Run/Execute to... |
ALT-F10 | activate the popup menu for the current window |
CTRL-F2 | Run/Restart |
CTRL-F4 | open a new watch window |
CTRL-F7 | add a new item to the watch window |
The Status window appears at the bottom of the debugger screen. As you drag the mouse over a menu item, descriptive text about that menu item appears in the status window. Messages about the current status of the program and debugger warning messages also appear in the status window.
Most windows in the debugger have a context-sensitive popup menu. The Action menu contains the same menu items as the current window's popup menu. It may be used as an alternative to the popup menus. Instead of selecting text with the right mouse button and using the popup menu, you can select text with the left mouse button or keyboard and use the Action menu.
Choose Log from then Data menu to see the Log Window. The Log Window displays several different types of messages, including:
You can send the contents of any window to the log window by selecting To Log from the Window menu. You can then review the information later.
The Window menu allows you to control and arrange the windows on your screen.
The Window menu contains the following items:
This menu also contains a list of the wd windows. Choose a window to give it focus; a check mark indicates which window currently has focus.
The Help menu contains the following items that let you use the online help facility:
The File menu contains items that allow you to perform these file operations:
For more information on configuration files, see the section ``Customizing the Watcom Debugger'' in the chapter Starting Up the Debugger.
If you need another shell, you can also switch consoles in character-mode, or open a new pterm window in Photon. |
The Options dialog allows you to change the following settings:
Under QNX, a conflict is possible when Invoke is on. A path specified for a command filename is confused with the short form of the DO command (/). |
Use the Window Options dialog to define options related to the debugger's various windows. All of these options appear in a dialog when you choose Window Options from the File menu.
The Window Options dialog allows you to set options for the following windows:
The Assembly options allow you to define how your assembly code appears. You can set the following options:
Use the Variable options to set display options and to specify which members of a class you want displayed when a structure or class is expanded. You can set:
Turn on the hexadecimal option to display the floating-point registers in raw 10-byte hexadecimal format instead of the usual floating-point notation.
You can set the display width of a tab in the File options section. This value defaults to 8 spaces.
Use the Registers options to set:
For both Functions and Global Variables windows, you can turn on the Typed symbols option. This restricts the list of symbols to those defined in modules compiled with full debugging information (d2 option).
You can turn on Show All to allow the modules window to display all modules in your program, not just those that have been compiled with the d2 option.
The Accelerator window allows you to control the accelerators or keyboard equivalents used by the debugger. Choose Accelerator from the Window menu to open this window. The window displays four items relating to each accelerator definition:
Accelerators may apply either to all windows or to a specific window. You could define F2 to perform a different action depending upon which window is current. Accelerators that apply to all windows have a window type of all.
An accelerator can define one of three action types:
You can modify an element of an accelerator definition by double-clicking on it, or by cursoring to it and pressing Enter. Press the right mouse button to access the following menu items:
The Code menu allows you to display windows that show different information related to your code:
The Data menu contains a number of windows that you can open to view the state of your program's data: