CMake: MSVC: Add natvis file for blender's native types
This currently contains some types I personally needed more types can be added if people desire them. Due to the .natvis being added to creator, Visual Studio will automatically pick up on these types and show the improved visualizers while debugging. vscode can also use this file, but you'll have to check its documentation on how to set that up. Pull Request: https://projects.blender.org/blender/blender/pulls/118576
This commit is contained in:
parent
7c0a22cdaf
commit
cfb60c98be
@ -152,6 +152,11 @@ set(SRC
|
||||
creator_intern.h
|
||||
)
|
||||
|
||||
if(CMAKE_GENERATOR MATCHES "^Visual Studio.+")
|
||||
# This helps visual studio find the debugger visualizers
|
||||
list(APPEND SRC ${CMAKE_SOURCE_DIR}/tools/utils_ide/natvis/Blender.natvis)
|
||||
endif()
|
||||
|
||||
# MSVC 2010 gives linking errors with the manifest.
|
||||
if(WIN32 AND NOT UNIX)
|
||||
add_definitions(
|
||||
|
58
tools/utils_ide/natvis/Blender.natvis
Normal file
58
tools/utils_ide/natvis/Blender.natvis
Normal file
@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
|
||||
<Type Name="blender::StringRef">
|
||||
<DisplayString>{data_,[size_]s} (size={size_})</DisplayString>
|
||||
</Type>
|
||||
<Type Name="blender::Vector<*>">
|
||||
<DisplayString>{{size={end_ - begin_}}}</DisplayString>
|
||||
<Expand>
|
||||
<Item Name="[size]" ExcludeView="simple"> end_ - begin_</Item>
|
||||
<Item Name="[capacity]" ExcludeView="simple">capacity_end_ - begin_</Item>
|
||||
<ArrayItems>
|
||||
<Size>end_ - begin_</Size>
|
||||
<ValuePointer>begin_</ValuePointer>
|
||||
</ArrayItems>
|
||||
</Expand>
|
||||
</Type>
|
||||
<Type Name="blender::Span<*>">
|
||||
<DisplayString>{{size={size_ }}}</DisplayString>
|
||||
<Expand>
|
||||
<Item Name="[size]" ExcludeView="simple"> size_</Item>
|
||||
<ArrayItems>
|
||||
<Size>size_</Size>
|
||||
<ValuePointer>data_</ValuePointer>
|
||||
</ArrayItems>
|
||||
</Expand>
|
||||
</Type>
|
||||
<Type Name="blender::VecBase<*,3>">
|
||||
<DisplayString>{{x={x}, y={y}, z={z}}}</DisplayString>
|
||||
</Type>
|
||||
<Type Name="blender::Array<*>">
|
||||
<DisplayString>{{size={size_ }}}</DisplayString>
|
||||
<Expand>
|
||||
<Item Name="[size]" ExcludeView="simple"> size_</Item>
|
||||
<ArrayItems>
|
||||
<Size>size_</Size>
|
||||
<ValuePointer>data_</ValuePointer>
|
||||
</ArrayItems>
|
||||
</Expand>
|
||||
</Type>
|
||||
<Type Name="blender::Map<*>">
|
||||
<DisplayString>Size={occupied_and_removed_slots_ - removed_slots_}</DisplayString>
|
||||
<Expand>
|
||||
<CustomListItems>
|
||||
<Variable Name="slot" InitialValue="slots_.data_"/>
|
||||
<Variable Name="i" InitialValue="0"/>
|
||||
<Loop>
|
||||
<Item Condition="slot->state_ == 1" Name="{slot->key_buffer_}">slot->value_buffer_</Item>
|
||||
<Exec>++slot</Exec>
|
||||
<Exec>++i</Exec>
|
||||
<Break Condition="i > slots_.size_"/>
|
||||
</Loop>
|
||||
</CustomListItems>
|
||||
</Expand>
|
||||
</Type>
|
||||
<Type Name="blender::TypedBuffer<*,*>">
|
||||
<DisplayString>{*($T1*)buffer_.buffer_.buffer_}</DisplayString>
|
||||
</Type>
|
||||
</AutoVisualizer>
|
Loading…
Reference in New Issue
Block a user