Skip to content

Commit

Permalink
<memory>: Add different control block types for `allocate_shared_fo…
Browse files Browse the repository at this point in the history
…r_overwrite` (#4274)

Co-authored-by: Stephan T. Lavavej <[email protected]>
  • Loading branch information
frederick-vs-ja and StephanTLavavej authored Jan 30, 2024
1 parent 9c10c1a commit c0da2af
Show file tree
Hide file tree
Showing 3 changed files with 272 additions and 33 deletions.
104 changes: 104 additions & 0 deletions stl/debugger/STL.natvis
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,35 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
</Expand>
</Type>

<!-- VS 2022 17.10 -->
<Type Name="std::_Ref_count_bounded_array&lt;*&gt;">
<DisplayString>make_shared&lt;T[N]&gt;</DisplayString>
<Expand>
<Item Condition="_Uses != 0" Name="[allocated array]">_Storage._Value</Item>
</Expand>
</Type>

<!-- VS 2022 17.10 -->
<Type Name="std::_Ref_count_unbounded_array&lt;*,0&gt;">
<Intrinsic Name="data" Expression="&amp;(_Storage._Value)" />
<Intrinsic Name="size" Expression="_Size" />
<DisplayString>make_shared&lt;T[]&gt;</DisplayString>
<Expand>
<ArrayItems>
<Size>size()</Size>
<ValuePointer>data()</ValuePointer>
</ArrayItems>
</Expand>
</Type>

<!-- VS 2022 17.10 -->
<Type Name="std::_Ref_count_unbounded_array&lt;*,1&gt;">
<DisplayString>make_shared&lt;T[]&gt;</DisplayString>
<Expand>
<Item Condition="_Uses != 0" Name="[original ptr]">_Storage._Value</Item>
</Expand>
</Type>

<!-- VC 2015 -->
<Type Name="std::_Ref_count_obj_alloc&lt;*&gt;">
<DisplayString>allocate_shared</DisplayString>
Expand All @@ -386,6 +415,81 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
</Expand>
</Type>

<!-- VS 2022 17.10 -->
<Type Name="std::_Ref_count_bounded_array_alloc&lt;*&gt;">
<!-- stateless allocator -->
<Intrinsic Optional="true" Name="allocator" Expression="*((_Mybase *) this)"/>
<!-- stateful allocator -->
<Intrinsic Optional="true" Name="allocator" Expression="_Myval"/>
<DisplayString>allocate_shared&lt;T[N]&gt;</DisplayString>
<Expand>
<Item Condition="_Uses != 0" Name="[allocated array]">_Storage._Value</Item>
<Item Name="[allocator]">allocator()</Item>
</Expand>
</Type>

<!-- VS 2022 17.10 -->
<Type Name="std::_Ref_count_unbounded_array_alloc&lt;*&gt;">
<!-- stateless allocator -->
<Intrinsic Optional="true" Name="allocator" Expression="*((_Mybase *) this)"/>
<!-- stateful allocator -->
<Intrinsic Optional="true" Name="allocator" Expression="_Myval"/>
<Intrinsic Name="data" Expression="&amp;(_Storage._Value)" />
<Intrinsic Name="size" Expression="_Size" />
<DisplayString>allocate_shared&lt;T[]&gt;</DisplayString>
<Expand>
<Item Name="[allocator]">allocator()</Item>
<ArrayItems>
<Size>size()</Size>
<ValuePointer>data()</ValuePointer>
</ArrayItems>
</Expand>
</Type>

<!-- VS 2022 17.10 -->
<Type Name="std::_Ref_count_obj_alloc_for_overwrite&lt;*&gt;">
<!-- stateless allocator -->
<Intrinsic Optional="true" Name="allocator" Expression="*((_Mybase *) this)"/>
<!-- stateful allocator -->
<Intrinsic Optional="true" Name="allocator" Expression="_Myval"/>
<DisplayString>allocate_shared_for_overwrite</DisplayString>
<Expand>
<Item Condition="_Uses != 0" Name="[original ptr]">($T1 *) &amp;_Storage</Item>
<Item Name="[allocator]">allocator()</Item>
</Expand>
</Type>

<!-- VS 2022 17.10 -->
<Type Name="std::_Ref_count_bounded_array_alloc_for_overwrite&lt;*&gt;">
<!-- stateless allocator -->
<Intrinsic Optional="true" Name="allocator" Expression="*((_Mybase *) this)"/>
<!-- stateful allocator -->
<Intrinsic Optional="true" Name="allocator" Expression="_Myval"/>
<DisplayString>allocate_shared_for_overwrite&lt;T[N]&gt;</DisplayString>
<Expand>
<Item Condition="_Uses != 0" Name="[allocated array]">_Storage._Value</Item>
<Item Name="[allocator]">allocator()</Item>
</Expand>
</Type>

<!-- VS 2022 17.10 -->
<Type Name="std::_Ref_count_unbounded_array_alloc_for_overwrite&lt;*&gt;">
<!-- stateless allocator -->
<Intrinsic Optional="true" Name="allocator" Expression="*((_Mybase *) this)"/>
<!-- stateful allocator -->
<Intrinsic Optional="true" Name="allocator" Expression="_Myval"/>
<Intrinsic Name="data" Expression="&amp;(_Storage._Value)" />
<Intrinsic Name="size" Expression="_Size" />
<DisplayString>allocate_shared_for_overwrite&lt;T[]&gt;</DisplayString>
<Expand>
<Item Name="[allocator]">allocator()</Item>
<ArrayItems>
<Size>size()</Size>
<ValuePointer>data()</ValuePointer>
</ArrayItems>
</Expand>
</Type>

<!-- VC 2017, second toolset update -->
<Type Name="std::_Ref_count_resource&lt;*&gt;">
<DisplayString>custom deleter</DisplayString>
Expand Down
Loading

0 comments on commit c0da2af

Please sign in to comment.