- Compile with the -g option to CC
- start gdb /path/to/c/program/to/test
- type r command (where command is the command on which the program crashed)
- Then you can use 'where' to show the lines of source code where the code crashed
- You can set breakpoints with b, run again with r and continue after the breakpoint with c
- You can print values of variables and pointers within gdb