diff options
author | Mark Wielaard <mark@klomp.org> | 2018-05-22 14:34:06 +0200 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2018-05-25 15:10:40 +0200 |
commit | e7765da2aebf919bf3ab8480ac07ccdee42aaf8d (patch) | |
tree | be455dd507a73736b72a5b86d223a603f23d0fde /libdw/dwarf_getlocation.c | |
parent | 6e3d2521a2b5a3b436901f52cfb9785887a7c961 (diff) |
libdw: Handle all address FORMs for dwarf_highpc, handle errors better.
dwarf_highpc can use any address FORM, not just DW_FORM_addr. Just try
whether the address can be resolved as address. Always set error when
attribute couldn't be found or resolved. When calculating the base
address for a CU don't try to second guess the error code, just treat
an error the same as the attribute not being there.
Signed-off-by: Mark Wielaard <mark@klomp.org>
Diffstat (limited to 'libdw/dwarf_getlocation.c')
-rw-r--r-- | libdw/dwarf_getlocation.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/libdw/dwarf_getlocation.c b/libdw/dwarf_getlocation.c index 116fa715..ade3e6c5 100644 --- a/libdw/dwarf_getlocation.c +++ b/libdw/dwarf_getlocation.c @@ -682,19 +682,10 @@ __libdw_cu_base_address (Dwarf_CU *cu) &attr_mem), &base) != 0) { - int err = INTUSE(dwarf_errno) (); - if (err != 0) - { - __libdw_seterrno (err); - base = (Dwarf_Addr) -1; - } - else - { - /* The compiler provided no base address when it should - have. Buggy GCC does this when it used absolute - addresses in the location list and no DW_AT_ranges. */ - base = 0; - } + /* The compiler provided no base address when it should + have. Buggy GCC does this when it used absolute + addresses in the location list and no DW_AT_ranges. */ + base = 0; } cu->base_address = base; } |