mirror of
git://sourceware.org/git/libabigail.git
synced 2024-12-15 14:34:38 +00:00
ff8cba872e
This is about supporting an Ada-induced DWARF construct related to ranged types. To reproduce the issue this patch originated from, you can type: $ fedabipkgdiff --self-compare -a --from fc37 gprbuild From that gprbuild package from fc37, consider this subrange_type DIE coming from the debuginfo file prtests/gprbuild-2020-11.fc37.aarch64: 1 [ 3c10d] subrange_type abbrev: 34 2 type (ref_addr) [ 6191e] 3 lower_bound (sdata) 2 4 upper_bound (ref_udata) [ 3c0eb] At line 4, look at how the DW_AT_upper_bound attribute is a reference to another DIE, instead of being a (signed) constant value, like the DW_AT_lower_bound attribute at line 3. The referenced DIE is at offset 0x3c0eb. How do we get the actual value of the upper_bound of that subrange type? To answer that question, let's look at the DIE, at offset 0x3c0eb that is referenced by the DW_AT_upper_bound attribute at line 4: 1 [ 3c0eb] member abbrev: 87 2 name (strp) "last" 3 decl_file (data1) a-coinve.ads (35) 4 decl_line (data2) 415 5 decl_column (data1) 24 6 type (ref_udata) [ 3c0f7] It's a data member which type is referenced at line 6. Let's look at that type, which offset is 0x3c0f7: 1 [ 3c0f7] subrange_type abbrev: 122 2 upper_bound (sdata) 99999999 3 name (strp) "gpr__names__name_vectors__T449bXn" 4 type (ref_addr) [ 6191e] 5 artificial (flag_present) yes That type is a DW_TAG_subrange_type and its DW_AT_upper_bound value is a constant. Finally. Actually, the value of DW_AT_upper_bound of this DIE at offset 0x3c0f7 is the value of the DW_AT_upper_bound of the subrange_type DIE at offset 0x3c10d that we were initially looking for. The DIE at 0x3c0f7 is said to be indirectly referenced by the DIE at 0x3c10d, through its DW_AT_upper_bound attribute. This patch supports retrieving the value of the DW_AT_upper_bound of 0x3c10d through the 0x3c0f7 DIE that it indirectly references. The package gprbuild from fc37 now passes self comparison with this patch. * src/abg-dwarf-reader.cc (subrange_die_indirect_bound_value) (subrange_die_indirectly_references_subrange_die): Define new static function. (build_subrange_type): If the value of DW_AT_upper_bound is not a constant, try to consider it as an indirect reference to a DW_TAG_subrange_type DIE, whose DW_AT_upper_bound might carry the constant value that we are looking for. Signed-off-by: Dodji Seketeli <dodji@redhat.com> |
||
---|---|---|
.. | ||
abg-btf-reader.cc | ||
abg-comp-filter.cc | ||
abg-comparison-priv.h | ||
abg-comparison.cc | ||
abg-config.cc | ||
abg-corpus-priv.h | ||
abg-corpus.cc | ||
abg-ctf-reader.cc | ||
abg-default-reporter.cc | ||
abg-diff-utils.cc | ||
abg-dwarf-reader.cc | ||
abg-elf-based-reader.cc | ||
abg-elf-helpers.cc | ||
abg-elf-helpers.h | ||
abg-elf-reader.cc | ||
abg-fe-iface.cc | ||
abg-hash.cc | ||
abg-ini.cc | ||
abg-internal.h | ||
abg-ir-priv.h | ||
abg-ir.cc | ||
abg-leaf-reporter.cc | ||
abg-libxml-utils.cc | ||
abg-reader.cc | ||
abg-regex.cc | ||
abg-reporter-priv.cc | ||
abg-reporter-priv.h | ||
abg-suppression-priv.h | ||
abg-suppression.cc | ||
abg-symtab-reader.cc | ||
abg-symtab-reader.h | ||
abg-tools-utils.cc | ||
abg-traverse.cc | ||
abg-viz-common.cc | ||
abg-viz-dot.cc | ||
abg-viz-svg.cc | ||
abg-workers.cc | ||
abg-writer.cc | ||
Makefile.am |