This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Easy way to get type info out of STABS?
- From: Ian Lance Taylor <ian at airs dot com>
- To: Justin McCann <jneilm at yahoo dot com>
- Cc: binutils at sources dot redhat dot com, gdb at sources dot redhat dot com
- Date: 02 May 2005 14:37:12 -0400
- Subject: Re: Easy way to get type info out of STABS?
- References: <20050430023345.9921.qmail@web30402.mail.mud.yahoo.com>
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