]> xenbits.xensource.com Git - people/liuw/freebsd.git/commitdiff
DWARF emitted by clang 3.7 encodes array sizes using the DW_AT_count
authormarkj <markj@FreeBSD.org>
Sat, 24 Oct 2015 03:14:36 +0000 (03:14 +0000)
committermarkj <markj@FreeBSD.org>
Sat, 24 Oct 2015 03:14:36 +0000 (03:14 +0000)
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

cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c

index b7cb66fee9ab784f9b82a557ce8fc2642522911f..e439f04616af122b54aac977435579f1647554fe 100644 (file)
@@ -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;