Subject: bug#6623: GDB does not response until extra keyborad input

From: Le Stern <[email-masked]>
Date: Tue, 13 Jul 2010 14:00:26 +0800

I encounter the problem for a long time on emacs repo trunk, is this a bug?

./emacs -Q
M-x gdb
=> gdb -i=mi

after above action, the display is  ...

GNU gdb (GDB) 7.1
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.

-111:**--F1  *gud*          Bot L11    (Debugger:run
[initializing...])---------

=== the state of gud is initializing instead of ready. after input enter key
the state will change into ready.

the backtrace =>

(gdb) bt
#0  0x0000003769ecb053 in __select_nocancel () from /lib64/libc.so.6
#1  0x00000000004cf1fc in xg_select (max_fds=<value optimized out>,
rfds=0x7fff8fb49240, wfds=0x0, efds=0x0, timeout=0x7fff8$
#2  0x000000000058fd5f in wait_reading_process_output (time_limit=30,
microsecs=0, read_kbd=-1, do_display=1, wait_for_cell=$
#3  0x0000000000415a08 in sit_for (timeout=120, reading=1, do_display=1) at
~/emacs/trunk/src/dispnew.c:6059
#4  0x00000000004ee85a in read_char (commandflag=1, nmaps=3,
maps=0x7fff8fb49800, prev_event=11611746, used_mouse_menu=0x7ff$
#5  0x00000000004efd78 in read_key_sequence (keybuf=0x7fff8fb49a20,
bufsize=30, prompt=11611746, dont_downcase_last=0, can_r$
#6  0x00000000004f203f in command_loop_1 () at
~/emacs/trunk/src/keyboard.c:1618
#7  0x0000000000550250 in internal_condition_case (bfun=0x4f1e90
<command_loop_1>, handlers=11663554, hfun=0x4ec430 <cmd_err$
#8  0x00000000004ec0aa in command_loop_2 (ignore=<value optimized out>) at
~/emacs/trunk/src/keyboard.c:1341
#9  0x0000000000550347 in internal_catch (tag=<value optimized out>,
func=0x4ec090 <command_loop_2>, arg=11611746) at ~/emac$
#10 0x00000000004ec263 in command_loop () at
~/emacs/trunk/src/keyboard.c:1320
#11 0x00000000004ec608 in recursive_edit_1 () at
~/emacs/trunk/src/keyboard.c:943
#12 0x00000000004ec75f in Frecursive_edit () at
~/emacs/trunk/src/keyboard.c:1005
#13 0x00000000004dff4b in main (argc=<value optimized out>,
argv=0x7fff8fb4a2f8) at ~/emacs/trunk/src/emacs.c:1778