diff options
| author | Yong He <yonghe@outlook.com> | 2020-07-06 11:58:14 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-06 11:58:14 -0700 |
| commit | cf62f13cdc8a7f21c78f03b097bff6edf09fdead (patch) | |
| tree | 6a08ddcd4dfe39976a7dec29164da4f7b87ddfda /source/core/core.natvis | |
| parent | ffd0b9c9b06a22d886c77d777d9aa0cd1298d363 (diff) | |
ShortList<T> and core.natvis improvements. (#1430)
* ShortList<T> and core.natvis improvements.
* Fix gcc build.
* add `getBuffer()` accessor to `GetArrayViewResult`
Diffstat (limited to 'source/core/core.natvis')
| -rw-r--r-- | source/core/core.natvis | 51 |
1 files changed, 46 insertions, 5 deletions
diff --git a/source/core/core.natvis b/source/core/core.natvis index 2b1e3ff7e..1087b4e6a 100644 --- a/source/core/core.natvis +++ b/source/core/core.natvis @@ -18,7 +18,7 @@ </Expand> </Type> -<Type Name="Slang::List<*>"> +<Type Name="Slang::List<*,*>"> <DisplayString>{{ size={m_count} }}</DisplayString> <Expand> <Item Name="[size]">m_count</Item> @@ -30,6 +30,18 @@ </Expand> </Type> +<Type Name="Slang::ShortList<*,*,*>"> + <DisplayString>{{ size={m_count} }}</DisplayString> + <Expand> + <Item Name="[size]">m_count</Item> + <Item Name="[capacity]">m_capacity</Item> + <IndexListItems> + <Size>m_count</Size> + <ValueNode Condition="$i<$T2">m_shortBuffer + $i</ValueNode> + <ValueNode Condition="$i>=$T2">m_buffer + $i - $T2</ValueNode> + </IndexListItems> + </Expand> +</Type> <Type Name="Slang::Array<*,*>"> <DisplayString>{{ size={m_count} }}</DisplayString> @@ -47,10 +59,33 @@ <Expand> <Item Name="[size]">_count</Item> <Item Name="[capacity]">bucketSizeMinusOne + 1</Item> - <ArrayItems> - <Size>bucketSizeMinusOne + 1</Size> - <ValuePointer>hashMap</ValuePointer> - </ArrayItems> + <CustomListItems MaxItemsPerView="5000" ExcludeView="Test"> + <Variable Name="iBucket" InitialValue="0" /> + <Variable Name="pBucket" InitialValue="hashMap" /> + <Variable Name="isDeleted" InitialValue="0" /> + <Variable Name="isEmpty" InitialValue="0" /> + <Size>_count</Size> + <Exec>pBucket = hashMap</Exec> + <Loop> + <If Condition="iBucket >= bucketSizeMinusOne + 1"> + <Break/> + </If> + <Exec> + isDeleted = marks.m_buffer.m_count > (iBucket*2+1)/32 + ? ((marks.m_buffer.m_buffer[(iBucket*2+1)/32]&(1<<(iBucket*2+1)%32)) != 0) + : 0 + </Exec> + <Exec> + isEmpty = marks.m_buffer.m_count > (iBucket*2)/32 + ? ((marks.m_buffer.m_buffer[(iBucket*2)/32]&(1<<(iBucket*2)%32)) == 0) + : 1 + </Exec> + <If Condition="isDeleted+isEmpty==0"> + <Item>*(hashMap + iBucket)</Item> + </If> + <Exec>iBucket++</Exec> + </Loop> + </CustomListItems> </Expand> </Type> @@ -103,4 +138,10 @@ <StringView>(m_sizeThenContents + 1),s</StringView> </Type> +<Type Name="Slang::UnownedStringSlice"> + <DisplayString>{m_begin,[m_end-m_begin]s}</DisplayString> + <StringView>m_begin,[m_end-m_begin]s</StringView> + +</Type> + </AutoVisualizer> |
