Tuesday, May 20, 2008

GDB hidden gem

Well at least it was hidden to me :D

Sometimes it's difficult to keep in view the surrounding lines of code when you are using GDB. list command helps but it's not that user friendly. So the other day a coworker told me about GDB TUI. You can enable it with Ctrl+X A and voilà you get the full listing of the code in a nice browseable view on the top :-)

And a screenie for your viewing pleasure:

4 comments:

Nicolas said...

Oh my gawd

<3

Fred said...

Or launch it by "gdb -tui"

Craig Howard said...

I much prefer cgdb. It gives you syntax highlighting and vim keybindings while navigating the source. Just be sure to add:

set autosourcereload

to ~/.cgdb/cgdbrc

Isaac Clerencia said...

Hi there Albert

I accidentally discovered this a few weeks ago while debugging a program :P