Get ccdebug at Fast, secure and Free Open Source software downloads

ccdebug - a graphical gdb debugger frontend

Debugging with ccdebug

First of all, press the right mouse button to get help and to open a context menu displaying all available options. All is at your fingertips. Note also the "Help" button in the session dialog (Esc-U).

contect menu

Esc-U Opens the debug session dialog (Alternative: press right mouse button). This is where debug sessions are defined/selected/copied/deleted and started.
To get started press the "New" button, and enter "test debug session" as session name. Then click on the "Executable" button and select the executable to debug in the file selection dialog. Don't change the "Stop in main" checkbox, and press the "OK" button. The file main.cpp should open, the first source code line in main() should be displayed in reverse colors, indicating the current execution position. Press F10 to step to the next line. Press F5 to run the application.
F9 Set breakpoint, delete breakpoint (when a debug session is open)
F5 Run. That the application is running is indicated by a green bar on the left.
F10 Step over function
F11 Step into function
Alt-F10 Run to cursor (Alternative: "Run to here" in the context menu)
Shift-F11 Leave function
Ctl-C Interrupt running program. In case of remote debugging: press Ctl-C on the remote machine in the console gdbserver is running in (see also the readme file). A brown bar on the left indicates that the program stopped, and that you may examine (among other things) the thread list and the corresponding callstacks.
Ctl-Space Activates variable name completion in the memory, variables and quick evaluation dialogs. The selection list contains tokens from the current source file matching the characters entered in the text field.
Alt-Ctl-B Opens the "Breakpoints dialog", displaying the breakpoint list. If the cursor was on a source code line with a breakpoint before pressing Alt-Ctl-B, then the focus is on the corresponding line in the list and you may define a breakpoint condition here.
Alt-Ctl-C Opens the callstack window. Activate a line to go to source code position. You may copy the callstack entries to the clipboard with Ctl-C.
Alt-Ctl-E Opens an "Evaluate" dialog, to evaluate expressions. Hint: Press F4 to open the combobox and select an expression already entered.
Alt-Ctl-F Opens the "Source Files" dialog. This dialog displays the filenames of the source files recognized by gdb. Press the update button to update the list (e.g. after a shared library was loaded). Double-Click on a line to go to source code.
Because gdb/migdb reports relative pathnames under some circumstances it may happen that a filename is not unique. In this case you may give a higher priority to a filename by pressing the "prefer" button. Press Ctl-F to open a dialog to set a filename filter (not a regular expression). Sort file entries by clicking on a column header.
Alt-Ctl-G Opens a dialog where a gdb console command may be entered. Of special interest is "set <varname>=<value>" (to modify variable values).
Note: Not all gdb console commands are compatible with gdb-mi.
Alt-Ctl-H Opens the "Thread List" dialog. This modal dialog displays the list of thread ids. Activate a line to get the call stack (callstack window opens). Note: This requires that thread debugging is enabled by linking the application (directly or indirectly) with -lpthread.
Alt-Ctl-M Opens the "Memory" dialog, displaying a memory range in hexadecimal and ASCII format. Changed values get sent to gdb immediately.
Press 'M' to examine the memory at the address extracted from the register value in current line.
Press Enter or double-click on a line to copy it to the clipboard.
Alt-Ctl-S Opens the "Signals" dialog, where you can configure signal handling or generate a signal.
Alt-Ctl-U Displays addresses and names of loaded shared libraries.
Alt-Ctl-W Opens a dialog to display variable values. Local variables are displayed in the lower part (there is a vertical splitter).
Press Cursor-Right to expand compound expressions, Cursor-Left to collapse expressions (or click on the left column), or press Space for both.
Press Enter to modify values.
Press 'x' for hexadecimal, 'd' for decimal, 'b' for binray, 'o' for octal and 'n' for natural format.
Press the erase key to remove an expression.
Ctl-Space activates variable name completion. F4 displays the variable name history (pesistent across sessions).
Alt-A Switches to (mixed mode) assembly level debugging and back.
Alt-R Opens the processor "Registers" dialog. Pressing 'M' or 'X' opens the "Memory" dialog with address from current line.

Navigation and shortcuts

ccdebug strives to be smart and make life easy.
F12 Opens the file pick list containing the pathnames of recently opened files. Move the cursor up or down in the list and press enter to open the file again.
You may also do this in the "other" source code window (Alt-O).
Ctl-Space When you press Ctl-Space while entering an expression in the "Evaluate" dialog (Alt-Ctl-E) you will get a list of matching strings from the current file. Select the desired variable name or press Esc. This also works in the "Memory" and "Variables" dialog.
Context sensitivity Move the mouse above a variable (in the currently active stack frame), and ccdebug displays the value gdb returns for the variable.
Assume there is an expression "machine.state" for a struct "machine". If the cursor is above the "state" element then machine.state will be evaluated. If the cursor is above "machine" then the complete struct will be evaluated.
This also works in case of pointers and expressions like "this->state". However, often it is not the pointer value of this that is of interest, but the value of *this. To get *this move the cursor above the minus sign in "this->state".
You may also select an expression with the mouse and then move the mouse above the selection to let gdb evaluate the expression.
For example, selecting "22*7" in "int i1 = i0 + 22*7" you should get 154.
Alt-O Switches to the "other" edit window and back. You may open another file in the "other" window and make notes or look up something there and then switch back to the debug window.

Home     > The Source Code Window