The purpose of this guide is to introduce some tools and techniques that are generally applicable. By far the most popular debugging tool is the print statement. The idea is to produce a commentary of what your program is doing and deduce where the program fails from the point at which output stops and understand why it fails from the values of printed variables. Another important ally is the compiler; changing compilation options can often reveal bugs. More sophisticated (but sometimes no more effective) tools are also available such as the GNU Debugger (GDB) and proprietary tools such as TotalView (which is available on HECToR). These tools allow programmers to stop their programs at specified points, inspect variables and step through code line-by-line.