Notes
- Compile using gdb with -g, or using -g3 -gdwarf-2 if you want to include things like preprocessor macros. Probably also use -O0 to turn optimizations off.
- help
- r (run)
- list [line|function]
- b (break) [file:](line|function)
- n (next)
- p (print)
- disp (display)
- c (continue)
- q (quit)
The code used in all of these videos: http://stanford.edu/~samking/cs1u/segfault.c