Download and compile gromacs 5.x

cd gromacs; mkdir build ; cd build 
cmake .. -DCMAKE_BUILD_TYPE=Debug

Then, go to the methanol example

cd share/gromacs/tutor/methanol/

Then enter gdb console and issue some commands

$ gdb
# that's where the gmx command lives
exec ../../build/bin/gmx
# read in the symbol table
file ../../build/bin/gmx 

# break on errors
break _gmx_error

# break on do_force function
break do_force
run mdrun -debug 1 -v -s

This is not very practical - you can put the gdb commands into a file, gdb_cmds, and execute

$ gdb -x gdb_cmds

Note gdb has a ton of useful commands, google around


- add pretty command to gdb

- gdb tutorial handout