From e1583700e520b0414cdffebf20003fdb0239d9d9 Mon Sep 17 00:00:00 2001 From: Pablo Escobar Date: Wed, 14 Jun 2023 15:42:04 +0200 Subject: [PATCH] debuggers: add MSVC natvis files. --- doc/debuggers.dox | 15 +++++ src/debuggers/CMakeLists.txt | 4 ++ src/debuggers/natvis/magnum.natvis | 104 +++++++++++++++++++++++++++++ 3 files changed, 123 insertions(+) create mode 100644 src/debuggers/natvis/magnum.natvis diff --git a/doc/debuggers.dox b/doc/debuggers.dox index d629cc72b..4295ff748 100644 --- a/doc/debuggers.dox +++ b/doc/debuggers.dox @@ -4,6 +4,7 @@ Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Vladimír Vondruš Copyright © 2022 Guillaume Jacquemin + Copyright © 2023 Pablo Escobar Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), @@ -65,5 +66,19 @@ and [CLion docs](https://www.jetbrains.com/help/clion/configuring-debugger-optio for more information. See also @ref corrade-debuggers-gdb-pretty-printers "Corrade GDB pretty printers". + +@section magnum-debuggers-natvis MSVC Natvis files + +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. + +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. + +For more information consult the corresponding [Natvis docs](https://learn.microsoft.com/en-us/visualstudio/debugger/create-custom-views-of-native-objects?view=vs-2022). + +See also @ref corrade-debuggers-natvis "Corrade MSVC Natvis files". */ } diff --git a/src/debuggers/CMakeLists.txt b/src/debuggers/CMakeLists.txt index 69995f83f..0c467bbce 100644 --- a/src/debuggers/CMakeLists.txt +++ b/src/debuggers/CMakeLists.txt @@ -28,3 +28,7 @@ if(NOT CORRADE_TARGET_MSVC AND NOT CORRADE_TARGET_EMSCRIPTEN) install(DIRECTORY gdb DESTINATION ${MAGNUM_DATA_INSTALL_DIR}/debuggers) endif() + +if(CORRADE_TARGET_MSVC) + install(DIRECTORY natvis DESTINATION ${MAGNUM_DATA_INSTALL_DIR}/debuggers) +endif() diff --git a/src/debuggers/natvis/magnum.natvis b/src/debuggers/natvis/magnum.natvis new file mode 100644 index 000000000..64318e412 --- /dev/null +++ b/src/debuggers/natvis/magnum.natvis @@ -0,0 +1,104 @@ + + + + + + + + [{_min,g}, {_max,g}] + {{ min={_min,g} max={_max,g} }} + + + + {{ {_data[0],g}, {_data[1],g} }} + {{ x={_data[0],g} y={_data[1],g} }} + + + + {{ {_data[0],g}, {_data[1],g}, {_data[2],g} }} + {{ x={_data[0],g} y={_data[1],g} z={_data[2],g} }} + + + + {{ {_data[0],g}, {_data[1],g}, {_data[2],g}, {_data[3],g} }} + {{ x={_data[0],g} y={_data[1],g} z={_data[2],g} w={_data[3],g} }} + + + + + + + {{ {at(0)}, {at(1)} }} + + + + + + + {{ {at(0)}, {at(1)}, {at(2)} }} + + + + + + + {{ {at(0)}, {at(1)}, {at(2)}, {at(3)} }} + + + + {{ {_data[0],g}, {_data[1],g}, {_data[2],g} }} + {{ r={_data[0],g} g={_data[1],g} b={_data[2],g} }} + + + + {{ {_data[0],g}, {_data[1],g}, {_data[2],g}, {_data[3],g} }} + {{ r={_data[0],g} g={_data[1],g} b={_data[2],g} a={_data[3],g} }} + + + + {{ {hue._value,g}, {saturation,g}, {value,g} }} + {{ h={hue._value,g} s={saturation,g} v={value,g} }} + + + + {{ {_vector._data[0],g}, {_vector._data[1],g}, {_vector._data[2],g}, {_scalar,g} }} + {{ x={_vector._data[0],g} y={_vector._data[1],g} z={_vector._data[2],g} w={_scalar,g} }} + + + + {($T3 *)_data,[$T1*$T2]nag} + + + Forward + 2 + $i == 0 ? $T1 : $T2 + ($T3 *)_data + + + +