de·bug
/dēˈbəɡ/
verb identify and remove errors from (a computer program). [(http://dictionary.reference.com/browse/debug?s=t)]
GDB, the GNU Project debugger, allows you to see what is going on `inside' another program while it executes – or what another program was doing at the moment it crashed.[(http://www.gnu.org/software/gdb/)]
GDB can do four main kinds of things (plus other things in support of these) to help you catch bugs in the act:
Debugging is something that can't be avoided. Every programmer will at one point in their programming career have to debug a section of code. There are many ways to go about debugging, from printing out messages to the screen, using a debugger, or just thinking about what the program is doing and making an educated guess as to what the problem is.
Before a bug can be fixed, the source of the bug must be located. For example, with segmentation faults, it is useful to know on which line of code the seg fault is occuring. Once the line of code in question has been found, it is useful to know about the values in that method, who called the method, and why (specifically) the error is occuring. Using a debugger makes finding all of this information very simple.[(http://www.cs.cmu.edu/~gilpin/tutorial/)]
~~REFNOTES~~