Some gdb tips
You can look at the source code with
layout src (or ^X-A) and assembly with
i r (short for
info registers) displays current register values (eax, ebx... for x86)
Set breakpoints to all functions in
You can pass gdb commands at start with
-ex "cmd", i.e.
gdb a.out -ex "tar rem:1234; b main"