There are several ways to debug an existing program:
This program lets you modify your sourcecode so that an information is printed everytime the program enters a function. This is good if you do not know in which function your problem occurs.