2009-07-16 Roland McGrath <roland@redhat.com>
+ * dwarf_formudata.c (__libdw_formptr): Handle DW_FORM_sec_offset,
+ reject others when CU's version > 3.
+
+ * dwarf_formflag.c: Handle DW_FORM_flag_present.
+
* dwarf.h: Add DW_OP_{implicit,stack}_value from DWARF 4 draft.
Also DW_TAG_type_unit and DW_TAG_rvalue_reference_type.
Also DW_AT_signature, DW_AT_main_subprogram, DW_AT_data_bit_offset,
/* Return flag represented by attribute.
- Copyright (C) 2004 Red Hat, Inc.
+ Copyright (C) 2004-2009 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2004.
if (attr == NULL)
return -1;
+ if (attr->form == DW_FORM_flag_present)
+ {
+ *return_bool = true;
+ return 0;
+ }
+
if (unlikely (attr->form != DW_FORM_flag))
{
__libdw_seterrno (DWARF_E_NO_FLAG);
/* Return unsigned constant represented by attribute.
- Copyright (C) 2003, 2005 Red Hat, Inc.
+ Copyright (C) 2003-2009 Red Hat, Inc.
This file is part of Red Hat elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2003.
}
Dwarf_Word offset;
+ if (attr->form == DW_FORM_sec_offset)
+ {
+ if (__libdw_read_offset (attr->cu->dbg, IDX_debug_info, attr->valp,
+ attr->cu->offset_size, &offset, sec_index, 0))
+ return NULL;
+ }
+ else if (attr->cu->version > 3)
+ goto invalid;
+
switch (attr->form)
{
case DW_FORM_data4:
unsigned char *endp = d->d_buf + d->d_size;
if (unlikely (readp >= endp))
{
+ invalid:
__libdw_seterrno (DWARF_E_INVALID_DWARF);
return NULL;
}