Using a Debugger
The most common time to invoke a debugger is after a run-time error.
If this produces a core file, start gdb ...
- it typically shows you the line of code causing the crash
- use
where to find out who called the current function
- pay attention to parameter values in the stack
- use
list to see the current function code
- display values of local variables
Note, however, that the program may crash well after the bug ...
|