Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 2/2] gdb: remove complaint_interceptor::g_complaint_interceptor
Date: Thu, 21 May 2026 13:51:37 -0400	[thread overview]
Message-ID: <3463c605-01ed-447b-8019-e311826a5d64@polymtl.ca> (raw)
In-Reply-To: <877bowal22.fsf@tromey.com>

On 5/21/26 10:34 AM, Tom Tromey wrote:
>>>>>> "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>

Thanks, pushed both patches.

> 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.

I'm afraid I don't understand your suggestion.

> OTOH I don't think we should spend any more time on complaints than is
> strictly necessary.

Agreed.

Simon

  reply	other threads:[~2026-05-21 17:52 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
2026-05-21 17:51     ` Simon Marchi [this message]
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=3463c605-01ed-447b-8019-e311826a5d64@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.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