Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions Modules/Core/Common/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -278,3 +278,43 @@ if(ITK_USE_TBB)
# Define TBB_USE_CAPTURED_EXCEPTION=0 to request rethrow of the exact exception.
target_compile_definitions(ITKCommon PUBLIC TBB_USE_CAPTURED_EXCEPTION=0)
endif()

if(MSVC)
set(ITK_NATVIS_FILE "${ITK_SOURCE_DIR}/Utilities/Debugger/ITK.natvis")
if(CMAKE_GENERATOR MATCHES "Ninja")
# Ninja/Makefiles Generator support (embeds directly inside the executable's PDB)
target_link_options(
ITKCommon
INTERFACE
"$<BUILD_INTERFACE:/NATVIS:${ITK_NATVIS_FILE}>"
"$<INSTALL_INTERFACE:/NATVIS:$<INSTALL_PREFIX>/${ITK_INSTALL_DATA_DIR}/Debugger/ITK.natvis>"
)
# Force Ninja to re-link if the .natvis file changes
set_property(
TARGET
ITKCommon
APPEND
PROPERTY
LINK_DEPENDS
"${ITK_NATVIS_FILE}"
)
else()
# Visual Studio Generator support (shows up in the Solution Explorer)
target_sources(
ITKCommon
INTERFACE
"$<BUILD_INTERFACE:${ITK_NATVIS_FILE}>"
"$<BUILD_INTERFACE:${ITK_SOURCE_DIR}/Utilities/Debugger/ITK.natstepfilter>"
"$<INSTALL_INTERFACE:${ITK_INSTALL_DATA_DIR}/Debugger/ITK.natvis>"
"$<INSTALL_INTERFACE:${ITK_INSTALL_DATA_DIR}/Debugger/ITK.natstepfilter>"
)
endif()

install(
FILES
"${ITK_NATVIS_FILE}"
"${ITK_SOURCE_DIR}/Utilities/Debugger/ITK.natstepfilter"
DESTINATION ${ITK_INSTALL_DATA_DIR}/Debugger
COMPONENT Development
)
endif()
9 changes: 9 additions & 0 deletions Utilities/Debugger/ITK.natstepfilter
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Documentation: https://learn.microsoft.com/en-us/visualstudio/debugger/just-my-code?view=visualstudio -->
<StepFilter xmlns="http://schemas.microsoft.com/vstudio/debugger/natstepfilter/2010">
<Function><Name>itk::SmartPointer.*</Name><Action>NoStepInto</Action></Function>
<Function><Name>itk::Object::Register</Name><Action>NoStepInto</Action></Function>
<Function><Name>vtkSmartPointer.*</Name><Action>NoStepInto</Action></Function>
<!-- We can also disable stepping into STL functions by uncommeting the next line: -->
<!-- <Function><Name>std::.+</Name><Action>NoStepInto</Action></Function> -->
</StepFilter>
158 changes: 147 additions & 11 deletions Utilities/Debugger/ITK.natvis
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Documentation: https://msdn.microsoft.com/en-us/library/jj620914.aspx?f=255&MSPPError=-2147217396 -->
<!-- e.g. copy into C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Packages\Debugger\Visualizers\ITK.natvis -->
<!-- Documentation: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2015/debugger/create-custom-views-of-native-objects?view=vs-2015 -->
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">

<Type Name="itk::Size&lt;1&gt;">
Expand Down Expand Up @@ -87,41 +86,178 @@
</Expand>
</Type>

