Vim + cgdb

I begin to use vim for programming. I like the tools that focus on one function. I used to use emacs. But I think I like vim more.

For debugging, I use gdb. But I use the front end cgdb. I can see the codes with the cursor when debugging. I can use F8 for next instead of n + enter. And F10 for step instead of s + enter. i is the key for enter gdb command mode. And ESC can change the user to command mode. But ESC is too far away from my finger, so I prefer “Ctrl + [” to ESC ;)

My configuration files can be found here if they are useful for someone:
https://github.com/zma/config_files

In the config file of cgdb:
“set winsplit=top_big: is for letting the code window bigger than the gdb command windows, which is convenient for debugging.

A list of useful cgdb shortcuts:

`F5'
     Send a run command to GDB.
`F6'
     Send a continue command to GDB.
`F7'
     Send a finish command to GDB.
`F8'
     Send a next command to GDB.
`F10'
     Send a step command to GDB.
`spacebar'
     Sets a breakpoint at the current line number.
`t'
     Sets a temporary breakpoint at the current line number.
`i'
     Puts the user into "GDB mode".
`I'
     Puts the user into "TTY mode".

These short cuts is available in cgdb 0.6.5.

Updated on Apr. 2 2010. Short cuts are added.

Eric Ma

Eric is a systems guy. Eric is interested in building high-performance and scalable distributed systems and related technologies. The views or opinions expressed here are solely Eric's own and do not necessarily represent those of any third parties.

Leave a Reply

Your email address will not be published. Required fields are marked *