[Bug default/26297] Possible misinterpretation of DW_AT_declaration via DW_AT_specification

mark at klomp dot org sourceware-bugzilla@sourceware.org
Thu Jul 23 23:05:21 GMT 2020


https://sourceware.org/bugzilla/show_bug.cgi?id=26297

Mark Wielaard <mark at klomp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mark at klomp dot org

--- Comment #2 from Mark Wielaard <mark at klomp dot org> ---
(In reply to Giuliano Procida from comment #0)
> which concluded that DW_AT_declaration found by following a
> DW_AT_specification should be ignored.
> 
> I coded a naive change that plumbed through a "followed_spec" boolean
> through bits of the DWARF reader and the results were quite startling.
> 
> Please take a look at this and let me know your thoughts.
> 
> https://github.com/myxoid/libabigail/commit/
> fb3b7302a9923b8ee7ca279cc9492207140d886d

I think your analysis is correct, when looking up whether a DIE has the
DW_AT_declaration flag set, it should not follow DW_AT_specification or
DW_AT_abstract_origin attributes.

The patch looks somewhat convoluted though.
Could we fix this by just changing die_is_declaration_only () ?

die_is_declaration_only () calls die_flag_attribute () which uses
die_flag_attribute () which calls dwarf_attr_integrate ().

dwarf_attr_integrate () is what follows the DW_AT_specification to lookup the
attribute.

So I would propose to have a version of die_flag_attribute () that just uses
dwarf_attr () to lookup the flag if the attribute is DW_AT_declaration.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Libabigail mailing list