From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ken Brown Newsgroups: gmane.emacs.bugs Subject: bug#9767: 24.0.90; gdb initialization on Cygwin Date: Wed, 19 Oct 2011 16:00:09 -0400 Message-ID: <4E9F2C49.4060307@cornell.edu> References: <4E9B0033.2070506@cornell.edu> <4E9B63F0.5040409@cornell.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1319054473 15283 80.91.229.12 (19 Oct 2011 20:01:13 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 19 Oct 2011 20:01:13 +0000 (UTC) Cc: 9767@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 19 22:01:09 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RGcK2-0004SD-8u for geb-bug-gnu-emacs@m.gmane.org; Wed, 19 Oct 2011 22:01:06 +0200 Original-Received: from localhost ([::1]:57048 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGcK1-00029R-G8 for geb-bug-gnu-emacs@m.gmane.org; Wed, 19 Oct 2011 16:01:05 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:57415) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGcJw-000297-GB for bug-gnu-emacs@gnu.org; Wed, 19 Oct 2011 16:01:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RGcJv-0001w0-3R for bug-gnu-emacs@gnu.org; Wed, 19 Oct 2011 16:01:00 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33283) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGcJu-0001vn-T9 for bug-gnu-emacs@gnu.org; Wed, 19 Oct 2011 16:00:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1RGcKv-0002gm-V5 for bug-gnu-emacs@gnu.org; Wed, 19 Oct 2011 16:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ken Brown Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Oct 2011 20:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9767 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 9767-submit@debbugs.gnu.org id=B9767.131905448210289 (code B ref 9767); Wed, 19 Oct 2011 20:02:01 +0000 Original-Received: (at 9767) by debbugs.gnu.org; 19 Oct 2011 20:01:22 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RGcKG-0002fr-KH for submit@debbugs.gnu.org; Wed, 19 Oct 2011 16:01:21 -0400 Original-Received: from granite1.mail.cornell.edu ([128.253.83.141] helo=authusersmtp.mail.cornell.edu) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RGcKB-0002fg-LR for 9767@debbugs.gnu.org; Wed, 19 Oct 2011 16:01:18 -0400 Original-Received: from [128.84.234.241] (dhcp241.math.cornell.edu [128.84.234.241]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id p9JK09Xm004155 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 19 Oct 2011 16:00:10 -0400 (EDT) User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 19 Oct 2011 16:02:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:52871 Archived-At: On 10/17/2011 1:39 AM, Eli Zaretskii wrote: >> Date: Sun, 16 Oct 2011 19:08:32 -0400 >> From: Ken Brown >> >> 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