You are likely to be debugging your program for one of the following reasons:
To determine where and why it is crashing. Strategies for locating the cause of a crash include:
Running the program in dbx. dbx reports the location of the crash when it occurs.
Examining the core file and looking at a stack trace. See Examining a Core File and Looking at the Call Stack.
To determine why your program is returning incorrect results. Strategies include:
Setting breakpoints to stop execution so that you can check your program’s state and look at the values of variables. See Setting Breakpoints and Examining Variables.
Stepping through your code one source line at a time to monitor how the program state changes. See Stepping Through Your Program.
To find a memory leak or memory management problem. Runtime checking lets you detect runtime errors such as memory access errors and memory leak errors and enables you to monitor memory usage. See Finding Memory Access Problems and Memory Leaks.