man cgdb (Commandes) - a curses frontend to GDB
NAME
cgdb - a curses frontend to GDB
SYNOPSIS
cgdb [--version | --help | -d <debugger>] [gdb options]
DESCRIPTION
CGDB is a curses-based interface to the GNU Debugger (GDB). The goal of CGDB is to be lightweight and responsive; not encumbered with unnecessary features.
The interface is designed to deliver the familiar GDB text interface, with a split screen showing the source as it executes. The UI is modeled on the classic Unix text editor, vi. Those familiar with vi should feel right at home using CGDB.
Some features offered by CGDB are: - Syntax-highlighted source window - Visual breakpoint setting - Keyboard shortcuts for common functions - Searching source window (using regexp)
USAGE
on top, the "GDB window" is on bottom. The interface has two modes, depending on which window is focused. "CGDB mode" is when the source window is focused, "GDB mode" is when the GDB window is focused.
When CGDB is invoked, the interface is in GDB mode. A '*' at the right of the status bar indicates that input will be passed to GDB. To change the focus to the source window, hit ESC. The interface is now in CGDB mode.
To switch back into GDB mode, press 'i'. This syntax is based on the popular Unix text-editor, vi.
Passing Input to Programs
visible by default. This is because it is only needed if the user wishes to send data to the program being debugged. To display the tty window, hit 'T' while in command mode. After hitting 'T' you will notice that there is another window in the middle of the 'source window' and the 'gdb window'. This is called the 'tty window'. You will also see a new status bar called the tty status bar. There will be a '*' on the tty status bar after the 'T' was hit. This is because when the window is opened with the 'T' command, cgdb automatically puts the user into 'tty mode'. To get out of this window hit 'ESC'. This will put you back into command mode. To make the tty window appear and disappear hit the 'T' key while in command mode. It is a toggle.
Once the tty window is already open, the user can then hit 't' in command mode to get into tty mode. The user can then hit 'ESC' in tty mode to get back into command mode.
When the tty window is open, all data that comes from the program, goes there. Any data typed into the tty window will ONLY go to the program being debugged. It will not go to gdb. When the tty window is closed, all output from the debugged program will go to the 'gdb window' AND to the 'tty window' ( for viewing later when the tty window is opened ) .
If the user wishes to get a new tty for the program being debugged then they can type 'Control T'. This will delete all the buffered data waiting to be read into the debugged program. This might be useful when you rerun or start a new program.
Automating Commands in CGDB
There may be several features that you find usefull in CGDB. CGDB is capable of automating any of these commands through the use of the config file called cgdbrc. It looks in $HOME/.cgdb/cgdbrc for the file. If it exists, CGDB executes each line in the file in order. It is as if the user typed in all the commands into the status bar after the tui was initialized.
Eventually this file will be used to create macros and high level key bindings. Until then, it is a very usefull way to automate simple commands.
KEYBINDING
Please note that the user interface has not been completed and some of these commands may change in the future
At Source Window
ESC Puts the user into command mode i Puts the user into gdb mode t Puts the user into tty mode T Opens a window to give input to the debugged program Control-T Opens a new tty for the debugged program up arrow up a line. j up a line. down arrow down a line. k down a line. left arrow left a line. h left a line. right arrow right a line. l right a line. page up up a page ^b up a page ^u up 1/2 a page page down down a page ^f down a page ^d down 1/2 a page gg top of file G bottom of file / search ? reverse search n next forward search N next reverse search o open the file dialog spacebar Sets a breakpoint at the current line number b View the previous source file f View the next source file - Shrink source window 1 line = Grow source window 1 line _ Shrink source window 25% (or, shrink tty window 1 line, if visible) + Grow source window 25% (or, grow tty window 1 line, if visible)
Shortcut Commands
n next s step u up d down f finish r run c continue
Colon Commands
NOTE: all options are off by default :continue send a continue command to gdb :finish send a finish command to gdb :help Opens the help dialog :insert move focus to the gdb window :next send a next command to gdb :quit Quit cgdb (may be abbreviated as :q) :quit! Quit cgdb, even if debugged program is running (abbreviated as :q!) The following variables change the behavior of some aspect of cgdb. Many of these commands may be abbreviated in some way, and all boolean commands my be negated by appending 'no' to the front. For example:
:set ignorecase
turns on case-insensitive searching; while
:set noignorecase
turns on case-sensitive searching.
:set ignorecase Sets searching case insensitive (:set ic) :set shortcut Enables shortcut commands typed in source window (:set sc) :set winsplit Set the split point between source and gdb window (especially useful as an init setting in cgdbrc) values={top_full, top_big, even, bottom_big, bottom_full} (:set ws) :set winminheight The minimal height of a window. Windows will never become smaller than this value. (:set wmh) :set tabstop Number of spaces that a <Tab> in the file counts for. :set syntax Sets the current highlighting mode of the current file. values={c,ada,off} (:set syn) :set escdelay Set the length of time to wait before timing out and treating the ESC keystroke as the ESC character rather than combining it with other characters in the buffer to create a key sequence. The variable is measured in milli seconds. If ESCDELAY is 0, the system immediately composes the ESCAPE response without waiting for more information from the buffer. The user may choose any value between 0 and 10000, inclusive. The default setting for the ESCDELAY environment variable is 40 (forty tenths of a second).
At gdb and tty window
ESC Back to source window page up up a page page down down a page F11 home F12 end
OPTIONS
cgdb itself doesnt really take a lot of options, but you can pass all gdb options, please refer to the gdb documentation.
- --version
- Print version information and then exit.
- --help
- Print help (this message) and then exit.
- -d <debugger>
- Set debugger to use.
SEE ALSO
AUTHOR
This manual page was written for the Debian GNU/Linux system by Robert Lemmen <robertle@semistable.com> (but may be used by others, of course)