Learn how to use some of the lesser-known features of gdb to inspect and fix your code:
The GNU Debugger (gdb) is an invaluable tool for inspecting running processes and fixing problems while you're developing programs.
You can set breakpoints at specific locations (by function name, line number, and so on), enable and disable those breakpoints, display and alter variable values, and do all the standard things you would expect any debugger to do. But it has many other features you might not have experimented with. Here are five for you to try.