[libbacktrace] Handle DW_FORM_GNU_ref_alt
Handle DW_FORM_GNU_ref_alt which references the .debug_info section in the .gnu_debugaltlink file. 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. From-SVN: r268031
This commit is contained in:
parent
9d576782a2
commit
1c2a9a37c6
|
@ -1,3 +1,11 @@
|
|||
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.
|
||||
|
|
|
@ -143,6 +143,8 @@ enum attr_val_encoding
|
|||
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. */
|
||||
|
@ -858,7 +860,7 @@ read_attribute (enum dwarf_form form, struct dwarf_buf *buf,
|
|||
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:
|
||||
{
|
||||
|
@ -2200,6 +2202,19 @@ read_referenced_name_from_attr (struct dwarf_data *ddata, struct unit *u,
|
|||
|| 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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue