I instrumented one of my system with a low-level memory read functionality. I'm able to read the content of a memory block in a running system by remote.
I also have the source code and build files of the firmware running in the system.
Now suppose you have a complex static data structure at address X. Its size is 1000 bytes. The struct could be defined as:
--- mystruct.c --- #include "object1.h" #include "object2.h"
static struct { int x; int y; struct { enum { OBJ1, OBJ2 } type; union { object1 obj1; // object1 is another struct object2 obj2; // object2 is another struct }; } array[10]; ... } mystruct;