readelf: Decode DW_AT_discr_list block attributes.

Decode DW_AT_descr_list blocks using the DW_DSC values.
This requires knowing the signedness of the discriminant.
Which means the attr_callback function needs access to the
parent DIE. Pass the whole DIE path, plus the current level.
That way the type of the discriminant can be looked up in
the variant_part (parent) DIE of the variant DIE (which has
the discr_list attribute).

Add a testcase using both signed and unsigned discriminants.

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

Signed-off-by: Mark Wielaard <mark@klomp.org>
7 files changed