From: Nick Alcock <nix@sourceware.org>
To: binutils-cvs@sourceware.org
Subject: [binutils-gdb] libctf: improve handling of type dumping errors
Date: Fri, 19 Apr 2024 15:52:10 +0000 (GMT) [thread overview]
Message-ID: <20240419155210.929043849AE1@sourceware.org> (raw)
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0ebf1bdeeda1612dbe8e092dca765527a741e462
commit 0ebf1bdeeda1612dbe8e092dca765527a741e462
Author: Nick Alcock <nick.alcock@oracle.com>
Date: Tue Apr 2 13:48:13 2024 +0100
libctf: improve handling of type dumping errors
When dumping a type fails with an error, we want to emit a warning noting
this: a warning because it's not fatal and we can continue. But warnings
don't automatically print out the ctf_errno (because not all cases causing
warnings set the errno at all), so we must do it at warning-emission time or
lose track of what's gone wrong.
libctf/
* ctf-dump.c (ctf_dump_format_type): Dump the underlying error on
type dump failure.
Diff:
---
libctf/ctf-dump.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libctf/ctf-dump.c b/libctf/ctf-dump.c
index 2213d09dc29..80a3b265297 100644
--- a/libctf/ctf-dump.c
+++ b/libctf/ctf-dump.c
@@ -239,7 +239,8 @@ ctf_dump_format_type (ctf_dict_t *fp, ctf_id_t id, int flag)
oom:
ctf_set_errno (fp, errno);
err:
- ctf_err_warn (fp, 1, 0, _("cannot format name dumping type 0x%lx"), id);
+ ctf_err_warn (fp, 1, ctf_errno (fp), _("cannot format name dumping type 0x%lx"),
+ id);
free (buf);
free (str);
free (bit);
reply other threads:[~2024-04-19 15:52 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240419155210.929043849AE1@sourceware.org \
--to=nix@sourceware.org \
--cc=binutils-cvs@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).