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]

Re: Easy way to get type info out of STABS?


Justin McCann <jneilm@yahoo.com> writes:

> 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. 

Look at the debugging library which objdump and objcopy use.  The
interface is binutils/debug.h.  Look at read_debugging_info in
binutils/rddbg.c to get debugging information for a file.  Then call,
e.g., debug_find_tagged_type to get the struct you want, call
debug_get_fields to get the fields, and call debug_get_field_bitpos on
each field to get the bit position within the struct.

Ian


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