Configuration for debugging deal.II projects via GDB

deal.II comes with a simple set of pretty-printers
that provide descriptions to GDB (the GNU debugger) on how to usefully
print deal.II objects. For example, without
pretty-printing, GDB prints points as

Setting up GDB for just deal.II

If you only plan on using GDB with deal.II then it
suffices to rename the provided GDB pretty-printing file and place it in your
home directory. This can be done with the following shell commands
(where dealii_source_directory is the root directory containing
all deal.II source files):

Setting up GDB for deal.II and other sets of printers

Configuring GDB to use multiple sets of pretty-printers (i.e., sets of
pretty-printers from deal.II as well as other projects)
takes a little more work. The recommended procedure is

Decide on a directory where you will place all of your pretty-printing
files. A good choice would be creating a new
folder .gdbscripts in your home directory, and this is the
choice assumed for the rest of this demonstration.

Move the Python source code parts (so everything after, and not
including, the line containing just the word python near the
beginning up to (and also not including) the line containing just the
word end) of the
file contrib/utilities/dotgdbinit.py into the directory from
the first step. Rename this file to deal.py so that we can
import it into the master GDB file in the next step.

Add the following to your .gdbinit file, which also
resides in your home directory: