X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; q=dns; s= default; b=Cb31SZuTWlUPBTG1JKHk64vZXTmRLSV+vtcz0ZL7dqdjhduFzWLBW vKv7jrps18TUcgSReTOqqfLINV2MG3HlxEAnBu1sGBjQ+xNZ+MuKkVc9FymA6KkW boiB50lS3ZedR/Ey4hrL8aly3FQUcrUCg3rHSFr2V5ZYTZ6c81OU9c= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:reply-to :references:mime-version:content-type:in-reply-to; s=default; bh=haZ27sVvAoJtrAPE+tlyROy4OvQ=; b=BYEUtnzdxnd4b6tQq5DHQkMmWm7d sY01mSEc9tFJueanlowFErlSZiQrw7GEWLh1UMG9zYDoh+G0i9LWayxoGtJy4rRq ZJyY9J7IR81k03gNJJWbTQk6bFkxbeAzsRgXfA9K02Cy4FKSAr/evATWaZIv97Y4 IaYEoXoQT8V3wkM= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: <cygwin.cygwin.com> List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com> List-Archive: <http://sourceware.org/ml/cygwin/> List-Post: <mailto:cygwin AT cygwin DOT com> List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-96.3 required=5.0 tests=AWL,BAYES_00,GOOD_FROM_CORINNA_CYGWIN,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_PBL,RCVD_IN_SORBS_DUL,RDNS_DYNAMIC autolearn=ham version=3.3.2 spammy=cygwin-patches, cygwinpatches, sleep X-HELO: calimero.vinschen.de Date: Mon, 6 Jun 2016 15:16:42 +0200 From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com> To: cygwin AT cygwin DOT com Subject: Re: gdb pty problem [Was: emacs gud-interface is not updated after gdb command execution (maybe because of incomplete output from gdb)] Message-ID: <20160606131642.GA4919@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <466943424 DOT 37628 DOT 394d161a-7219-415d-a659-0f774811ad2d DOT open-xchange AT email DOT 1und1 DOT de> <44459aa0-4381-2368-ab63-5dffc26f3344 AT cornell DOT edu> <e29d08b0-aaed-46ea-a4eb-960b1e462692 AT cornell DOT edu> <a50d8bef-cc9b-3b35-8812-b26360591662 AT cornell DOT edu> <20160531094115 DOT GE24015 AT calimero DOT vinschen DOT de> <34c9cf10-4930-a017-92fc-fd56171671b1 AT cornell DOT edu> <20160601141820 DOT GF11431 AT calimero DOT vinschen DOT de> <20160606191231 DOT a60b226a9867c15023e07fb1 AT nifty DOT ne DOT jp> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="5mCyUwZo2JvN/JJP" Content-Disposition: inline In-Reply-To: <20160606191231.a60b226a9867c15023e07fb1@nifty.ne.jp> User-Agent: Mutt/1.6.1 (2016-04-27) --5mCyUwZo2JvN/JJP Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Jun 6 19:12, Takashi Yano wrote: > Hi Corinna, >=20 > I had looked into this problem, and found the cause. >=20 > 'man termios' says: > "A read(2) returns at most one line of input" in canonical mode. >=20 > On cygwin 2.5.1, read(2) returns all data in buffer if the buffer > size specified is large enough. This behaviour is correct in > noncanonical mode, but is not correct in canonical mode. >=20 > So, I would like to propose a following patch. > [...] > While checking this problem, I found a bug of tcflush(). > tcflush() flushes only partial data in the buffer. >=20 > The patch above also fixes this bug. >=20 > A test case attached (pty_readlen.c) is for confirming > the behaviour of read() and tcflush().=20 > [...] > Of course, Ken's gdbstc works fine without sleep with this patch, > as well as original emacs case. Thanks a lot. Patch applied. I uploaded a new snapshot with this patch to https://cygwin.com/snapshots/ for quick testing. Just one question: In future, would you mind terribly to provide patches in `git format-patch' format (and ideally on the cygwin-patches mailing list)? It's easier to handle by lazy maintainers... :) Thanks, Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --5mCyUwZo2JvN/JJP Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXVXe6AAoJEPU2Bp2uRE+gln8P/1ne4+ui8C7Nui/qsX3icgq3 XvrGyRqQAQTn1JgWPKfsI9wUGAosxYkk3UiInuSilVjZygrYFJUE3XUpM7dX1Cyf rGqal0f15Bpg+lN582A1SVGpcmMoSSrvwAWZ/OCXwRJOiWleOif+F9QoQlfPfTAp 02SEW47ca/5DKCHJOPe+bWwL4ZEQFtv+cGHhoU/29OdazJRtsJjBsQtYfgTc86NN ttREhhPbnsDAC+kYSCFCEMAwPZNIDicVGTxxKKNiqQ6uLwsKaw9ZmFlcSPgaEx2Z RFDbrbHLIDhRdFdrg7KX7dDpJWF4EYaRmDVNbGKGnflbFKasfmtb+FthUvvgBheX 61OxTa3MSUGKZZxk4mg5MRNXKt8Plg4U5zGBoSLlCllgnnmijWdXeCsaNb0KUdWn k1xMmpvhtuImD/YgPPhrN2zJSj9niHsJsMh3X5z4M4IxrYd8p4wV34c8HdyLLwgq 1q3h3mQi7AFqPXnJ3lMf9RUR2is9mISWoVttYRWQRcteOrNzu9yAcWMoCJrX9IX4 o6tgwn9hs0wn03SWCJImps0WZXuFxrDyygBakG6Zqj9HfKQfpZ7lTVGuKwOwmfCl uTBB57B0zQGb9dX4t+EYINuEIJK8/3r9zLyROYlm3FrgpI4AHSMtrlsLjCD5qTkF XSh6UE8WirBzwdLZZz5R =6rOF -----END PGP SIGNATURE----- --5mCyUwZo2JvN/JJP--