Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding mutex, ranges, functional, any and format visualizers #2191

Merged
merged 20 commits into from
Jul 11, 2022
Merged
Changes from 3 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
107 changes: 104 additions & 3 deletions stl/debugger/STL.natvis
Original file line number Diff line number Diff line change
Expand Up @@ -1665,9 +1665,8 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
<Expand/>
</Type>


<!-- VC 2015 -->
<Type Name="std::recursive_mutex">
<Type Name="std::mutex">
<AlternativeType Name="std::recursive_mutex"/>
<DisplayString Condition="sizeof(void *) == 4u &amp;&amp; *(int *)((char *)(&amp;_Mtx_storage) + 44) == 0">unlocked</DisplayString>
strega-nil-ms marked this conversation as resolved.
Show resolved Hide resolved
<DisplayString Condition="sizeof(void *) == 4u &amp;&amp; *(int *)((char *)(&amp;_Mtx_storage) + 44) != 0">locked</DisplayString>
<DisplayString Condition="sizeof(void *) == 8u &amp;&amp; *(int *)((char *)(&amp;_Mtx_storage) + 76) == 0">unlocked</DisplayString>
Expand All @@ -1680,6 +1679,52 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
</Expand>
</Type>

<Type Name="std::timed_mutex">
<AlternativeType Name="std::recursive_timed_mutex"/>
<DisplayString>{_My_mutex}</DisplayString>
strega-nil-ms marked this conversation as resolved.
Show resolved Hide resolved
<Expand>
<Item Name="[locking_thread_id]" Condition="sizeof(void *) == 4u &amp;&amp; *(int *)((char *)(&amp;(_My_mutex._Mtx_storage)) + 44) != 0">*(long *)((char *)(&amp;(_My_mutex._Mtx_storage)) + 40)</Item>
<Item Name="[locking_thread_id]" Condition="sizeof(void *) == 8u &amp;&amp; *(int *)((char *)(&amp;(_My_mutex._Mtx_storage)) + 76) != 0">*(long *)((char *)(&amp;(_My_mutex._Mtx_storage)) + 72)</Item>
<Item Name="[ownership_levels]" Condition="sizeof(void *) == 4u &amp;&amp; *(int *)((char *)(&amp;(_My_mutex._Mtx_storage)) + 44) != 0">*(int *)((char *)(&amp;(_My_mutex._Mtx_storage)) + 44)</Item>
<Item Name="[ownership_levels]" Condition="sizeof(void *) == 8u &amp;&amp; *(int *)((char *)(&amp;(_My_mutex._Mtx_storage)) + 76) != 0">*(int *)((char *)(&amp;(_My_mutex._Mtx_storage)) + 76)</Item>
<Item Name="[My owner]" Optional="true">_My_owner</Item>
AnjuDel marked this conversation as resolved.
Show resolved Hide resolved
</Expand>
AnjuDel marked this conversation as resolved.
Show resolved Hide resolved
</Type>

<Type Name="std::lock_guard&lt;*&gt;">
<DisplayString>{_My_mutex}</DisplayString>
strega-nil-ms marked this conversation as resolved.
Show resolved Hide resolved
</Type>

<Type Name="std::unique_lock&lt;*&gt;">
<DisplayString>{*_Pmtx}</DisplayString>
<Expand>
<Item Name="owns">_Owns</Item>
</Expand>
</Type>

<Type Name="std::scoped_lock&lt;*&gt;">
<DisplayString>{_MyMutex}</DisplayString>
</Type>

<Type Name="std::scoped_lock&lt;*,*&gt;">
<DisplayString>{_MyMutexes}</DisplayString>
</Type>
strega-nil-ms marked this conversation as resolved.
Show resolved Hide resolved

<Type Name="std::defer_lock_t">
<DisplayString>defer lock</DisplayString>
</Type>

<Type Name="std::try_to_lock_t">
<DisplayString>try to lock</DisplayString>
</Type>

<Type Name="std::adopt_lock_t">
<DisplayString>adopt lock</DisplayString>
</Type>

<Type Name="std::once_flag">
<DisplayString>{(int)_Opaque}</DisplayString>
AnjuDel marked this conversation as resolved.
Show resolved Hide resolved
strega-nil-ms marked this conversation as resolved.
Show resolved Hide resolved
</Type>

<!-- VC 2015 -->
<Type Name="std::_Associated_state&lt;*&gt;">
Expand Down Expand Up @@ -1955,4 +2000,60 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
<Expand/>
</Type>

<Type Name="std::formatter&lt;*,*&gt;">
<DisplayString>{_Specs._Dynamic_width_index}, {_Specs._Dynamic_precision_index}</DisplayString>
strega-nil-ms marked this conversation as resolved.
Show resolved Hide resolved
<Expand>
<Item Name="Width index">_Specs._Dynamic_width_index</Item>
<Item Name="Precision index">_Specs._Dynamic_precision_index</Item>
</Expand>
AnjuDel marked this conversation as resolved.
Show resolved Hide resolved
</Type>

<Type Name="std::basic_format_parse_context&lt;*&gt;">
<DisplayString>{_Format_string}</DisplayString>
<Expand>
<Item Name="Arguments">_Num_args</Item>
<Item Name="Next arg id">_Next_arg_id</Item>
</Expand>
</Type>

<Type Name="std::basic_format_args&lt;*&gt;">
<DisplayString>Num args:{_Num_args}</DisplayString>
<Expand>
<Item Name="Index">_Index_array->_Index</Item>
<Item Name="Type">_Index_array->_Type_</Item>
AnjuDel marked this conversation as resolved.
Show resolved Hide resolved
</Expand>
</Type>

<Type Name="std::basic_format_arg&lt;*&gt;">
<DisplayString>Active state: {_Active_state}</DisplayString>
<Expand>
<Item Name="No state">_No_state</Item>
<Item Name="Int">_Int_state</Item>
<Item Name="UInt state">_UInt_state</Item>
<Item Name="Long long state">_Long_long_state</Item>
<Item Name="ULong_long_state">_ULong_long_state</Item>
<Item Name="Bool state">_Bool_state</Item>
<Item Name="Char state">_Char_state</Item>
<Item Name="Float state">_Float_state</Item>
<Item Name="Double state">_Double_state</Item>
<Item Name="Long double state">_Long_double_state</Item>
<Item Name="Pointer state">_Pointer_state</Item>
<Item Name="CString state">_CString_state</Item>
<Item Name="String state">_String_state</Item>
<Item Name="Custom state">_Custom_state</Item>
</Expand>
AnjuDel marked this conversation as resolved.
Show resolved Hide resolved
</Type>

<Type Name="std::basic_format_context&lt;*&gt;">
<DisplayString>{_Args}</DisplayString>
<Expand>
<Item Name="Iterator">_OutputIt</Item>
<Item Name="Loc">_Loc</Item>
</Expand>
</Type>

<Type Name="std::format_error">
<DisplayString>{what()}</DisplayString>
AnjuDel marked this conversation as resolved.
Show resolved Hide resolved
</Type>

</AutoVisualizer>