cgdb is a lightweight curses (terminal-based) interface to the GNU Debugger (GDB). In addition to the standard gdb console, cgdb provides a split screen view that displays the source code as it executes. The keyboard interface is modeled after vim, so vim users should feel at home using cgdb.
To use vertical window split orientation mode in cgdb, I need cgdb version higher than 0.7, so I decided to install cgdb from source.
# latest sources should be newer than version 0.7.1 git clone https://github.com/cgdb/cgdb.git cd cgdb mkdir build ./autogen.sh cd build ../configure make -j8 sudo make install
define skipstdcxxheaders python def skipAllIn(root): import os for root, dirs, files in os.walk(root, topdown=False): for name in files: path = os.path.join(root, name) gdb.execute('skip file %s' % path, to_string=True) # do this for C++ only if'c++'in gdb.execute('show language', to_string=True): skipAllIn('/usr/include/c++') end end
define hookpost-run skipstdcxxheaders end define hookpost-start skipstdcxxheaders end define hookpost-attach skipstdcxxheaders end
To verify whether the configuration works, check with info skip in cgdb.
# problem $ ./autogen.sh ... E: Unable to locate package aclocal # solution $ sudo apt-get install automake
# problem $ ./autogen.sh ... configure: error: CGDB requires curses.h or ncurses/curses.h to build. # solution $ sudo apt-get install libncurses5-dev
# problem $ ./autogen.sh ... configure: error: Please install flex before installing # solution $ sudo apt-get install flex
# problem $ ./autogen.sh ... configure: error: Please install makeinfo before installing # solution $ sudo apt-get install texinfo
# problem $ ./autogen.sh ... checking version of installed readline library... configure: WARNING: Could not test version of installed readline library. configure: error: CGDB requires GNU readline 5.1 or greater to link. If you used --with-readline instead of using the system readline library, make sure to set the correct readline library on the linker search path via LD_LIBRARY_PATH or some other facility. # solution $ sudo apt-get install libreadline-dev