The following links provide simple examples to show you how to use gdb. Using GDB to Walkthrough Code Using GDB to Debug a Problem