Easy way to get type info out of STABS?
Justin McCann
jneilm@yahoo.com
Sat Apr 30 07:27:00 GMT 2005
I'm looking for an easy-to-use API to get the type
information out of a Sparc ELF-32 executable with full
debugging symbols. I've read through all of the STABS
documentation I could find, as well as the GDB and
libbfd docs and source code; I've also looked at Sun's
gelf and libelf.
I could write my own STABS parser, but I'm lazy and
believe in code reuse. I figure there has to be one
that isn't totally dependent on four dozen other
include files. Anyone have any suggestions?
What I'm aiming for is something that I can use to
make an API along the lines of:
char *lookupfieldname(typenumber, offset)
So, given the type of a variable and an offset to a
field within that variable (some arbitrary nesting
deep) I need to determine what the field name is that
corresponds to that offset.
For example:
struct {
int a;
struct {
int b;
int q;
} foo;
} myvar;
For the address &(myvar) + 8, I'd like to be able to
say that it is "myvar.foo.q".
Anyone know of a library that has all the info in an
easy-enough place to put that together?
Thanks in advance,
Justin
__________________________________
Do you Yahoo!?
Make Yahoo! your home page
http://www.yahoo.com/r/hs
More information about the Binutils
mailing list