Intel® Trace Analyzer and Collector User and Reference Guide

ID 767272
Date 10/31/2024
Public
Document Table of Contents

GNU* Symbolic Debugger

To automate the procedure of setting breakpoints, GNU* Symbolic Debugger (GDB) supports executing commands automatically. To apply setting this breakpoint for all programs in the current working directory, you can create a file .gdbinit with the following lines (or add them if it already exists):

set breakpoint pending on
break MessageCheckingBreakpoint

Due to the order in which files are processed, placing the same commands in a .gdbinit file in the home directory does not work because the main binary is not loaded yet. As a workaround, you can put the following commands into ~/.gdbinit:

define hook-run
# important, output is expected by MPI startup helper
echo Starting program...
# allow pending breakpoint
set breakpoint pending on
# set breakpoint now or as soon as function becomes available
break MessageCheckingBreakpoint
# restore default behavior
set breakpoint pending auto
end

Then start your MPI application as follows:

$ mpirun -check_mpi -gdb -n <numprocs> <app>