From: Tom Tromey <tom@tromey.com>
To: Patrick Monnerat via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH] gdb: add a file event mask parameter to add_file_handler
Date: Tue, 23 Aug 2022 13:09:33 -0600 [thread overview]
Message-ID: <874jy2dbf6.fsf@tromey.com> (raw)
In-Reply-To: <20220819174601.144876-1-patrick@monnerat.net> (Patrick Monnerat via Gdb-patches's message of "Fri, 19 Aug 2022 19:46:01 +0200")
>>>>> "Patrick" == Patrick Monnerat via Gdb-patches <gdb-patches@sourceware.org> writes:
Thanks for the patch.
Patrick> +#if defined(POLLRDHUP)
Space before the '('.
Patrick> void
Patrick> add_file_handler (int fd, handler_func *proc, gdb_client_data client_data,
Patrick> - std::string &&name, bool is_ui)
Patrick> + std::string &&name, bool is_ui, int mask)
Patrick> {
Patrick> + if (fd < 0 || (mask & (GDB_READABLE | GDB_WRITABLE | GDB_EXCEPTION)) == 0)
Patrick> + return;
Is there ever a situation where this can happen and it is not a bug in
the caller? I am wondering if this ought to be an assert instead.
Patrick> +/* Tell add_file_handler what events we are interested in. */
Patrick> +
Patrick> +#define GDB_READABLE (1<<1)
Patrick> +#define GDB_WRITABLE (1<<2)
Patrick> +#define GDB_EXCEPTION (1<<3)
I tend to think it would be better to use enum_flags here.
Tom
next prev parent reply other threads:[~2022-08-23 19:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-19 17:46 Patrick Monnerat via Gdb-patches
2022-08-23 19:09 ` Tom Tromey [this message]
2022-08-24 15:26 ` Patrick Monnerat via Gdb-patches
2022-08-24 17:26 ` Tom Tromey
2022-08-30 17:34 ` Tom Tromey via Gdb-patches
2022-08-31 10:47 ` Patrick Monnerat via Gdb-patches
2022-08-31 16:51 ` Tom Tromey via Gdb-patches
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=874jy2dbf6.fsf@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
/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