Extracting Debug (meta data) from executable images?

Siegfried Heintze siegfried@heintze.com
Thu Dec 8 05:17:00 GMT 2005


>But "extracting debug info" is way too vague of a term to offer any
>meaningful help.  You'd have to state exactly what you're trying to do.
>Try "man objdump" or "objdump -g file", or read the binutils/bfd
>internals manuals.

I basically want to implement reflection for C++ by extracting all the
metadata in the debug portion of the executable image to an xml file. Then I
can easily write programs that can enumerate all the data members of any
given struct or class. GDB can do this: too bad it produces C syntax instead
of XML. I don't want to parse C, it is too difficult.

I found a utility called gccxml which uses the gcc front end and dumps XML
for all the class and struct information. It is strange, however, because it
does not implement the -I switch that gcc does.

Neither nm, readelf or objdump enumerate the fields of a struct. It looks
like dwarfdump would, but libdwarf does not compile with cygwin/gcc 3.4 or
RedHat8/gcc 3.2.

So if I download the source code for GDB, do I compile it on cygwin using
g++? I'd just need to modify the "info variables" and "ptype" commands to
emit XML instead of C.

Siegfried


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list