Contents
Introduction
Debugging is formally a part of the software testing process and mandatory if
a program
- the noticeable error is caused by an error previous in code,
- the amount of data to scan for the error is too large to inspect effectively,
- you work on a parallel program with many threads or tasks to be checked.
Therefore the best way to debug is to let the computer do it, in case of memory problems, or to use an interactive debugger, a program that allows you to control the behaviour of a running program at arbitrary points thereby monitoring variables and their values.
In this tutorial the usage of valgrind for easy to use memory debugging, of gdb, which is the open source debugger of the GNU project, and the commercial TotalView debugger, which is licensed on Elwetritsch, will be explained and demonstrated. We will use a number of simple programs which may be downloaded for own practice.
For impatient readers here a list of related websites:
- gdb commands
- valgrind quick start guide
- Totalview site at RogueWave Software.