From: markj Date: Sat, 24 Oct 2015 03:14:36 +0000 (+0000) Subject: DWARF emitted by clang 3.7 encodes array sizes using the DW_AT_count X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=3ef7519b6e055158d1266eb7951bd9a932dcb96c;p=people%2Fliuw%2Ffreebsd.git DWARF emitted by clang 3.7 encodes array sizes using the DW_AT_count attribute rather than DW_AT_upper_bound. Teach ctfconvert about this so that array type sizes are encoded correctly. PR: 203772 MFC after: 1 week --- diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c b/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c index b7cb66fee9a..e439f04616a 100644 --- a/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c +++ b/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c @@ -683,6 +683,10 @@ tdesc_array_create(dwarf_t *dw, Dwarf_Die dim, tdesc_t *arrtdp, ar->ad_nelems = uval + 1; else if (die_signed(dw, dim, DW_AT_upper_bound, &sval, 0)) ar->ad_nelems = sval + 1; + else if (die_unsigned(dw, dim, DW_AT_count, &uval, 0)) + ar->ad_nelems = uval; + else if (die_signed(dw, dim, DW_AT_count, &sval, 0)) + ar->ad_nelems = sval; else ar->ad_nelems = 0;