Natvis doesn't match complex type name

447 views Asked by At

I have the following .natvis file for visualizing the elements of a hash table.

<?xml version="1.0" encoding="utf-8"?>
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
  <Type Name="vbl::Hash_Table&lt;*&gt;">
    <DisplayString>{size} elements in {capacity} slots</DisplayString>
    <Expand>
      <CustomListItems MaxItemsPerView="5000" ExcludeView="Test">
        <Variable Name="slot_index" InitialValue="0" />

        <Size>size</Size>
        <Loop>
          <Break Condition="slot_index &gt;= size"/>
          <If Condition="slot_index &lt; size">
            <If Condition="slots[slot_index].key_hash == true">
              <Item Name="key">slots[slot_index].key</Item>
              <Item Name="value">slots[slot_index].value</Item>
            </If>
            <Exec>slot_index++</Exec>
          </If>
        </Loop>
      </CustomListItems>
    </Expand>
  </Type>
</AutoVisualizer>

I am not (yet) concerned about the complicated visualization logic, but just about the name matching. This natvis gets loaded for the type vbl::Hash_Table<Handle, Entity*, null> but not for the type vbl::Hash_Table<Physics_Body*, long, function (Physics_Body* b) @system => hash32((*b)::entity::handle::raw_handle::bitfield)>. The Output window shows that the natvis compiles completely for the first one, but isn't even considered for the second one.

The second type signature is completely crazy, I known, but unfortunately I have to work with it and can't figure out why it doesn't match. I considered that the name matching system maybe matches greadily, so that the > would match the greater-than in => and not at the end, but since it doesn't have problems with nested templates, this can't be the case.

How do I correct <Type Name="vbl::Hash_Table&lt;*&gt;">to match both type signatures?

0

There are 0 answers