From: Tom Tromey <tom@tromey.com>
To: Aditya Kamath1 <Aditya.Kamath1@ibm.com>
Cc: Tom Tromey <tom@tromey.com>,
"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
Sangamesh Mallayya <sangamesh.swamy@in.ibm.com>
Subject: Re: [PATCH] Fix AIX build break.
Date: Fri, 19 Jan 2024 09:25:02 -0700 [thread overview]
Message-ID: <875xzpmgtd.fsf@tromey.com> (raw)
In-Reply-To: <CH2PR15MB35442EEC5F87A7EF6A89610BD6702@CH2PR15MB3544.namprd15.prod.outlook.com> (Aditya Kamath1's message of "Fri, 19 Jan 2024 11:58:16 +0000")
> The only thing I am unsure of is the utils.c file where we also use
> the deprecated_warning_hook. Should we use an object of
> warning_hook_class there as well?
I'll add some notes inline. I don't think this patch can really work.
> From the experiments I conducted this is true. It is because
> g_complaint_interceptor is a static thread_local variable and not used
> anywhere else we do not see it as an unreferenced symbol in AIX.
Don't be deceived by the 'static' keyword. C++ overloads this. This
variable is in fact extern.
> +static thread_local void (*deprecated_warning_hook) (const char *, va_list);
This is defined in two places. This is confusing at best, but the one
here (in complaints.c) means that warning_hook_class won't interoperate
properly with the other global. This seems very weird.
> +warning_hook_class::warning_hook_class (warning_hook_handler new_handler)
I wouldn't put '_class' in a class name.
It's more normal in gdb to prefix scoped things with "scoped_", but
other choices are possible.
> diff --git a/gdb/utils.c b/gdb/utils.c
> index b326033e9ff..23530c2a41f 100644
> --- a/gdb/utils.c
> +++ b/gdb/utils.c
> @@ -82,6 +82,8 @@
> #include "pager.h"
> #include "run-on-main-thread.h"
> +static thread_local void (*deprecated_warning_hook) (const char *, va_list);
> +
This is static in utils.c now, so it means that nothing else can affect it.
However this changes how the interception works -- it disables it. But,
the reason the interception is done is to avoid emitting warnings from
worker threads.
Tom
next prev parent reply other threads:[~2024-01-19 16:25 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-17 18:28 Aditya Vidyadhar Kamath
2024-01-17 19:25 ` Tom Tromey
2024-01-19 11:58 ` Aditya Kamath1
2024-01-19 16:25 ` Tom Tromey [this message]
2024-01-20 15:03 ` Aditya Kamath1
2024-01-24 0:53 ` Aditya Kamath1
2024-01-25 14:45 ` Aditya Kamath1
2024-01-25 19:53 ` Tom Tromey
2024-01-26 8:37 ` Aditya Kamath1
2024-01-31 0:40 ` Tom Tromey
2024-01-31 9:15 ` Aditya Kamath1
2024-02-01 0:37 ` Tom Tromey
2024-02-01 3:03 ` Aditya Kamath1
2024-02-06 12:36 ` Ciaran Woodward
2024-02-06 14:49 ` Tom Tromey
2024-02-06 15:04 ` Ciaran Woodward
2024-02-06 15:54 ` Aditya Kamath1
-- strict thread matches above, loose matches on Subject: below --
2024-06-09 5:38 Aditya Vidyadhar Kamath
2024-06-09 14:12 ` Simon Marchi
2024-01-12 9:20 Aditya Kamath1
2024-01-12 9:50 ` Tom de Vries
2024-01-12 15:56 ` Tom Tromey
2024-01-16 9:42 ` Aditya Kamath1
2024-01-17 15:09 ` Tom Tromey
2023-08-11 8:49 Aditya Kamath1
2023-08-11 9:43 ` Ulrich Weigand
2023-08-11 9:53 ` Aditya Kamath1
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=875xzpmgtd.fsf@tromey.com \
--to=tom@tromey.com \
--cc=Aditya.Kamath1@ibm.com \
--cc=gdb-patches@sourceware.org \
--cc=sangamesh.swamy@in.ibm.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).