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


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

Re: Help understanding what BFD can do


don.bebout@conexant.com writes:

> I built an executable file (from a C file) on a Sun Space machine with gcc.
> It is supposed to be elf/dwarf2 format.  I then wrote a small program which
> calls bfd_get_symtab_upper_bound, bfd_canonicalize_symtab, and
> bfd_print_symbol_vandf functions to dump all of the symbols.  All that I
> get are the global symbols (including function names) and local-static
> symbols.  What I don't get is detailed type information, structure
> definitions, function arguments, local (stack based) variables, typedefs,
> etc.

BFD doesn't do that.

Back in the old days, it was decided that debugging information varied
too much, that BFD could help with basic common stuff like sections
and symbol tables but couldn't help with debugging information.  (I
think it was John Gilmore who pushed this point of view).

> I then took a look at some source for the objdump utility.  debug.c and
> rddbg.c appear to create another set of data structures to hold the
> information I am looking for.  However, I have been unable to use objdump
> (v2.9.1) to dump the debug infomation that I am looking for.

For reasons that are no longer relevant, I wrote some debug parsing
code in the binutils.  That is binutils/debug.c and friends.  However,
nobody has written a DWARF2 implementation for that code.  It could be
done, but nobody has actually done it.

I could have used the gdb code for that, but the gdb team at that time
discouraged me from doing so.  So I just wrote my own code.

> And finally, the gdb source has a file dwarf2.c which appears to parse the
> binary data of a bfd section.

Yes, that is how gdb parses DWARF 2 debugging information.

> I thought BFD was supposed to parse the
> dwarf2 sections?  Am I missing the point of BFD?

You probably aren't missing the point, but you are missing the extent
of what BFD covers.  BFD doesn't parse debugging information, and
never has.

Ian

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