]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
libctf, dump: migrate towards dumping errors rather than truncation
authorNick Alcock <nick.alcock@oracle.com>
Thu, 4 Jun 2020 14:38:26 +0000 (15:38 +0100)
committerNick Alcock <nick.alcock@oracle.com>
Wed, 22 Jul 2020 17:02:17 +0000 (18:02 +0100)
commit8e795b46f58d9cd80b8831ea24f56f1433b8f50b
treeb57b95ca12bc54c3de0ac90d58e3bdf3f7fa772a
parentb255b35feb80ecf096825395e01bccd34ee02b2b
libctf, dump: migrate towards dumping errors rather than truncation

If we get an error emitting a single type, variable, or label, right now
we emit the error into the ctf_dprintf stream and propagate the error
all the way up the stack, causing the entire output to be silently
truncated (unless libctf debugging is on).

Instead, emit an error and keep going.  (This makes sense for this use
case: if you're dumping types and a type is corrupted, you want to
know!)

Not all instances of this are fixed in this commit, only ones associated
with type formatting: more fixes will come.

libctf/
* 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.
libctf/ChangeLog
libctf/ctf-dump.c