<Type Name="itk::FixedArray&lt;double,1&gt;" Inheritable="true">
<AlternativeType Name="itk::FixedArray&lt;float,1&gt;" Inheritable="true"/>
<Type Name="itk::FixedArray&lt;*,1&gt;" Inheritable="true">
<DisplayString>[{m_InternalArray[0],g}]</DisplayString>
<Expand>
<Item Name="i">m_InternalArray[0]</Item>
</Expand>
</Type>
<Type Name="itk::FixedArray&lt;double,2&gt;" Inheritable="true">
<AlternativeType Name="itk::FixedArray&lt;float,2&gt;" Inheritable="true"/>
<Type Name="itk::FixedArray&lt;*,2&gt;" Inheritable="true">
<DisplayString>[{m_InternalArray[0],g}, {m_InternalArray[1],g}]</DisplayString>
<Expand>
<Item Name="i">m_InternalArray[0]</Item>
<Item Name="j">m_InternalArray[1]</Item>
</Expand>
</Type>
<Type Name="itk::FixedArray&lt;double,3&gt;" Inheritable="true">
<AlternativeType Name="itk::FixedArray&lt;float,3&gt;" Inheritable="true"/>
<Type Name="itk::FixedArray&lt;*,3&gt;" Inheritable="true">
<DisplayString>[{m_InternalArray[0],g}, {m_InternalArray[1],g}, {m_InternalArray[2],g}]</DisplayString>
<Expand>
<Item Name="i">m_InternalArray[0]</Item>
<Item Name="j">m_InternalArray[1]</Item>
<Item Name="k">m_InternalArray[2]</Item>
</Expand>
</Type>
<Type Name="itk::FixedArray&lt;double,*&gt;" Inheritable="true">
<AlternativeType Name="itk::FixedArray&lt;float,*&gt;" Inheritable="true"/>
<Type Name="itk::FixedArray&lt;*,*&gt;" Inheritable="true">
<DisplayString>{m_InternalArray}</DisplayString>
<Expand>
<ArrayItems>
<Size>$T1</Size>
<Size>$T2</Size>
<ValuePointer>m_InternalArray</ValuePointer>
</ArrayItems>
</Expand>
</Type>

<!-- Point, Vector and CovariantVector are all subclasses of FixedArray and inherit
its visualizers automatically; these entries only override the display name. -->
<Type Name="itk::Point&lt;*,1&gt;" Inheritable="true">
<DisplayString>Point[{m_InternalArray[0],g}]</DisplayString>
<Expand>
<Item Name="x">m_InternalArray[0]</Item>
</Expand>
</Type>
<Type Name="itk::Point&lt;*,2&gt;" Inheritable="true">
<DisplayString>Point[{m_InternalArray[0],g}, {m_InternalArray[1],g}]</DisplayString>
<Expand>
<Item Name="x">m_InternalArray[0]</Item>
<Item Name="y">m_InternalArray[1]</Item>
</Expand>
</Type>
<Type Name="itk::Point&lt;*,3&gt;" Inheritable="true">
<DisplayString>Point[{m_InternalArray[0],g}, {m_InternalArray[1],g}, {m_InternalArray[2],g}]</DisplayString>
<Expand>
<Item Name="x">m_InternalArray[0]</Item>
<Item Name="y">m_InternalArray[1]</Item>
<Item Name="z">m_InternalArray[2]</Item>
</Expand>
</Type>
<Type Name="itk::Point&lt;*,*&gt;" Inheritable="true">
<DisplayString>Point{m_InternalArray}</DisplayString>
<Expand>
<ArrayItems>
<Size>$T2</Size>
<ValuePointer>m_InternalArray</ValuePointer>
</ArrayItems>
</Expand>
</Type>

<Type Name="itk::Vector&lt;*,*&gt;" Inheritable="true">
<DisplayString>Vector{m_InternalArray}</DisplayString>
<Expand>
<ArrayItems>
<Size>$T2</Size>
<ValuePointer>m_InternalArray</ValuePointer>
</ArrayItems>
</Expand>
</Type>

<Type Name="itk::CovariantVector&lt;*,*&gt;" Inheritable="true">
<DisplayString>CovariantVector{m_InternalArray}</DisplayString>
<Expand>
<ArrayItems>
<Size>$T2</Size>
<ValuePointer>m_InternalArray</ValuePointer>
</ArrayItems>
</Expand>
</Type>

