From: Ken Brown <kbrown@cornell.edu>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 9767@debbugs.gnu.org
Subject: bug#9767: 24.0.90; gdb initialization on Cygwin
Date: Wed, 19 Oct 2011 16:00:09 -0400 [thread overview]
Message-ID: <4E9F2C49.4060307@cornell.edu> (raw)
In-Reply-To: <E1RFfux-0003wt-EL@fencepost.gnu.org>
On 10/17/2011 1:39 AM, Eli Zaretskii wrote:
>> Date: Sun, 16 Oct 2011 19:08:32 -0400
>> From: Ken Brown<kbrown@cornell.edu>
>>
>> Further info: It seems that initialization is actually completing, but
>> for some reason the buffer is not being redisplayed. To test this, I
>> inserted (sit-for .1) at the end of gdb-update to force redisplay, and
>> that solved the problem. Unless someone who understands redisplay can
>> figure out why redisplay isn't happening on Cygwin, I'm inclined to
>> apply the following patch:
>
> My crystal ball says that redisplay isn't happening because Emacs
> doesn't know that the GDB prompt has arrived. The call to sit-for
> causes Emacs to check its input descriptors, "discovering" that there
> is input.
>
> Please look around in wait_reading_process_output, and see what is
> going on there, before and after the call to sit-for. In particular,
> does the call to `select' report that input has arrived from GDB?
Thanks for the suggestions, Eli. First of all, I was wrong when I said
that the problem was redisplay: using sleep-for instead of sit-for
works just as well. As your crystal ball predicted, the problem is that
emacs hasn't read its input from GDB. Here's what happens:
After M-x gdb finishes its initialization, emacs goes into its command
loop. read_char calls sit_for with a timeout of 30 seconds, and sit_for
calls wait_reading_process_output, which calls select. The call to
select fails immediately with EINTR. I don't understand the command
loop well enough to know what's interrupting the select call. But
select works fine in other settings (such as when I insert sleep-for in
the gdb initialization).
It seems that the problem is not really about M-x gdb, but about the
emacs command loop. I see the same kinds of select failures (always
with EINTR) if I just start up emacs and watch the calls to select
during the command loop.
The code in keyboard.c is full of alarms and timers, presumably related
to polling for keyboard input. Could this polling be doing something
that interrupts the select call under some circumstances?
Ken
next prev parent reply other threads:[~2011-10-19 20:00 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-16 16:02 bug#9767: 24.0.90; gdb initialization on Cygwin Ken Brown
2011-10-16 23:08 ` Ken Brown
2011-10-17 5:39 ` Eli Zaretskii
2011-10-19 20:00 ` Ken Brown [this message]
2011-10-19 20:26 ` Eli Zaretskii
2011-10-19 20:43 ` Ken Brown
2011-10-19 21:03 ` Andreas Schwab
2011-10-19 22:02 ` Eli Zaretskii
2011-10-20 2:11 ` Ken Brown
2011-10-21 20:47 ` Ken Brown
2011-10-21 22:15 ` Eli Zaretskii
2011-10-22 9:51 ` Ken Brown
2011-10-22 20:58 ` Ken Brown
2011-10-23 21:59 ` Ken Brown
2011-10-21 22:24 ` Stefan Monnier
2011-10-22 9:47 ` Ken Brown
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E9F2C49.4060307@cornell.edu \
--to=kbrown@cornell.edu \
--cc=9767@debbugs.gnu.org \
--cc=eliz@gnu.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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).