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_INSTALL_PREFIX}/share/gdb/python 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:

python
# If not installing into /usr, you'll need to insert the install location (or
# the src/debuggers/gdb/ directory inside Magnum sources) to Python's path:
#import sys
#sys.path.insert(0, '/magnum/install/prefix/share/gdb/python')
from magnum import register_magnum_printers
register_magnum_printers(gdb.current_objfile())
end

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.

MSVC Natvis files

The src/debuggers/natvis directory contains MSVC natvis files for important Math classes. Contents of this directory are also copied into ${CMAKE_INSTALL_PREFIX}/share/magnum/debuggers/natvis during installation.

Easiest way to use is to copy them to the user-specific Natvis directory for given version of Visual Studio, such as %USERPROFILE%/Documents/Visual Studio 2022/Visualizers.

For more information consult the corresponding Natvis docs.

See also Corrade MSVC Natvis files.