I am currently trying to create a natvis XML file for a large Project at work. We have a Pointer to a type, which the Debugger knows nothing of (Information hiding with a typedef, it was a stupid idea by the author, but can't be changed at the Moment...).
The original struct is similar to this one (the Debugger knows nothing of These types, he only sees the pointer):
struct INNER_1_t
{
int* pointerToArray;
int n;
}
struct INNER_2_t
{
int v_1;
int v_2;
}
struct OUTER_t
{
/* a lot of other, primitive members ... */
int lface;
int *edges; //Array with num_edges members
int num_edges;
INNER_1_t *ptr1; //Array with n1 members
int n1;
INNER_2_t *ptr2; //Array with n2 items
int n2;
}
My Goal is to make the members of this struct visible via a natvis XML file. For the normal members, this is easy, with Items and pointer arithmetic. Example:
<Item Name="lface">*((int*)(((char*)this)+92))</Item>
I also know how to define Arrays of known types:
<Synthetic Name="edge">
<DisplayString>Edges({*((int*)(((char*)this)+80))})</DisplayString>
<Expand>
<ArrayItems>
<Size>*((int*)(((char*)this)+80))</Size>
<ValuePointer>*((double**)(((char*)this)+76))</ValuePointer>
</ArrayItems>
</Expand>
</Synthetic>
Is there any way to define an Array of an (for the Debugger) UNKNOWN type? Or can i somehow declare the type inside the XML file?