Subject: bin/23107: Can't ^D out of GDB 5.3+libedit
To: None <email@example.com>
From: None <firstname.lastname@example.org>
Date: 10/08/2003 18:46:38
>Synopsis: Can't ^D out of GDB 5.3+libedit
>Arrival-Date: Wed Oct 08 22:47:00 UTC 2003
>Originator: Nathan J. Williams
>Release: NetBSD 1.6ZC
Wasabi Systems, Inc.
System: NetBSD marvin-the-martian.stuartst.com 1.6ZC NetBSD 1.6ZC (MARVIN) #67: Mon Sep 29 14:29:10 EDT 2003 email@example.com:/nbsd/src/sys/arch/i386/compile/MARVIN i386
GDB 5.3 built against libedit rather than GNU readline fails
to exit if EOF (control-D) is typed at a blank prompt. The user must
GNU gdb 5.3nb1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386--netbsdelf".
... notice that nothing happens ...
I believe the problem is in libedit's implementation of
rl_callback_read_char(), which simply returns when it encounters an
EOF character. GDB expects the GNU readline behavior of calling thee
callback with a NULL buffer:
- Function: void rl_callback_read_char (void)
Whenever an application determines that keyboard input is
available, it should call `rl_callback_read_char()', which will
read the next character from the current input source. If that
character completes the line, `rl_callback_read_char' will invoke
the LHANDLER function saved by `rl_callback_handler_install' to
process the line. `EOF' is indicated by calling LHANDLER with a