Video demonstration of how to use valgrind to debug memory issues in a program.
valgrind
This video demonstrates using gdb to debug a real (buggy!) program:
gdb