Debugging with GDB (February 2008)

Table Of Contents
Chapter 14: HP-UX Configuration-Specific Information 189
Start the process in one terminal and attach to it with Visual Interface
for WDB.
Use the tty command at the debugger prompt so the program’s input
and output are directed to another terminal.
Note: if the underlying GDB terminates abnormally when you are using
Visual Interface for WDB, do not close the Visual Interface for WDB win-
dow. Wait for a minute or two. Visual Interface for WDB captures the
stack trace and the debugging session details and sends you an email. You
can then forward this to HP when you report the problem. This is helpful
to HP in reconstructing the crash scenario.
14.26.1 Starting and stopping Visual Interface for WDB
You can use Visual Interface for WDB in either of two modes:
X-window-based graphical interface: Supports mouse and keyboard commands.
Terminal interface: Supports keyboard commands only.
Visual Interface for WDB accepts the same command line arguments as GDB so you
can add options to the startup command. See the man page for GDB for the list of
arguments.
To start Visual Interface for WDB in graphical mode with mouse support, run
Visual Interface for WDB with the command:
/opt/langtools/bin/vdb
To start Visual Interface for WDB in terminal user interface mode, run Visual
Interface for WDB with the command:
/opt/langtools/bin/vdb -tui
To stop Visual Interface for WDB, type quit on the WDB command line:
(wdb) quit
14.26.2 Navigating the Visual Interface for WDB display
The Visual Interface for WDB window consists of two areas:
Source pane at the top
Debugger pane at the bottom
You can use the arrow and pagination keys on the keyboard to move the cursor:
Pagination keys move the cursor in the source window, at the top, above the status
line.
Holding the shift key down while using the pagination keys moves the cursor in
the debugger window.
The up and down arrow keys move the cursor in the source window.
Holding the shift key down while using the up and down arrow keys move the
cursor in the debugger window.
The left and right arrow keys move the cursor in the debugger window.