[xsd-users] gdb macros for generated classes

Boris Kolpackov boris at codesynthesis.com
Tue Oct 13 13:49:51 EDT 2009


Hi Adam,

Adam Chase <adam.chase1 at gmail.com> writes:

> I am trying to debug some code that uses xsd generated C++ classes and
> would like to be able to print out their contents.
> 
> Are there any gdb macros that I can use to do so?

I am not aware of anything like this. Printing of the content of any 
generated class would require a specific macro for each class. I don't 
think this would scale. On the other hand, I can see how macros for 
printing the container templates (one, optional, sequence) that are
used by the generated code could be useful. This could be similar to
the macros used to print STL containers.

One other thing that you may find useful is the option to generate
ostream insertion operators (--generate-ostream). These can be used
to quickly dump the content of the object model (or a fragment thereof)
from the application.

Boris



More information about the xsd-users mailing list