2009-05-05 Petr Machata <pmachata@redhat.com>
- * libdwP.h (__libdw_read_udata_addr): Declare new function.
+ * libdwP.h (__libdw_formptr): Declare new function.
* dwarf_formudata.c: Implement it here.
* dwarf_getlocation.c (dwarf_getlocation_addr):
Call it instead of hand-rolled offset handling code.
#include "libdwP.h"
internal_function unsigned char *
-__libdw_read_udata_addr (Dwarf_Attribute *attr, int sec_index,
- int err_nodata, unsigned char **endpp)
+__libdw_formptr (Dwarf_Attribute *attr, int sec_index,
+ int err_nodata, unsigned char **endpp)
{
if (attr == NULL)
return NULL;
}
unsigned char *endp, *readp
- = __libdw_read_udata_addr (attr, IDX_debug_loc,
- DWARF_E_NO_LOCLIST, &endp);
+ = __libdw_formptr (attr, IDX_debug_loc,
+ DWARF_E_NO_LOCLIST, &endp);
if (readp == NULL)
return -1;
/* Get the offset into the .debug_line section. NB: this call
also checks whether the previous dwarf_attr call failed. */
const unsigned char *lineendp, *linep
- = __libdw_read_udata_addr (stmt_list, IDX_debug_line,
- DWARF_E_NO_DEBUG_LINE,
- (unsigned char **) &lineendp);
+ = __libdw_formptr (stmt_list, IDX_debug_line,
+ DWARF_E_NO_DEBUG_LINE,
+ (unsigned char **) &lineendp);
if (linep == NULL)
goto out;
/* No PC attributes in this DIE at all, so an empty range list. */
return 0;
- if ((readp = __libdw_read_udata_addr (attr, IDX_debug_ranges,
- DWARF_E_NO_DEBUG_RANGES,
- &readendp)) == NULL)
+ if ((readp = __libdw_formptr (attr, IDX_debug_ranges,
+ DWARF_E_NO_DEBUG_RANGES,
+ &readendp)) == NULL)
return -1;
Dwarf_Word start_offset = (void *) readp - d->d_buf;
internal_function;
unsigned char *
-__libdw_read_udata_addr (Dwarf_Attribute *attr, int sec_index,
- int err_nodata, unsigned char **endpp)
+__libdw_formptr (Dwarf_Attribute *attr, int sec_index,
+ int err_nodata, unsigned char **endpp)
internal_function;
static inline int