debugging - Deconstruct array of structs with natvis -


i'm looking way display entries of array of structs in separate arrays natvis in visual studio 2015.

display this

+-x[0]   +-a   +-b   +-c +-x[1]   +-a   +-b   +-c ... 

as

a +-[0]    (= x[0].a) +-[1]    (= x[1].a) ... b +-[0]    (= x[0].b) +-[1]    (= x[1].b) ... c +-[0]    (= x[0].c) +-[1]    (= x[1].c) 

edit: following comment, working solution, requires alignment of proxy types, in case can done power-of-two values.

#define a(t) __declspec(align(t))  struct c {     int a;     int b;     int c;     int junk; };  a(16) struct d {     int z; };  a(16) struct db {     int junk;     int z; };  a(16) struct dc {     int junk[2];     int z; };  typedef union {     d da;     db db;     dc dc; } ui;  typedef union {     c c[50];     ui d[50]; } u; 

original (incomplete) answer:

each type individually parsed , visualized. when parsing each x element there's no way on storing data later aggregate of a,b , c.

you can change code such overlapping (union) type match array. write separate visualizers each type:

__decltypestruct c { int a,b,c; }; struct d { int a[10], b[10], c[10]; }; union { c c[10]; d d; }; 

Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -