Skip to content

GDB (GNU Debugger)#

Documentation: GDB

GDB is GNU's command line interface debugging tool.

Getting started#

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

When using GDB, 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.

Run GDB with the following command: gdb --args my_executable arg1 arg 2 arg3 This will launch gdb running my_executable, and passes arguments arg1, arg2, and arg3 to my_executable.

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

Availability#

Kestrel Eagle Swift Vermilion
gdb/12.1 gdb/7.6.1* gdb/8.2* gdb/12.1, gdb/8.2*

* Located in /usr/bin. Do not need to use module load.

Resources#