GDB niceties

Warning

This blog post is older than 4 years and its content may be out of date.

While writing my bachelor thesis, I discover some nice stuff while programming in C and debugging with GDB. Two shortcuts come in handy quite often:

  • C-x 1: display source code if available while stepping through the program
  • C-x 2: like C-x 1, but display assembler in a second window

It seems like these features need gdb to be compiled with ncurses, which it luckily is on Arch Linux.