Re: [DynInst_API:] Converting libdwarf use to libdw?


Date: Tue, 21 Aug 2012 17:40:14 -0700
From: Josh Stone <jistone@xxxxxxxxxx>
Subject: Re: [DynInst_API:] Converting libdwarf use to libdw?
On 08/21/2012 12:17 PM, Andrew Bernat wrote:
> It hadn't crossed our radar yet, no. However, the opportunity to drop a
> dependency is always good. 
> 
> I'm currently involved in a substantial rewrite of our dwarf logic, so I
> would suggest waiting until I am done with that. I'll keep an eye on
> making our code as library-independent as possible. 

OK, great.

> In the meantime, do you have any pointers to documentation on libdw? 

Well, you had to go straight for Achilles' heel, didn't you... elfutils
is sorely lacking on documentation.  The headers do have decent comments
on each function, but that's about it.

First, there's a dwarf.h much like that which comes with libdwarf:
http://git.fedorahosted.org/cgit/elfutils.git/plain/libdw/dwarf.h

Here's libdw, which is fairly similar to the libdwarf:
http://git.fedorahosted.org/cgit/elfutils.git/plain/libdw/libdw.h

There is also libdwfl (Frontend Library), a somewhat higher interface.
I believe that does more work for relocations and for locating separate
debuginfo files (the way rpm splits it), to be used along with libdw.
http://git.fedorahosted.org/cgit/elfutils.git/plain/libdwfl/libdwfl.h

For examples, maybe look at elfutils' own tools (though some of those
cheat and use internal interfaces).  The tools using libdw and/or
libdwfl are addr2line, elflint, findtextrel, nm, readelf, and unstrip.
http://git.fedorahosted.org/cgit/elfutils.git/tree/src

I can point to other tools that use elfutils too, like systemtap, but
that should be enough to give you an idea for now. :)

Josh
[← Prev in Thread] Current Thread [Next in Thread→]