I was just debugging a program in gdb and somehow I found a new feature I\'ve never seen or even heard of before, a split view where I can see and browse the code in additio
Type layout
as a command in gdb and the split window will be shown.
You can also start it from the gdb shell using the command "-" (dash). Not sure how to dynamically turn it off though.
You can trigger it dynamically by push ctrl+x and ctrl+a.
It's called the TUI (no kidding). Start for example with gdbtui
or gdb -tui
...
Please also see this answer by Ciro Santilli. It wasn't available in 2012 to the best of my knowledge, but definitely worth a look.
There is also interface tool for GDB called cgdb. Even with some color highlighting. "ESC" to switch to code view, "i" to switch back to gdb
There are two variants of it.
Press CTRL
X
together and then 1
Press 'CTRL' 'X' together and then '2'
http://www.cs.fsu.edu/~baker/ada/gnat/html/gdb_23.html
A screen shot of the view with code and assembly.
Also check out this amazing Github project.