Skip to content

Commit

Permalink
.natvis: Add view for unique_ptr/vector of chars (#2843)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregg-miskelly authored Jul 8, 2022
1 parent c34f249 commit 0620026
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions stl/debugger/STL.natvis
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,24 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
</Expand>
</Type>

<Type Name="std::unique_ptr&lt;wchar_t [0],*&gt;">
<AlternativeType Name="std::unique_ptr&lt;char [0],*&gt;"/>
<AlternativeType Name="std::unique_ptr&lt;char8_t [0],*&gt;"/>
<AlternativeType Name="std::unique_ptr&lt;char16_t [0],*&gt;"/>
<AlternativeType Name="std::unique_ptr&lt;char32_t [0],*&gt;"/>
<AlternativeType Name="std::unique_ptr&lt;wchar_t const [0],*&gt;"/>
<AlternativeType Name="std::unique_ptr&lt;char const [0],*&gt;"/>
<AlternativeType Name="std::unique_ptr&lt;char8_t const [0],*&gt;"/>
<AlternativeType Name="std::unique_ptr&lt;char16_t const [0],*&gt;"/>
<AlternativeType Name="std::unique_ptr&lt;char32_t const [0],*&gt;"/>
<DisplayString Condition="_Mypair._Myval2 == nullptr">{{empty}}</DisplayString>
<DisplayString Condition="_Mypair._Myval2 != nullptr">{_Mypair._Myval2}</DisplayString>
<StringView>_Mypair._Myval2</StringView>
<Expand>
<Item Condition="_Mypair._Myval2 != nullptr" Name="[deleter]">_Mypair</Item>
<ExpandedItem Condition="_Mypair._Myval2 != nullptr">_Mypair._Myval2,hv</ExpandedItem>
</Expand>
</Type>

<Type Name="std::_Ref_count&lt;*&gt;">
<DisplayString>default</DisplayString>
Expand Down Expand Up @@ -1182,6 +1200,27 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
</Expand>
</Type>

<Type Name="std::vector&lt;wchar_t,*&gt;">
<AlternativeType Name="std::vector&lt;char,*&gt;" />
<AlternativeType Name="std::vector&lt;char8_t,*&gt;" />
<AlternativeType Name="std::vector&lt;char16_t,*&gt;" />
<AlternativeType Name="std::vector&lt;char32_t,*&gt;" />
<Intrinsic Name="data" Expression="_Mypair._Myval2._Myfirst" />
<Intrinsic Name="size" Expression="(size_t)(_Mypair._Myval2._Mylast - _Mypair._Myval2._Myfirst)" />
<Intrinsic Name="capacity" Expression="(size_t)(_Mypair._Myval2._Myend - _Mypair._Myval2._Myfirst)" />
<SmartPointer Usage="Indexable" DefaultExpansion="false">data()</SmartPointer>
<DisplayString Condition="size() > 0">{data(),na} (size = {size()})</DisplayString>
<DisplayString Condition="size() == 0">{{empty}}</DisplayString>
<Expand>
<Item Name="[capacity]" ExcludeView="simple">capacity()</Item>
<Item Name="[allocator]" ExcludeView="simple">_Mypair</Item>
<ArrayItems>
<Size>size()</Size>
<ValuePointer>data()</ValuePointer>
</ArrayItems>
</Expand>
</Type>

<Type Name="std::_Vector_iterator&lt;*&gt;">
<AlternativeType Name="std::_Vector_const_iterator&lt;*&gt;" />
<SmartPointer Usage="Indexable">_Ptr,na</SmartPointer>
Expand Down

0 comments on commit 0620026

Please sign in to comment.