Debugger support new in Git master

Pretty-printers for Magnum types and other debugging aids.

GDB pretty printers

The src/debuggers/gdb directory contains GDB pretty printers for important types in the Magnum and Animation namespace and most Math classes. Contents of this directory are also copied into ${CMAKE_PREFIX_PATH}/share/magnum/debuggers/gdb during installation, where the prefix is usually /usr or /usr/local.

Easiest is to auto-load them on startup, by putting the following snippet into the user-specific ~/.gdbinit or ~/.config/gdb/gdbinit file:

import sys
# Adapt this path to the actual install location (or Magnum's src/ directory).
# Not pointing to the debuggers subdirectory here because it could conflict
# with the built-in GDB module.
sys.path.insert(0, '/usr/share')
from magnum.debuggers.gdb import register_magnum_printers

In case of MSYS2/MinGW, when running outside of the MSYS2 shell, you may need to put the file into %USERPROFILE%/.config/gdb/gdbinit instead of $HOME/.gdbinit.

Alternatively, it's possible to load the scripts manually using GDB commands (basically, pasting contents the above snippet) or by executing a GDB script file using the source command. See also corresponding GDB docs and CLion docs for more information.

See also Corrade GDB pretty printers.