From: Tom Tromey <tom@tromey.com>
To: simon.marchi@polymtl.ca
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 2/2] gdb: remove complaint_interceptor::g_complaint_interceptor
Date: Thu, 21 May 2026 08:34:13 -0600 [thread overview]
Message-ID: <877bowal22.fsf@tromey.com> (raw)
In-Reply-To: <20260521040112.1618748-2-simon.marchi@polymtl.ca> (simon marchi's message of "Thu, 21 May 2026 00:00:49 -0400")
>>>>> "Simon" == simon marchi <simon.marchi@polymtl.ca> writes:
Simon> From: Simon Marchi <simon.marchi@polymtl.ca>
Simon> The thread_local g_complaint_interceptor pointer is unnecessary. The
Simon> complaint_interceptor constructor registers itself as the warning hook
Simon> via m_saved_warning_hook (this), so when complaint_internal dispatches
Simon> through the warning hook, it lands in complaint_interceptor::warn with
Simon> 'this' already pointing at the registered interceptor. Inside warn,
Simon> g_complaint_interceptor and 'this' always refer to the same object.
Simon> Replace g_complaint_interceptor->m_complaints with m_complaints in
Simon> complaint_interceptor::warn and remove g_complaint_interceptor.
Ok.
Approved-By: Tom Tromey <tom@tromey.com>
I don't remember the code too well but I do wonder if we should just
have each set of complaints be completely independent and emit them all
at some spot guaranteed to be on the main thread. Like, instead of
'complaint' function, only expose a method on some object.
OTOH I don't think we should spend any more time on complaints than is
strictly necessary.
Tom
next prev parent reply other threads:[~2026-05-21 14:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-21 4:00 [PATCH 1/2] gdb: lock complaint_mutex in clear_complaints simon.marchi
2026-05-21 4:00 ` [PATCH 2/2] gdb: remove complaint_interceptor::g_complaint_interceptor simon.marchi
2026-05-21 14:34 ` Tom Tromey [this message]
2026-05-21 17:51 ` Simon Marchi
2026-05-21 14:25 ` [PATCH 1/2] gdb: lock complaint_mutex in clear_complaints Tom Tromey
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=877bowal22.fsf@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@polymtl.ca \
/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