binutils-gdb/readline
Andrew Burgess 8f3babfaf8 gdb/readline: fix extra 'quit' message problem
After these two commits:

  commit 4fb7bc4b14
  Date:   Mon Mar 7 13:49:21 2022 +0000

      readline: back-port changes needed to properly detect EOF

  commit 91395d97d9
  Date:   Tue Feb 15 17:28:03 2022 +0000

      gdb: handle bracketed-paste-mode and EOF correctly

It was observed that, if a previous command is selected at the
readline prompt using the up arrow key, then when the command is
accepted (by pressing return) an unexpected 'quit' message will be
printed by GDB.  Here's an example session:

  (gdb) p 123
  $1 = 123
  (gdb) p 123
  quit
  $2 = 123
  (gdb)

In this session the second 'p 123' was entered not by typing 'p 123',
but by pressing the up arrow key to select the previous command.  It
is important that the up arrow key is used, typing Ctrl-p will not
trigger the bug.

The problem here appears to be readline's EOF detection when handling
multi-character input sequences.  I have raised this issue on the
readline mailing list here:

  https://lists.gnu.org/archive/html/bug-readline/2022-04/msg00012.html

a solution has been proposed here:

  https://lists.gnu.org/archive/html/bug-readline/2022-04/msg00016.html

This patch includes a test for this issue as well as a back-port of
(the important bits of) readline commit:

  commit 2ef9cec8c48ab1ae3a16b1874a49bd1f58eaaca1
  Date:   Wed May 4 11:18:04 2022 -0400

      fix for setting RL_STATE_EOF in callback mode

That commit also includes some updates to the readline documentation
and tests that I have not included in this commit.

With this commit in place the unexpected 'quit' messages are resolved.
2022-05-07 10:49:27 +01:00
..
readline
.gitignore
aclocal.m4
ChangeLog
configure
configure.ac
Makefile.am
Makefile.in
README

This is an import of readline that is used by gdb.

To send patches, follow the gdb patch submission instructions in
../gdb/CONTRIBUTE.  For maintainers, see ../gdb/MAINTAINERS.

If you need to patch readline, please document the changes here.

To import, copy the upstream readline sources into the "readline"
subdirectory, remembering to (1) remove any files that were deleted
upstream, and (2) merge the one small configure.ac patch that gdb
carries.

If your import removes the need for a local patch, please remember to
update this file.

Individual upstream readline patches can be directly imported using
"git am".  You can see the current patch level by looking at
readline/patchlevel.