* Fix natvis for wistd types

* Link in the natvis by default

* Satisfy Visual Studio's expected syntax
This commit is contained in:
Duncan Horn 2023-04-04 14:56:28 -07:00 коммит произвёл GitHub
Родитель 9bf782d0d2
Коммит 533e329663
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 77 добавлений и 19 удалений

Просмотреть файл

@ -8,46 +8,102 @@
PARTICULAR PURPOSE AND NONINFRINGEMENT.
-->
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
<Type Name="wistd::_Func_impl&lt;*&gt;">
<DisplayString>{_Callee._Object}</DisplayString>
<Type Name="wistd::default_delete&lt;*&gt;">
<DisplayString>default_delete</DisplayString>
<Expand />
</Type>
<Type Name="wistd::__compressed_pair_elem&lt;*,*,0&gt;">
<Intrinsic Name="get" Expression="__value_" />
<DisplayString>{get()}</DisplayString>
<Expand>
<ExpandedItem>get()</ExpandedItem>
</Expand>
</Type>
<Type Name="wistd::__compressed_pair_elem&lt;*,*,1&gt;">
<Intrinsic Name="get" Expression="*($T1*)this" />
<DisplayString>{get()}</DisplayString>
<Expand>
<ExpandedItem>get()</ExpandedItem>
</Expand>
</Type>
<Type Name="wistd::__compressed_pair&lt;*&gt;">
<Intrinsic Name="first" Expression="(static_cast&lt;_Base1*&gt;(this))->get()" />
<Intrinsic Name="second" Expression="(static_cast&lt;_Base2*&gt;(this))->get()" />
<DisplayString>({first()}, {second()})</DisplayString>
<Expand>
<Item Name="[first]">first()</Item>
<Item Name="[second]">second()</Item>
</Expand>
</Type>
<Type Name="wistd::__function::__func&lt;*&gt;">
<DisplayString>{__f_}</DisplayString>
<Expand>
</Expand>
</Type>
<Type Name="wistd::function&lt;*&gt;">
<DisplayString Condition="_Impl == 0">empty</DisplayString>
<DisplayString Condition="_Impl != 0">{*_Impl}</DisplayString>
<DisplayString Condition="__f_ == 0">empty</DisplayString>
<DisplayString Condition="__f_ != 0">{*__f_}</DisplayString>
<Expand>
<ExpandedItem Condition="_Impl != 0">*_Impl</ExpandedItem>
<ExpandedItem Condition="__f_ != 0">*__f_</ExpandedItem>
</Expand>
</Type>
<Type Name="wistd::unique_ptr&lt;*&gt;">
<DisplayString Condition="_Myptr == 0">empty</DisplayString>
<DisplayString Condition="_Myptr != 0">{*_Myptr}</DisplayString>
<StringView>_Myptr</StringView>
<SmartPointer Usage="Minimal">__ptr_.first()</SmartPointer>
<DisplayString Condition="__ptr_.first() == 0">empty</DisplayString>
<DisplayString Condition="__ptr_.first() != 0">{*__ptr_.first()}</DisplayString>
<Expand>
<Item Name="[pointer]" Condition="_Myptr != 0">_Myptr</Item>
<Item Name="[ptr]" Condition="__ptr_.first() != 0">__ptr_.first()</Item>
<Item Name="[deleter]" Condition="__ptr_.first() != 0">__ptr_.second()</Item>
</Expand>
</Type>
<Type Name="wistd::unique_ptr&lt;wchar_t[],*&gt;">
<DisplayString Condition="__ptr_.first() == 0">empty</DisplayString>
<DisplayString Condition="__ptr_.first() != 0">{__ptr_.first(),su}</DisplayString>
<StringView>__ptr_.first()</StringView>
<Expand>
<Item Name="[ptr]" Condition="__ptr_.first() != 0">__ptr_.first()</Item>
<Item Name="[length]" Condition="__ptr_.first() != 0">wcslen(__ptr_.first())</Item>
<Item Name="[deleter]" Condition="__ptr_.first() != 0">__ptr_.second()</Item>
</Expand>
</Type>
<Type Name="wistd::unique_ptr&lt;wchar_t[*],*&gt;">
<DisplayString Condition="_Myptr == 0">empty</DisplayString>
<DisplayString Condition="_Myptr != 0">{_Myptr,su}</DisplayString>
<StringView>_Myptr</StringView>
<DisplayString Condition="__ptr_.first() == 0">empty</DisplayString>
<DisplayString Condition="__ptr_.first() != 0">{__ptr_.first(),su}</DisplayString>
<StringView>__ptr_.first()</StringView>
<Expand>
<Item Name="[pointer]" Condition="_Myptr != 0">_Myptr</Item>
<Item Name="[length]" Condition="_Myptr != 0">wcslen(_Myptr)</Item>
<Item Name="[ptr]" Condition="__ptr_.first() != 0">__ptr_.first()</Item>
<Item Name="[length]" Condition="__ptr_.first() != 0">wcslen(__ptr_.first())</Item>
<Item Name="[deleter]" Condition="__ptr_.first() != 0">__ptr_.second()</Item>
</Expand>
</Type>
<Type Name="wistd::unique_ptr&lt;char[],*&gt;">
<DisplayString Condition="__ptr_.first() == 0">empty</DisplayString>
<DisplayString Condition="__ptr_.first() != 0">{__ptr_.first(),s}</DisplayString>
<StringView>__ptr_.first()</StringView>
<Expand>
<Item Name="[ptr]" Condition="__ptr_.first() != 0">__ptr_.first()</Item>
<Item Name="[length]" Condition="__ptr_.first() != 0">strlen(__ptr_.first())</Item>
<Item Name="[deleter]" Condition="__ptr_.first() != 0">__ptr_.second()</Item>
</Expand>
</Type>
<Type Name="wistd::unique_ptr&lt;char[*],*&gt;">
<DisplayString Condition="_Myptr == 0">empty</DisplayString>
<DisplayString Condition="_Myptr != 0">{_Myptr,s}</DisplayString>
<StringView>_Myptr</StringView>
<DisplayString Condition="__ptr_.first() == 0">empty</DisplayString>
<DisplayString Condition="__ptr_.first() != 0">{__ptr_.first(),s}</DisplayString>
<StringView>__ptr_.first()</StringView>
<Expand>
<Item Name="[pointer]" Condition="_Myptr != 0">_Myptr</Item>
<Item Name="[length]" Condition="_Myptr != 0">strlen(_Myptr)</Item>
<Item Name="[ptr]" Condition="__ptr_.first() != 0">__ptr_.first()</Item>
<Item Name="[length]" Condition="__ptr_.first() != 0">strlen(__ptr_.first())</Item>
<Item Name="[deleter]" Condition="__ptr_.first() != 0">__ptr_.second()</Item>
</Expand>
</Type>

Просмотреть файл

@ -62,6 +62,8 @@ set(COMMON_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/../natvis/wil.natvis
)
add_link_options(/NATVIS:${CMAKE_SOURCE_DIR}/natvis/wil.natvis)
add_subdirectory(app)
add_subdirectory(cpplatest)
add_subdirectory(noexcept)