Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/cddl/osnet/dist/tools/ctf/cvt put back our local fi...



details:   https://anonhg.NetBSD.org/src/rev/d5b63bb95820
branches:  trunk
changeset: 794252:d5b63bb95820
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Mar 09 20:48:01 2014 +0000

description:
put back our local fixes:
- don't die on unresolved types.
- it is ok to have 0 sized arrays in structs
- forward enum decls.

diffstat:

 external/cddl/osnet/dist/tools/ctf/cvt/dwarf.c |  17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diffs (41 lines):

diff -r 4150930cc495 -r d5b63bb95820 external/cddl/osnet/dist/tools/ctf/cvt/dwarf.c
--- a/external/cddl/osnet/dist/tools/ctf/cvt/dwarf.c    Sun Mar 09 20:35:30 2014 +0000
+++ b/external/cddl/osnet/dist/tools/ctf/cvt/dwarf.c    Sun Mar 09 20:48:01 2014 +0000
@@ -817,7 +817,9 @@
 
        debug(3, "die %llu: creating enum\n", off);
 
-       tdp->t_type = ENUM;
+       tdp->t_type = (die_isdecl(dw, die) ? FORWARD : ENUM);
+       if (tdp->t_type != ENUM)
+               return;
 
        (void) die_unsigned(dw, die, DW_AT_byte_size, &uval, DW_ATTR_REQ);
        /* Check for bogus gcc DW_AT_byte_size attribute */
@@ -1137,6 +1139,9 @@
                if (ml->ml_size == 0) {
                        mt = tdesc_basetype(ml->ml_type);
 
+                       if (mt == NULL)
+                               continue;
+
                        if ((ml->ml_size = tdesc_bitsize(mt)) != 0)
                                continue;
 
@@ -1149,6 +1154,16 @@
                        if (mt->t_type == ARRAY && mt->t_ardef->ad_nelems == 0)
                                continue;
 
+                       if (mt->t_type == STRUCT && 
+                               mt->t_members != NULL &&
+                               mt->t_members->ml_type->t_type == ARRAY &&
+                               mt->t_members->ml_type->t_ardef->ad_nelems == 0) {
+                           /* struct with zero sized array */
+                           continue;
+                       }
+
+                       printf("%s unresolved type = %d (%s)\n", tdesc_name(tdp),
+                               mt->t_type, tdesc_name(mt));
                        dw->dw_nunres++;
                        return (1);
                }



Home | Main Index | Thread Index | Old Index