Create EnumMap natvis

This commit is contained in:
Pokechu22 2022-01-02 15:36:47 -08:00
parent b96297f2ee
commit 8e2b06906b
2 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2022 Dolphin Emulator Project
SPDX-License-Identifier: GPL-2.0-or-later
-->
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
<Type Name="Common::EnumMap&lt;*,*,*&gt;">
<Expand>
<!-- The following would work, except ValueNode for IndexListItems doesn't support the Name attribute.
It's only allowed for LinkedListItems and TreeItems, for some reason. So we get to reimplement it with CustomListItems. -->
<!--
<IndexListItems>
<Size>$T2 + 1</Size>
<ValueNode Name="[{($T3)$i}]">m_array[$i]</ValueNode>
</IndexListItems>
-->
<CustomListItems MaxItemsPerView="5000">
<Variable Name="i" InitialValue="0" />
<!-- Size is incremented by 1 since the template argument is the last member (inclusive), but we want the count (exclusive) -->
<Size>$T2 + 1</Size>
<Loop>
<Break Condition="i > $T2" />
<Item Name="[{($T3)i}]">m_array[i]</Item>
<Exec>i++</Exec>
</Loop>
</CustomListItems>
</Expand>
</Type>
</AutoVisualizer>

View File

@ -1240,5 +1240,6 @@
</ItemGroup>
<ItemGroup>
<Natvis Include="Common\BitField.natvis" />
<Natvis Include="Common\EnumMap.natvis" />
</ItemGroup>
</Project>