[GCC-XML] Stupid newbie question re: layout of member/instance variables

Brad King brad.king at kitware.com
Thu Apr 21 14:34:07 EDT 2005


John Morrison wrote:
> Is there any way to find out the memory layout of C++ classes,
> especially in the context of multiple inheritance?  I am using gccxml
> to generate bindings for C++, and I can find out the *size* of the
> class instances, but is there a way to compute the layout so the
> bindings can directly reference the member variables?  This is
> especially important in the case where there are neither mutators nor
> accessors defined within the classes.

This is not possible because GCC-XML only simulates another compiler's 
preprocessor.  The standard GCC parser is used after that.  It is not 
aware of the ABI used by the real compiler.  Even the size and alignment 
information is not guaranteed to match, but it works in most cases which 
is why it's provided.

-Brad



More information about the gccxml mailing list