Browse Source

debuggers/gdb: use a more standard install location.

Same as 4922edf269,
just mirrored here.
pull/168/head
Vladimír Vondruš 3 years ago
parent
commit
1ad0927959
  1. 5
      doc/changelog.dox
  2. 20
      doc/debuggers.dox
  3. 2
      src/debuggers/CMakeLists.txt
  4. 0
      src/debuggers/gdb/magnum/__init__.py
  5. 0
      src/debuggers/gdb/magnum/printers.py

5
doc/changelog.dox

@ -79,8 +79,9 @@ See also:
- Added MSVC Natvis files and pretty-printers for GDB. See @ref debuggers,
[mosra/magnum#589](https://github.com/mosra/magnum/pull/589),
[mosra/magnum#595](https://github.com/mosra/magnum/pull/595),
[mosra/magnum#620](https://github.com/mosra/magnum/pull/620) and
[mosra/magnum#623](https://github.com/mosra/magnum/pull/623) for more
[mosra/magnum#620](https://github.com/mosra/magnum/pull/620),
[mosra/magnum#623](https://github.com/mosra/magnum/pull/623) and
[mosra/corrade#179](https://github.com/mosra/corrade/issues/179) for more
information.
@subsubsection changelog-latest-new-debugtools DebugTools library

20
doc/debuggers.dox

@ -36,20 +36,19 @@ The [src/debuggers/gdb](https://github.com/mosra/magnum/tree/master/src/debugger
directory contains [GDB pretty printers](https://sourceware.org/gdb/onlinedocs/gdb/Pretty-Printing.html)
for important types in the @ref Magnum and @ref Animation namespace and most
@ref Math classes. Contents of this directory are also copied into
@cb{.sh} ${CMAKE_PREFIX_PATH}/share/magnum/debuggers/gdb @ce during
installation, where the prefix is usually `/usr` or `/usr/local`.
@cb{.sh} ${CMAKE_INSTALL_PREFIX}/share/gdb/python @ce 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:
@code{.py}
python
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
# 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
@endcode
@ -71,8 +70,9 @@ See also @ref corrade-debuggers-gdb-pretty-printers "Corrade GDB pretty printers
The [src/debuggers/natvis](https://github.com/mosra/magnum/tree/master/src/debuggers/natvis)
directory contains MSVC natvis files for important @ref Math classes. Contents
of this directory are also copied into @cb{.sh} ${CMAKE_PREFIX_PATH}/share/magnum/debuggers/natvis @ce
during installation.
of this directory are also copied into
@cb{.sh} ${CMAKE_INSTALL_PREFIX}/share/magnum/debuggers/natvis @ce during
installation.
Easiest way to use is to copy them to the user-specific Natvis directory for
given version of Visual Studio, such as @cb{.bat} %USERPROFILE%/Documents/Visual Studio 2022/Visualizers @ce.

2
src/debuggers/CMakeLists.txt

@ -26,7 +26,7 @@
# TODO: same TODOs as in corrade/src/debuggers/CMakeLists.txt apply here
if(NOT CORRADE_TARGET_MSVC AND NOT CORRADE_TARGET_EMSCRIPTEN)
install(DIRECTORY gdb DESTINATION ${MAGNUM_DATA_INSTALL_DIR}/debuggers)
install(DIRECTORY gdb/magnum DESTINATION share/gdb/python)
endif()
if(CORRADE_TARGET_MSVC)

0
src/debuggers/gdb/__init__.py → src/debuggers/gdb/magnum/__init__.py

0
src/debuggers/gdb/printers.py → src/debuggers/gdb/magnum/printers.py

Loading…
Cancel
Save