type->set_code (TYPE_CODE_STRUCT);
type->set_length (ctf_type_size (dict, tid));
- set_type_align (type, ctf_type_align (dict, tid));
+
+ if (ssize_t align = ctf_type_align (dict, tid);
+ align >= 0)
+ set_type_align (type, align);
+ else
+ complaint (_("ctf_type_align read_structure_type failed - %s"),
+ ctf_errmsg (ctf_errno (dict)));
+
return set_tid_type (objfile, tid, type);
}
}
rettype = fetch_tid_type (ccp, cfi.ctc_return);
type->set_target_type (rettype);
- set_type_align (type, ctf_type_align (dict, tid));
+
+ if (ssize_t align = ctf_type_align (dict, tid);
+ align >= 0)
+ set_type_align (type, align);
+ else
+ complaint (_("ctf_type_align read_func_kind_type failed - %s"),
+ ctf_errmsg (ctf_errno (dict)));
/* Set up function's arguments. */
argc = cfi.ctc_argc;
type->set_length (ctf_type_size (dict, tid));
/* Set the underlying type based on its ctf_type_size bits. */
type->set_target_type (objfile_int_type (objfile, type->length (), false));
- set_type_align (type, ctf_type_align (dict, tid));
+
+ if (ssize_t align = ctf_type_align (dict, tid);
+ align >= 0)
+ set_type_align (type, align);
+ else
+ complaint (_("ctf_type_align read_enum_type failed - %s"),
+ ctf_errmsg (ctf_errno (dict)));
return set_tid_type (objfile, tid, type);
}
else
type->set_length (ctf_type_size (dict, tid));
- set_type_align (type, ctf_type_align (dict, tid));
+ if (ssize_t align = ctf_type_align (dict, tid);
+ align >= 0)
+ set_type_align (type, align);
+ else
+ complaint (_("ctf_type_align read_array_type failed - %s"),
+ ctf_errmsg (ctf_errno (dict)));
return set_tid_type (objfile, tid, type);
}
}
type = lookup_pointer_type (target_type);
- set_type_align (type, ctf_type_align (ccp->dict, tid));
+
+ if (ssize_t align = ctf_type_align (ccp->dict, tid);
+ align >= 0)
+ set_type_align (type, align);
+ else
+ complaint (_("ctf_type_align read_pointer_type failed - %s"),
+ ctf_errmsg (ctf_errno (ccp->dict)));
return set_tid_type (objfile, tid, type);
}