From: Tom Tromey <tom@tromey.com>
To: Patrick Monnerat <patrick@monnerat.net>
Cc: Tom Tromey <tom@tromey.com>,
Patrick Monnerat via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH] gdb: add a file event mask parameter to add_file_handler
Date: Wed, 24 Aug 2022 11:26:02 -0600 [thread overview]
Message-ID: <877d2xtuxh.fsf@tromey.com> (raw)
In-Reply-To: <1f5cd3c2-9552-c75a-1add-e3ceebc63e3e@monnerat.net> (Patrick Monnerat's message of "Wed, 24 Aug 2022 17:26:25 +0200")
>> 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> Yes. In Insight, command input from stdin is disabled by setting
main_ui-> input_fd to -1. A later call to register_file_handler from
Patrick> async_enable_stdin causes add_file_handler to be called with fd =
Patrick> -1. Maybe I should add a comment for this.
I took this same approach in my DAP implementation, which is why I
changed gdb to always call the 'ui' methods to manipulate the event
handlers. In my patch I then change these methods to check for the -1
case.
I can submit this bit separately next week.
Or you can do it, it's trivial.
Patrick> I thought so too and did try to use enum_flags! Unfortunately the same
Patrick> int field (file_handler::mask) stores either these bits in case of
Patrick> select use, or a poll mask as defined by the system when poll is used.
Ok, I see.
Tom
next prev parent reply other threads:[~2022-08-24 17:26 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
2022-08-24 15:26 ` Patrick Monnerat via Gdb-patches
2022-08-24 17:26 ` Tom Tromey [this message]
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=877d2xtuxh.fsf@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
--cc=patrick@monnerat.net \
/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