]> git.ipfire.org Git - thirdparty/elfutils.git/commit
libdw: Add new function dwarf_getlocations.
authorMark Wielaard <mjw@redhat.com>
Fri, 23 Aug 2013 14:12:37 +0000 (16:12 +0200)
committerMark Wielaard <mjw@redhat.com>
Fri, 6 Sep 2013 10:09:45 +0000 (12:09 +0200)
commit66eaae9bcc1608efad65e3aa0204afbb3cb1a83d
tree7b6cf609f153fff253c20da94ea35a631b82e4cc
parent92e47d616d15beec31c406ce254e639faa8fac2b
libdw: Add new function dwarf_getlocations.

Using dwarf_getlocation it is possible to get single location
descriptions and with dwarf_getlocation_addr it is possible to
get a location list covering a specific address.  But sometimes
it is more convenient to get all ranges covered by a location
list.  For example when a specific address isn't covered and
you want to find alternative addresses where a location
description is defined.

dwarf_getlocations is modelled after dwarf_ranges. It enumerates
the location ranges and descriptions covered by the given
attribute.  In the first call OFFSET should be zero and *BASEP
need not be initialized.  Returns -1 for errors, zero when
there are no more locations to report, or a nonzero OFFSET
value to pass to the next call.  Each subsequent call must
preserve *BASEP from the prior call.  Successful calls fill in
*STARTP and *ENDP with a contiguous address range and *EXPR with
a pointer to an array of operations with length *EXPRLEN.  If
the attribute describes a single location description and not a
location list the first call (with OFFSET zero) will return the
location description in *EXPR with *STARTP set to zero and *ENDP
set to minus one.

ptrdiff_t dwarf_getlocations (Dwarf_Attribute *attr, ptrdiff_t offset,
                              Dwarf_Addr *basep, Dwarf_Addr *startp,
                              Dwarf_Addr *endp, Dwarf_Op **expr,
                              size_t *exprlen);

Signed-off-by: Mark Wielaard <mjw@redhat.com>
libdw/ChangeLog
libdw/dwarf_getlocation.c
libdw/libdw.h
libdw/libdw.map