* [binutils-gdb] libctf: improve handling of type dumping errors
@ 2024-04-19 15:52 Nick Alcock
0 siblings, 0 replies; only message in thread
From: Nick Alcock @ 2024-04-19 15:52 UTC (permalink / raw)
To: binutils-cvs
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);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-04-19 15:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-19 15:52 [binutils-gdb] libctf: improve handling of type dumping errors Nick Alcock
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).