<Type Name="itk::ContinuousIndex&lt;*,1&gt;" Inheritable="true">
<DisplayString>ContinuousIndex[{m_InternalArray[0]}]</DisplayString>
<Expand>
<Item Name="i">m_InternalArray[0]</Item>
</Expand>
</Type>
<Type Name="itk::ContinuousIndex&lt;*,2&gt;" Inheritable="true">
<DisplayString>ContinuousIndex[{m_InternalArray[0]}, {m_InternalArray[1]}]</DisplayString>
<Expand>
<Item Name="i">m_InternalArray[0]</Item>
<Item Name="j">m_InternalArray[1]</Item>
</Expand>
</Type>
<Type Name="itk::ContinuousIndex&lt;*,3&gt;" Inheritable="true">
<DisplayString>ContinuousIndex[{m_InternalArray[0]}, {m_InternalArray[1]}, {m_InternalArray[2]}]</DisplayString>
<Expand>
<Item Name="i">m_InternalArray[0]</Item>
<Item Name="j">m_InternalArray[1]</Item>
<Item Name="k">m_InternalArray[2]</Item>
</Expand>
</Type>
<Type Name="itk::ContinuousIndex&lt;*,*&gt;" Inheritable="true">
<DisplayString>ContinuousIndex{m_InternalArray}</DisplayString>
<Expand>
<ArrayItems>
<Size>$T2</Size>
<ValuePointer>m_InternalArray</ValuePointer>
</ArrayItems>
</Expand>
</Type>

<Type Name="itk::RGBPixel&lt;*&gt;" Inheritable="true">
<DisplayString>RGB({m_InternalArray[0]}, {m_InternalArray[1]}, {m_InternalArray[2]})</DisplayString>
<Expand>
<Item Name="Red">m_InternalArray[0]</Item>
<Item Name="Green">m_InternalArray[1]</Item>
<Item Name="Blue">m_InternalArray[2]</Item>
</Expand>
</Type>

<Type Name="itk::RGBAPixel&lt;*&gt;" Inheritable="true">
<DisplayString>RGBA({m_InternalArray[0]}, {m_InternalArray[1]}, {m_InternalArray[2]}, {m_InternalArray[3]})</DisplayString>
<Expand>
<Item Name="Red">m_InternalArray[0]</Item>
<Item Name="Green">m_InternalArray[1]</Item>
<Item Name="Blue">m_InternalArray[2]</Item>
<Item Name="Alpha">m_InternalArray[3]</Item>
</Expand>
</Type>

<Type Name="itk::VariableLengthVector&lt;*&gt;">
<DisplayString Condition="m_Data == 0">empty</DisplayString>
<DisplayString>{m_Data,[m_NumElements]}</DisplayString>
<Expand>
<Item Name="Size">m_NumElements</Item>
<Item Name="ManagesMemory">m_LetArrayManageMemory</Item>
<ArrayItems>
<Size>m_NumElements</Size>
<ValuePointer>m_Data</ValuePointer>
</ArrayItems>
</Expand>
</Type>

<Type Name="itk::Array&lt;*&gt;">
<DisplayString Condition="data == 0">empty</DisplayString>
<DisplayString>{data,[num_elmts]}</DisplayString>
<Expand>
<Item Name="Size">num_elmts</Item>
<ArrayItems>
<Size>num_elmts</Size>
<ValuePointer>data</ValuePointer>
</ArrayItems>
</Expand>
</Type>

<Type Name="itk::Matrix&lt;*,*,*&gt;">
<DisplayString>Matrix {$T2}x{$T3}</DisplayString>
<Expand>
<ArrayItems>
<Direction>Forward</Direction>
<Rank>2</Rank>
<Size>$T2</Size>
<Size>$T3</Size>
<ValuePointer>m_Matrix.data_[0]</ValuePointer>
</ArrayItems>
</Expand>
</Type>

<Type Name="itk::ImageRegion&lt;1&gt;">
<DisplayString>({m_Index}->[{m_Index.m_InternalArray[0] + long long(m_Size.m_InternalArray[0])}])</DisplayString>
<Expand>
Expand Down
31 changes: 0 additions & 31 deletions Utilities/Debugger/default.natstepfilter

This file was deleted.

Loading