This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Easy way to get type info out of STABS?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]