dbvi

 

NAME

dbvi - a terminal user interface for gdb  

SYNOPSIS

dbvi ... (parameters are as for gdb)  

DESCRIPTION

dbvi is a console utility which provides a full screen interface to gdb. It splits the screen into two windows, the lower containing the debugger command line interface, the upper containing a vi session which shows the current source file including terminal graphics for breakpoints and the current address.

The vi session is augmented with an extra "mode" apart from the usual command and insert modes. This is the "Debug" mode, where the arrow keys are used to substitute for some debugging commands rather than navigating (and which blocks most of the usual vi commands). Upon running the program to be debugged, this mode is entered into automatically. To enter this mode manually, type ^K ,to exit press the Escape key or ^K again. Note that the "set number" setting of vi is required for the operation of dbvi.

All gdb commands may be used from the lower CLI, and some are recognised by dbvi and reflected in the vi window. In addition, the following keys are functional:

TAB
toggle between the debugger window and the vi window.
^R
run or continue the program.
^X
set a breakpoint at the position of the cursor in the vi window.
^K
Enter "Debug" mode, where the arrow keys can be used for some debugging commands. To exit from this mode press the Escape key or ^K again. The arrow keys provide the following functionality:
Down
The same as gdb's "next", or "down" if the user has been traversing the stack.
Right
The same as gdb's "step", i.e., step into the function on the current line.
Left
The "finish" command, i.e., continue to the end of the current function and stop just after returning.
Up
The "up" command, i.e., traverse the stack.
^W
Access the application output screen or open an xterm. See Application Output below.
^L
Refresh the screen.

Note that these arrow keys will also work when the cursor is positioned in the debugger window only if the "set editing" setting of gdb is off. If this setting is on, the command line editing capability of gdb is available as usual.

Application Output. Given that dbvi is a terminal application and is designed to be able to be operated under a single terminal environment (as well as a windowed environment), special handling is provided for terminal output from the application that is being debugged. This allows a user to toggle between the application's screen and dbvi's screen when restricted to a single terminal, or to open an xterm in a windowed enviroment to handle the terminal input and output. The ^W key controls this behaviour.

Normal (printable) character output and input will be directed to the debugger window at the bottom of the screen, and unless the output is excessive the user will probably not need to be concerned about using the ^W key. If however dbvi detects that the application is using special character sequences to control terminal display (such as would occur with the use of curses or simply a clear screen command), then it will save all terminal output in a buffer and only display this buffer if the application is running or if the ^W key is pressed.

If X Windows is detected (dbvi checks to see if the WINDOWID environment variable is set) the effect is to open an xterm to contain the application output and to accept input. Otherwise ^W toggles between the dbvi screen and the application screen within a single terminal. Note that ^W will not work while the application is running, in case it uses this key, and that no other keys will work while the application screen is shown unless it is running.

Signal Handling. If the user types the interrupt key dbvi will either send the application an interrupt signal if it is running, or prompt to quit.

Other Notes. The "set height" command of gdb may be used to change the relative heights of the gdb and vi window. Note that to avoid gdb paging in the small window provided use "set height 0".

The "man" command may be used from the gdb prompt and the page will be displayed in the vi window.

 

OPTIONS

dbvi will pass any command line arguments directly to gdb.

 

BUGS

Not all typed commands that should or could be are interpreted. All debugger commands are however functional within the gdb session.

dbvi has only been tested on the following environments. HPUX 11, terminal types xterm, dtterm, vt220. SunOs 5.6, terminal types xterm, vt220. Linux, terminal types xterm, Linux.

If ^W is done to open an xterm after the program to be deubugged has started, it is impossible to change the program's environment variable TERM to reflect an xterm, which may cause display problems.