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:
toggle between the debugger window and the vi window.
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.
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.