+2010-06-20 Roland McGrath <roland@redhat.com>
+
+ * libdwP.h (CUDIE): Use cu_data.
+ * dwarf_formblock.c: Likewise.
+ * dwarf_formref_die.c: Likewise.
+ * dwarf_diecu.c: Use CUDIE macro.
+ * dwarf_formaddr.c: Use cu_sec_idx.
+
2010-06-16 Roland McGrath <roland@redhat.com>
* dwarf_formref_die.c: Use dwarf_offdie only for DW_FORM_ref_addr, so
if (die == NULL)
return NULL;
- /* Clear the entire DIE structure. This signals we have not yet
- determined any of the information. */
- memset (result, '\0', sizeof (Dwarf_Die));
-
- result->addr = ((char *) die->cu->dbg->sectiondata[IDX_debug_info]->d_buf
- + DIE_OFFSET_FROM_CU_OFFSET (die->cu->start,
- die->cu->offset_size,
- die->cu->type_offset != 0));
- result->cu = die->cu;
+ *result = CUDIE (die->cu);
if (address_sizep != NULL)
*address_sizep = die->cu->address_size;
/* Return offset of DIE.
- Copyright (C) 2003, 2005 Red Hat, Inc.
+ Copyright (C) 2003-2010 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2003.
{
return (die == NULL
? ~0ul
- : (Dwarf_Off) (die->addr
- - die->cu->dbg->sectiondata[IDX_debug_info]->d_buf));
+ : (Dwarf_Off) (die->addr - cu_data (die->cu)->d_buf));
}
INTDEF(dwarf_dieoffset)
/* Return address represented by attribute.
- Copyright (C) 2003, 2005 Red Hat, Inc.
+ Copyright (C) 2003-2010 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2003.
}
if (__libdw_read_address (attr->cu->dbg,
- IDX_debug_info, attr->valp,
+ cu_sec_idx (attr->cu), attr->valp,
attr->cu->address_size, return_addr))
return -1;
return -1;
}
- if (return_block->data + return_block->length
- > ((unsigned char *) attr->cu->dbg->sectiondata[IDX_debug_info]->d_buf
- + attr->cu->dbg->sectiondata[IDX_debug_info]->d_size))
+ if (unlikely (cu_data (attr->cu)->d_size
+ - (return_block->data
+ - (unsigned char *) cu_data (attr->cu)->d_buf)
+ < return_block->length))
{
/* Block does not fit. */
__libdw_seterrno (DWARF_E_INVALID_DWARF);
if (unlikely (__libdw_formref (attr, &offset) != 0))
return NULL;
- data = cu->dbg->sectiondata[IDX_debug_info];
+ data = cu_data (cu);
}
if (unlikely (data->d_size - cu->start <= offset))
((Dwarf_Die) \
{ \
.cu = (fromcu), \
- .addr = ((char *) (fromcu)->dbg->sectiondata[IDX_debug_info]->d_buf \
+ .addr = ((char *) cu_data (fromcu)->d_buf \
+ DIE_OFFSET_FROM_CU_OFFSET ((fromcu)->start, \
(fromcu)->offset_size, \
(fromcu)->type_offset != 0)) \