+2020-07-22 Nick Alcock <nick.alcock@oracle.com>
+
+ * ctf-dump.c (ctf_dump_format_type): Emit a warning.
+ (ctf_dump_label): Swallow errors from ctf_dump_format_type.
+ (ctf_dump_objts): Likewise.
+ (ctf_dump_var): Likewise.
+ (ctf_dump_type): Do not emit a duplicate message. Move to
+ ctf_err_warning, and swallow all errors.
+
2020-07-22 Nick Alcock <nick.alcock@oracle.com>
* ctf-decl.c (ctf_decl_fini): Free the cd_buf.
oom:
ctf_set_errno (fp, errno);
err:
+ ctf_err_warn (fp, 1, "Cannot format name dumping type 0x%lx: %s", id,
+ ctf_errmsg (ctf_errno (fp)));
free (buf);
free (str);
free (bit);
CTF_ADD_ROOT)) == NULL)
{
free (str);
- return -1; /* errno is set for us. */
+ return 0; /* Swallow the error. */
}
str = str_append (str, typestr);
CTF_ADD_ROOT)) == NULL)
{
free (str);
- return -1; /* errno is set for us. */
+ return 0; /* Swallow the error. */
}
str = str_append (str, typestr);
CTF_ADD_ROOT)) == NULL)
{
free (str);
- return -1; /* errno is set for us. */
+ return 0; /* Swallow the error. */
}
str = str_append (str, typestr);
size_t len;
if ((str = ctf_dump_format_type (state->cds_fp, id, flag)) == NULL)
- {
- err = "format type";
- goto err;
- }
+ goto err_nomsg; /* Error already logged for us. */
str = str_append (str, "\n");
if ((ctf_type_visit (state->cds_fp, id, ctf_dump_member, &membstate)) < 0)
return 0;
err:
- ctf_dprintf ("Cannot %s dumping type 0x%lx: %s\n", err, id,
- ctf_errmsg (ctf_errno (state->cds_fp)));
+ ctf_err_warn (state->cds_fp, 1, "Cannot %s dumping type 0x%lx: %s",
+ err, id, ctf_errmsg (ctf_errno (state->cds_fp)));
+ err_nomsg:
free (str);
- return -1; /* errno is set for us. */
+ return 0; /* Swallow the error. */
}
/* Dump the string table into the cds_items. */