Skip to content

GDB (GNU Debugger)#

Documentation: GDB

GDB is GNU's debugging tool.

Getting started#

GDB is available on NREL machines and supports a number of languages, including C, C++, and Fortran.

To use GDB, first load it into your environment:

module load gdb

Second, make sure the program you are attempting to debug has been compiled with the -g debug flag and with the -O0 optimization flag to achieve the best results with gdb.

For links to in-depth tutorials and walkthroughs of GDB features, please see Resources.

Availability#

Kestrel Swift Vermillion

Resources#

Gentle introduction to GDB: here

Sample GDB session: here

"Print statement"-style debugging with GDB: here