From: Christian Biesinger <cbiesinger@google.com>
To: Simon Marchi <simon.marchi@polymtl.ca>
Cc: gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Fix cygwin build error
Date: Tue, 16 Mar 2021 16:50:34 +0100 [thread overview]
Message-ID: <CAPTJ0XGSjhbjMesXA8P0DHiJHs4ykbLoZ6RjfjHX9MbyJfuHFg@mail.gmail.com> (raw)
In-Reply-To: <690ca44a-8086-3a76-b783-ffd4eabfc042@polymtl.ca>
On Mon, Mar 15, 2021 at 5:47 PM Simon Marchi <simon.marchi@polymtl.ca> wrote:
> On 2021-03-15 9:35 a.m., Christian Biesinger via Gdb-patches wrote:
> > With "gcc version 10.2.0 (GCC)" on cygwin, I get this build error:
> > CXX windows-nat.o
> > In file included from ../../gdb/../gdbsupport/common-defs.h:129,
> > from ../../gdb/defs.h:28,
> > from ../../gdb/windows-nat.c:24:
> > ../../gdb/windows-nat.c: In function ‘void windows_init_thread_list()’:
> > ../../gdb/windows-nat.c:513:17: error: zero-length gnu_printf format string [-Werror=format-zero-length]
> > 513 | DEBUG_EVENTS ("");
> > | ^~
> > ../../gdb/../gdbsupport/common-debug.h:65:43: note: in definition of macro ‘debug_prefixed_printf_cond’
> > 65 | debug_prefixed_printf (module, __func__, fmt, ##__VA_ARGS__); \
> > | ^~~
> > ../../gdb/windows-nat.c:513:3: note: in expansion of macro ‘DEBUG_EVENTS’
> > 513 | DEBUG_EVENTS ("");
> > | ^~~~~~~~~~~~
> > cc1plus: all warnings being treated as errors
> >
> > This was introduced in 4ef367bffd73d50002339deba40983530ccb9d15, which removed
> > the function name from this debug message:
> > - DEBUG_EVENTS (("gdb: windows_init_thread_list\n"));
> > + DEBUG_EVENTS ("");
> >
> > This patch just restores the function name. This will probably be easier to
> > understand as well.
> >
> > gdb/ChangeLog:
> >
> > 2021-03-15 Christian Biesinger <cbiesinger@google.com>
> >
> > * windows-nat.c (windows_init_thread_list): Add function name to
> > debug log.
> > ---
> > gdb/windows-nat.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
> > index 8f6fb3ddcdf..269c41a3097 100644
> > --- a/gdb/windows-nat.c
> > +++ b/gdb/windows-nat.c
> > @@ -510,7 +510,7 @@ windows_add_thread (ptid_t ptid, HANDLE h, void *tlb, bool main_thread_p)
> > static void
> > windows_init_thread_list (void)
> > {
> > - DEBUG_EVENTS ("");
> > + DEBUG_EVENTS ("windows_init_thread_list");
> > init_thread_list ();
> >
> > for (windows_thread_info *here : thread_list)
> >
>
> The function name is already included by debug_prefixed_printf_cond, so
> this will appear as
>
> windows_init_thread_list: windows_init_thread_list
>
> What I've used so far for debug prints that just want to say that a
> given function gets called is "called", I suggest you use that:
>
> DEBUG_EVENTS ("called");
>
> This is ok to push either way.
Thank you, I pushed this with that change & a corresponding update to
the commit message.
Christian
prev parent reply other threads:[~2021-03-16 15:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-15 13:35 Christian Biesinger
2021-03-15 16:47 ` Simon Marchi
2021-03-16 15:50 ` Christian Biesinger [this message]
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=CAPTJ0XGSjhbjMesXA8P0DHiJHs4ykbLoZ6RjfjHX9MbyJfuHFg@mail.gmail.com \
--to=cbiesinger@google.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).