Easy way to get type info out of STABS?
Ian Lance Taylor
ian@airs.com
Mon May 2 18:37:00 GMT 2005
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
More information about the Binutils
mailing list