From: Tom Tromey <tom@tromey.com>
To: Tom Tromey <tom@tromey.com>
Cc: Nick Clifton <nickc@redhat.com>, binutils@sourceware.org
Subject: Re: [PATCH 1/3] Make several more BFD globals thread-local
Date: Fri, 08 Mar 2024 18:12:34 -0700 [thread overview]
Message-ID: <87y1asxl6l.fsf@tromey.com> (raw)
In-Reply-To: <87bk8ljh31.fsf@tromey.com> (Tom Tromey's message of "Mon, 12 Feb 2024 18:20:02 -0700")
>>>>> "Tom" == Tom Tromey <tom@tromey.com> writes:
Tom> What I meant when I wrote the above is that basically there are two sets
Tom> of globals to consider in this patch: the ones related to error emission
Tom> (_bfd_error_internal and error_handler_bfd), and then the other ones
Tom> related to the caching error message code (per_xvec_warn,
Tom> in_check_format).
Tom> I thought that making the latter ones thread-local felt hackish, because
Tom> they could somewhat easily be attributes of a BFD and not globals at
Tom> all.
Tom> I took a stab at some of this tonight and discovered that since
Tom> in_check_format is only used by the error-reporting code, it can be
Tom> combined with the other flag.
Tom> I've appended a rough draft of this.
Tom> I haven't tackled the xvec stuff yet.
I looked into this problem this evening and I found out that the
per-xvec errors are also only used from inside bfd_check_format_matches.
A (thread-local) global would still be needed, because warnings aren't
emitted "per-BFD" -- but it could just replace error_handler_bfd,
leaving just a single global.
I haven't implemented this but I plan to try it soon. This is one of
the issues blocking GDB 15.
Tom> Also I think it'd be good if print_warnmsg re-emitted the errors using
Tom> _bfd_error_handler. This would let gdb print them the way it likes.
Tom> However... that's a change to semantics so I don't know if that's OK or
Tom> whether another error emitter is required. I guess I don't really know
Tom> how to provoke one of these messages and when they would matter. Like,
Tom> I see that ldmain.c installs an error handler -- is it intentional that
Tom> this be bypassed by errors occurring in bfd_check_format_matches?
I'd appreciate some insight into this.
thanks,
Tom
next prev parent reply other threads:[~2024-03-09 1:12 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-30 1:03 [PATCH 0/3] Fix some error-printing issues Tom Tromey
2024-01-30 1:03 ` [PATCH 1/3] Make several more BFD globals thread-local Tom Tromey
2024-02-12 15:28 ` Nick Clifton
2024-02-12 23:52 ` Tom Tromey
2024-02-13 0:35 ` Tom Tromey
2024-02-13 1:20 ` Tom Tromey
2024-03-09 1:12 ` Tom Tromey [this message]
2024-03-09 4:11 ` Alan Modra
2024-03-09 10:31 ` Alan Modra
2024-03-15 0:12 ` Tom Tromey
2024-03-19 20:17 ` Tom Tromey
2024-03-15 1:15 ` Tom Tromey
2024-01-30 1:03 ` [PATCH 2/3] Do not call fputc from _bfd_doprnt Tom Tromey
2024-02-12 15:04 ` Nick Clifton
2024-01-30 1:03 ` [PATCH 3/3] Introduce bfd_print_error function Tom Tromey
2024-02-12 15:04 ` Nick Clifton
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=87y1asxl6l.fsf@tromey.com \
--to=tom@tromey.com \
--cc=binutils@sourceware.org \
--cc=nickc@redhat.com \
/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).