From: Eli Zaretskii <eliz@gnu.org>
To: Patrick Palka <patrick@parcs.ath.cx>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] [RFC] Discard local stdin events while an attached inferior is running
Date: Tue, 02 Jun 2015 15:12:00 -0000 [thread overview]
Message-ID: <83fv6arvrm.fsf@gnu.org> (raw)
In-Reply-To: <1433252358-26692-1-git-send-email-patrick@parcs.ath.cx>
> From: Patrick Palka <patrick@parcs.ath.cx>
> Cc: Patrick Palka <patrick@parcs.ath.cx>
> Date: Tue, 2 Jun 2015 09:39:18 -0400
>
> This patch attempts to work around an annoying typo that I (and others,
> I assume) commonly make while debugging an attached (not forked)
> process. That is, I sometimes type "continue\n\n" instead of
> "continue\n" when I want to resume the inferior. By doing so, the
> inferior gets resumed and the extraneous "\n" gets buffered. But once
> GDB regains control, the extraneous "\n" gets read and so an empty
> command line is submitted to readline. This is shorthand for running
> the previous command again. So effectively typing "continue\n\n" will
> run "continue" twice. Running "continue" twice instead of once can have
> irreversible consequences to the debugging session and thus is pretty
> annoying to deal with.
>
> To work around this kind of typo, this patch installs a dummy event
> handler that discards all local stdin events that occur when the
> attached inferior is (synchronously) running.
>
> The obvious side-effect of this patch is that dexterous users can no
> longer "queue" commands while an attached inferior is running, e.g.
> type "continue\nprint foo" with the intention of "print foo" being run
> as soon as GDB regains control. I personally don't make use of this
> ability very much.
IMO, this incompatible change of behavior should at least have an
option to get the old behavior back, and that option should possibly
be off by default.
In any case, there should be a NEWS entry and a patch for the manual
which describe this unusual feature.
> Is this typo a common occurrence for anyone else?
Not common, but sometimes. However, I sometimes type ahead future
commands without waiting for the prompt, for example, when I know I'll
need a lot of CR presses.
next prev parent reply other threads:[~2015-06-02 15:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-02 13:39 Patrick Palka
2015-06-02 15:12 ` Eli Zaretskii [this message]
2015-06-02 15:47 ` Patrick Palka
2015-06-02 15:49 ` Andreas Schwab
2015-06-02 16:06 ` Patrick Palka
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=83fv6arvrm.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=patrick@parcs.ath.cx \
/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