Skip to content

Natvis: are multi-dimensional arrays supported in gdb natvis? #980

@elbrandt

Description

@elbrandt

Hello,
I have a natvis to visualize a 2D array that works perfectly in VisualStudio 2019.
The same natvis file on VSCode 1.43.0 in Ubunutu, using gdb is not so happy.

Can you tell me if multi dimensional array capability is supposed to work using MIMode: gdb?

I'll be glad to work up a full minimal-working-example if this is supposed to work, but for now, here's the Type definition from my natvis that works on VStudio, but not on VSCode/gdb

  <Type Name="PhysBAM::ARRAYS_ND_BASE&lt;PhysBAM::VECTOR&lt;*,2&gt;&gt;">
    <DisplayString>{{ [({domain.min_corner.x},{domain.min_corner.y}),({domain.max_corner.x},{domain.max_corner.y})] }}</DisplayString>
    <Expand>
      <ArrayItems>
        <Direction>Forward</Direction>
        <Rank>2</Rank>
        <Size>((int*)&amp;counts)[$i]</Size>
        <ValuePointer>($T1*)base_pointer</ValuePointer>
      </ArrayItems>
    </Expand>
  </Type>

Thanks in advance!
-Eric.

View in VSCode (not so good):
image

View in Visual Studio (very nice!):
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions