+2019-01-17 Tom de Vries <tdevries@suse.de>
+
+ PR libbacktrace/82857
+ * dwarf.c (enum attr_val_encoding): Add ATTR_VAL_REF_ALT_INFO.
+ (read_attribute): Handle DW_FORM_GNU_ref_alt using
+ ATTR_VAL_REF_ALT_INFO.
+ (read_referenced_name_from_attr): Handle DW_FORM_GNU_ref_alt.
+
2019-01-17 Tom de Vries <tdevries@suse.de>
* dwarf.c (struct unit): Add low_offset and high_offset fields.
ATTR_VAL_REF_UNIT,
/* An offset to other data within the .dwarf_info section. */
ATTR_VAL_REF_INFO,
+ /* An offset to other data within the alt .dwarf_info section. */
+ ATTR_VAL_REF_ALT_INFO,
/* An offset to data in some other section. */
ATTR_VAL_REF_SECTION,
/* A type signature. */
val->encoding = ATTR_VAL_NONE;
return 1;
}
- val->encoding = ATTR_VAL_REF_SECTION;
+ val->encoding = ATTR_VAL_REF_ALT_INFO;
return 1;
case DW_FORM_GNU_strp_alt:
{
|| val->encoding == ATTR_VAL_REF_UNIT)
return read_referenced_name (ddata, u, val->u.uint, error_callback, data);
+ if (val->encoding == ATTR_VAL_REF_ALT_INFO)
+ {
+ struct unit *alt_unit
+ = find_unit (ddata->altlink->units, ddata->altlink->units_count,
+ val->u.uint);
+ if (alt_unit == NULL)
+ return NULL;
+
+ uint64_t offset = val->u.uint - alt_unit->low_offset;
+ return read_referenced_name (ddata->altlink, alt_unit, offset,
+ error_callback, data);
+ }
+
return NULL;
}