- Infos im HLRS Wiki sind nicht rechtsverbindlich und ohne Gewähr -
- Information contained in the HLRS Wiki is not legally binding and HLRS is not responsible for any damages that might result from its use -
GDB: Difference between revisions
(Created page with "{{Infobox software | description = '''GDB''' is the debugger of the GNU Project | developer = GNU | available on = (all systems) | category...") |
(Add description how to obtain MPI program crash backtraces) |
||
Line 16: | Line 16: | ||
Do not forget to compile your application with debugging info (<tt>-g</tt> option). | Do not forget to compile your application with debugging info (<tt>-g</tt> option). | ||
}} | }} | ||
=== Obtaining coredumps of crashing programs === | === Obtaining coredumps of crashing programs === | ||
Line 27: | Line 28: | ||
(gdb) generate-core-file [file] | (gdb) generate-core-file [file] | ||
}} | }} | ||
=== Obtaining a backtrace of a crashing MPI program === | |||
To get a backtrace of a crashing program start it via gdb as follows: | |||
{{Command|command=mpirun -n 2 gdb -batch -ex "run" -ex "bt" <program>}} | |||
== See also == | == See also == |
Revision as of 10:28, 1 April 2022
GDB is the debugger of the GNU Project |
|
The GNU debugger (GDB) can be used to inspect problems in programs. It allows to trace and alter the execution of running programs as well as to create and inspect coredumps.
Usage
The gdb debugger is available on HLRS systems without the need to load a module.
Obtaining coredumps of crashing programs
GDB can be used to obtain a coredump of a program crash. To do so start gdb with the program and its arguments
Then start program execution and run until it crashes. When the program crashed save a corefile of the crashed process via the generate-core-file command - optionally providing an output file name:
(gdb) generate-core-file [file]
Obtaining a backtrace of a crashing MPI program
To get a backtrace of a crashing program start it via gdb as follows: