You've written the program and it doesn't work.
Check out the list of common programming errors
print
statements to follow program executation and to examine
variables.
This is the easiest and most popular tool for debugging. However, it does
require recompiling every time you want to change something. Additionally,
printing inside a loop can generate many screens of output.
dbx
.
However, the commands and usage vary from vendor to vendor.
Also, many vendors have a graphical debugging and performance system.
The GNU debugger is called gdb
Debuggers are especially useful for tracing segmentation faults and bus errors. They will pinpoint exactly where the program has stopped.
One can run the program under the debugger, or use the debugger to examine a core file after a program has crashed.