Follow DW_AT_specification when looking up DW_AT_type attributes.
authormarkj <markj@FreeBSD.org>
Wed, 28 Dec 2016 21:54:33 +0000 (21:54 +0000)
committermarkj <markj@FreeBSD.org>
Wed, 28 Dec 2016 21:54:33 +0000 (21:54 +0000)
commitdfe2deb992a00b3216c2232b518a9fe55db7b18f
tree4d966719bc0b45a88d7521c0a58223fc7b996f5a
parentf915a7d38a206ff2480884754a2fabdf7ad99dad
Follow DW_AT_specification when looking up DW_AT_type attributes.

dwarf_attrval_*() will search the parent DIE referenced by a
DW_AT_abstract_origin attribute for the value of the DW_AT_type attribute.
Do the same thing for the DW_AT_specification attributes in variable
definitions emitted by GCC 6.2, and ensure that we return an error rather
than crashing if neither DW_AT_abstract_origin or DW_AT_specification is
found when looking for the value of the DW_AT_type attribute.

PR: 215350, 215395
Reviewed by: emaste
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D8920
contrib/elftoolchain/libdwarf/dwarf_attrval.c
contrib/elftoolchain/libdwarf/dwarf_attrval_signed.3