gdb
¶
There are many debuggers.
This page described gdb
, the GNU debugger.
gdb
is a debugger provided with the GNU compilers.
It works fine for C, C++ and Fortran.
With older versions there were problems with fortran90/95.
Debugging GCC-compiled programs¶
In order to use gdb do the following. load a recent gcc module and a gdb module (system gdb is from 2013!).
compile your program with flags for debugging added, e.g. -ggdb
run the gdb program:
Then you can use the gdb commands, like run, break, step, help, ...
Exit with Ctrl+D
.
Debugging Intel-compiled programs¶
In order to use gdb
with Intel-compiled programs, do the following"
Load the icc
module
Compile your program with flags for debugging added, e.g. -g
Run the gdb program:
Then you can use the gdb commands, like run, break, step, help, ...
Exit with Ctrl+D
.