question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
WardenGnawcommented, Sep 12, 2022

Fixed with #1346

1reaction
pieandcakescommented, Mar 23, 2020

@paulmaybee Is this something that is supported in our MIEngine’s natvis implementation?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Natvis: Custom views for native objects
Learn how the Natvis framework provides custom views for native C++ objects ... how the multi-dimensional array indices should be unrolled.
Read more >
Create custom views of C++ objects - Visual Studio
Use the Natvis framework to customize the way that Visual Studio displays native types in the debugger.
Read more >
c++ - customize multi-dimension array debugging in visual ...
I am using arma Matrix and I would like to have a look at the value during debugging. So I add a natvis...
Read more >
Newest 'natvis' Questions - Stack Overflow
I would like to provide some .natvis file based C++ custom view objects for Visual Studio Code. It is not working as expected...
Read more >
Topic: Embedded Eigen Matrix Debugging Visualizer
Hi,. We have managed to reproduce the problem with the Eigen natvis file. It is caused by VisualGDB not supporting the $Tx syntax...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found