This is the mail archive of the egcs@egcs.cygnus.com mailing list for the EGCS project. See the EGCS home page for more information.


[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index] [Subject Index] [Author Index] [Thread Index]

Re: dwarf2 debug dependent upon GAS?





> Brian Ford wrote:
>
> > On Mon, 22 Feb 1999, Robert Lipe wrote:
> >
> > > Is there some sort of tool that a human can use to help read [dwarf]
> > > tables?
> >
> > I'm not exactly sure what you are asking for, but would dwarfdump do
> > the trick?
>
> From the name, it sounds interesting.  Does dwarfdump exist outside of
> the SGI/MIPS tool kit?
>
> If it doesn't, it doesn't do me much good.
>
>

I have a dwarf2 dumper (more of a reader, it can dump it in a nicely
readable format as a side effect) written in python, which means it should
be portable just about anywhere.
It only works on ELF executables , but if you can give it the offsets of the
various debug sections, and such, it'll happily read them and process them.
The only thing it doesn't do right now is location expressions, because i
just haven't gotten around to it (it's rather easy, you just need to
describe the structure to it).
It's part of a debugger i wrote for BeOS.  I got tired of writing the dwarf2
reading/processing code in C++, it was just much easier in python, and
easier to maintain.  In addition to dumping the info, it also builds and
keeps track of a hashtable and a proper "general" tree of each compilation
unit, keyed on the offsets.
I also have a c module for the structure unpacker i wrote that it uses,
which makes it take 3 seconds to read and process large amount of debug info
(3 meg in this case), as opposed to 20 for the straight python code ( You
shouldn't run into alignment issues on the C code, as it was written with
avoiding them in mind. I could be wrong, however.)

Lemme know if you want it (or anyone else for that matter, just put "python
dwarf2 code" in the subject so it goes into the right folder)
Dan