Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

Visualize variable length structure?

$
0
0
Hi, any ideas how to write a natvis for a variable length structure?

We have the following setup:

struct Foo
{
  u32 mask; // each bit set corresponds to a void*
  /* void* data[ bitcount(mask) ]; */
};
Now, the complications ...

The data is packed - that is, if the bit is unset, there is no void* for it. Thus a mask of 6=(2,4) corresponds to data={data2, data4}, not data={null_data1, data2, data4}. A __bitcount intrinsic would be super handy here.

The type of data depends on the mask bit. Thus it could be an integer, float, pointer of any type etc. I expect some kind of "eval" would be needed to find the type, depending on the mask to display it correctly.

Any ideas?

Stephen.



Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>