On Fri, 2012-04-27 at 14:44 -0700, Roland McGrath wrote:
The functionality change is fine. Needs a NEWS item.
Don't make the same dwarf_attr call twice. If it fails,
I'm not sure you should use dwarf_formaddr for a case that might
since we get an extra __libdw_seterrno call when the user's call succeeds.
I don't know off hand if we have clear precedent about that issue. But
here it's easy enough just to check attr->form for DW_FORM_addr.
If dwarf_formudata fails I don't think we should return with
DWARF_E_NO_CONSTANT, since the user asked for an address, not a constant.
Probably simplest just to add a
in that error case.
Rewritten patch attached.
Also, please look at the relocate branch for how this can be handled
so the branch (including new interfaces) doesn't regress from trunk in
subtle ways. I think the only change needed is dwarf_ranges_relocatable,
but that seems like it could be nontrivial.
I'll take a look. This actually came from studying the relocation branch
and realizing a lot of relocations came in low_pc/high_pc pairs.