Fix the decoding of DW_FORM_ref_addr DWARF attribute.
authorNick Clifton <nickc@redhat.com>
Tue, 27 Oct 2020 16:17:13 +0000 (16:17 +0000)
committerNick Clifton <nickc@redhat.com>
Tue, 27 Oct 2020 16:17:13 +0000 (16:17 +0000)
commitbcd213b2cfbca2df53fb7e5d187fd67ea8eb7185
treeebdc8f30b288ada5dcedaf33484ce2fc9272b958
parent7f40ce1a9ea16720b9e9199a20173ed29285da9a
Fix the decoding of DW_FORM_ref_addr DWARF attribute.

* dwarf.c (struct abbrev_list): New structure.  Used to collect
lists of abbreviation sets.
(struct abbrev_map): New structure.  Used to map CU offsets to
abbreviation offsets.
(record_abbrev_list): New function.  A new entry to an
abbreviation list.
(free_all_abbrevs): Update to free abbreviation lists.
(new_abbrev_list): New function.  Start a new abbreviation
list.
(find_abbrev_list_by_abbrev_offset): New function.
(find_abbrev_map_by_offset): New function.
(add_abbrev): Add abbrev_list parameter.
(add_abbrev_attr): Likewise.
(process_abbrev_section): Rename to process_abbrev_set and add
list parameter.
(get_type_abbrev_from_form): New function.  Attempts to decode the
forms used by DW_AT_type attributes.
(get_type_signedness): Display type names if operating in wide
mode.  Use get_type_abbrev_from_form.
(read_and_display_attr_value): Use get_type_abbrev_from_form.
(process_debug_info): Pre-parse the CU headers to collate all the
abbrevs before starting the main scan.
(process_debug_abbrev): Do not free any loaded abbrevs.
(free_debug_memory): Free the abbrev maps.
binutils/ChangeLog
binutils/dwarf.c