typeE.cuOff = posn;
typeE.tag = Te_TyStOrUn;
typeE.Te.TyStOrUn.name = NULL;
+ typeE.Te.TyStOrUn.typeR = D3_INVALID_CUOFF;
typeE.Te.TyStOrUn.fieldRs
= VG_(newXA)( ML_(dinfo_zalloc), "di.readdwarf3.pTD.struct_type.1",
ML_(dinfo_free),
if (attr == DW_AT_specification && cts.szB > 0 && cts.u.val > 0) {
is_spec = True;
}
+ if (attr == DW_AT_signature && form == DW_FORM_ref_sig8
+ && cts.szB > 0) {
+ have_szB = True;
+ typeE.Te.TyStOrUn.szB = 8;
+ typeE.Te.TyStOrUn.typeR
+ = cook_die_using_form( cc, (UWord)cts.u.val, form );
+ }
}
/* Do we have something that looks sane? */
if (is_decl && (!is_spec)) {
PtrdiffT offMin = 0, offMax1 = 0;
if (!ty->Te.TyStOrUn.isStruct) goto done;
fieldRs = ty->Te.TyStOrUn.fieldRs;
- if ((!fieldRs) || VG_(sizeXA)(fieldRs) == 0) goto done;
+ if (((!fieldRs) || VG_(sizeXA)(fieldRs) == 0)
+ && (ty->Te.TyStOrUn.typeR == 0)) goto done;
for (i = 0; i < VG_(sizeXA)( fieldRs ); i++ ) {
fieldR = *(UWord*)VG_(indexXA)( fieldRs, i );
field = ML_(TyEnts__index_by_cuOff)(tyents, NULL, fieldR);
}
/* Did we find a suitable field? */
vg_assert(i >= 0 && i <= VG_(sizeXA)( fieldRs ));
- if (i == VG_(sizeXA)( fieldRs ))
- goto done; /* No. Give up. */
+ if (i == VG_(sizeXA)( fieldRs )) {
+ ty = ML_(TyEnts__index_by_cuOff)(tyents, NULL,
+ ty->Te.TyStOrUn.typeR);
+ vg_assert(ty);
+ if (ty->tag == Te_UNKNOWN) goto done;
+ vg_assert(ML_(TyEnt__is_type)(ty));
+ continue;
+ }
/* Yes. 'field' is it. */
vg_assert(field);
if (!field->Te.Field.name) goto done;