From: Simon Marchi <simon.marchi@polymtl.ca>
To: Andrew Burgess <aburgess@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb: unbuffer all input streams when not using readline
Date: Tue, 18 Jan 2022 12:57:47 -0500 [thread overview]
Message-ID: <e097a8f3-db2e-68b1-652c-98ab9a61e098@polymtl.ca> (raw)
In-Reply-To: <20220118170913.GH622389@redhat.com>
>> How difficult would it be to just have different behaviors on Windows,
>>
>> opening the stream only once, vs Linux, opening three streams?
>
> I think it would be easy enough to implement new-ui differently for
> unix vs for windows.
>
> But, if I've left you with the impression that this is a possible
> solution, then I failed with my commit message. Even on Linux, when
> we're not using new-ui at all, we currently can loose commands unless
> we switch to unbuffered input.
No, you did mention it, my bad.
> Another option; maybe there's some ioctl that can be used to tell the
> kernel that a newline at the start of a read request should be
> considered a line break. However, if such an ioctl exits, I've failed
> to find it.
>
> The final option that I considered is to place glibc into unbuffered
> mode, and then do the buffering ourselves within gdb. This obviously
> adds a load more complexity which is why I'd rather not do this.
>
> But, if we did do this, then at the end of
> gdb_readline_no_editing_callback we could set the flag
> call_stdin_event_handler_again_p, and things would "just work".
Yes, I think that would make sense. Instead of using
call_stdin_event_handler_again_p, I would use a event in the event loop
(using create_async_event_handler) for that. That means we go back to
the event loop, so it's fair for the other event sources, versus
call_stdin_event_handler_again_p which is a tight loop.
> I can take a look at gathering some performance figures for sure and
> will update once I have some data, but this patch is fixing an
> existing bug...
Yeah, so I am in favor of merging this patch and then looking if
re-enabling some buffering is desirable. The important thing is the
test that you had, which will hopefully prevent introducing a similar
bug.
Simon
next prev parent reply other threads:[~2022-01-18 17:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-17 16:40 Andrew Burgess
2022-01-18 16:26 ` Simon Marchi
2022-01-18 17:09 ` Andrew Burgess
2022-01-18 17:57 ` Simon Marchi [this message]
2022-01-18 18:09 ` Andrew Burgess
2022-01-18 18:59 ` Tom Tromey
2022-02-02 16:23 ` Andrew Burgess
2022-02-07 10:27 ` Andrew Burgess
2022-01-18 18:52 ` 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=e097a8f3-db2e-68b1-652c-98ab9a61e098@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--cc=aburgess@redhat.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).