From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1182 invoked by alias); 29 Jul 2013 14:03:56 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 1156 invoked by uid 89); 29 Jul 2013 14:03:56 -0000 X-Spam-SWARE-Status: No, score=0.1 required=5.0 tests=AWL,BAYES_50,KHOP_THREADED,MSGID_MULTIPLE_AT,RDNS_NONE autolearn=no version=3.3.1 Received: from Unknown (HELO mailhost.u-strasbg.fr) (130.79.201.46) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 29 Jul 2013 14:03:54 +0000 Received: from md13.u-strasbg.fr (md13.u-strasbg.fr [130.79.200.248]) by mailhost.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id r6TE3gB4075029 ; Mon, 29 Jul 2013 16:03:42 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from ms11.u-strasbg.fr (ms11.u-strasbg.fr [130.79.204.111]) by md13.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id r6TE3e81027502 ; Mon, 29 Jul 2013 16:03:41 +0200 (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from E6510Muller (lec67-4-82-230-53-140.fbx.proxad.net [82.230.53.140]) (Authenticated sender: mullerp) by ms11.u-strasbg.fr (Postfix) with ESMTPSA id 740071FD90; Mon, 29 Jul 2013 16:03:39 +0200 (CEST) From: "Pierre Muller" To: "'Yao Qi'" , References: <1375087546-22591-1-git-send-email-yao@codesourcery.com> In-Reply-To: <1375087546-22591-1-git-send-email-yao@codesourcery.com> Subject: RE: [PATCH 0/3 V3] Test mingw32 GDB in cygwin Date: Mon, 29 Jul 2013 14:03:00 -0000 Message-ID: <004801ce8c64$6dbd64f0$49382ed0$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-SW-Source: 2013-07/txt/msg00701.txt.bz2 Hi all, > -----Message d'origine----- > De=A0: gdb-patches-owner@sourceware.org [mailto:gdb-patches- > owner@sourceware.org] De la part de Yao Qi > Envoy=E9=A0: lundi 29 juillet 2013 10:46 > =C0=A0: gdb-patches@sourceware.org > Objet=A0: [PATCH 0/3 V3] Test mingw32 GDB in cygwin >=20 > This patch series try to fix the problems we've seen on running > mingw32 native for testing in cygwin. Patch 2/3 unbuffer the > stdout and stderr, so that dejagnu/expect can match the output in > the right order. Likewise, patch 3/3 sets stdin/stdout/stderr into > binary mode, so that dejagnu/expects can match the eol correctly > too. In order to avoid the side effects of these changes to native > win32 platform, we need some bits to detect whether GDB is running > in cygwin. This is what patch 1/3 tries to do, and most of > discussions are on it. >=20 > In V2, I proposed a new GDB option '--cygwin-tty' to tell GDB that > it is in cygwin. People don't like it, and Corinna gave an example > that we can detect whether GDB is in cygwin or not. I didn't like it because I explained that the changes you propose are useful to run the testsuite on Windows OS, but not only if running under a cygwin terminal. I am using a msys port of dejagnu expect, and this needs the same changes (remove buffering and switch to binary mode), but with the new version of your patch,=20 nothing would happen for me and the testsuite would still fail. =20 > Thanks to Corinna's example, we can know whether GDB is in cygwin > by checking the file name of handler of stdin (or stdout). As a > result, a new option '--cygwin-tty' is avoided. Patch 1/3 is > almost rewritten in V3. Yes, that's true, but the down side is that you transform the terminal settings only when you are on a cygwin terminal... I think this is not correct: I suspect that is_in_cygwin will return true on every type of cygwin terminal, in particular also when you are in interactive mode...=20 I thought that your patch should only change settings if the pipes from expect redirection are detected, but there are no pipe checks anymore... Note that I am not sure of the above, as 'maybe' the pty/tty name doesn't match in the interactive shell case. Secondly, your patch will never trigger the no buffer/binary mode changes on non-cygwin terminals, while I argued before that it should also be usable in those conditions. =20=20 This is why I would rather like to have the settings modification grouped into a function (let's call it setup_handles_for_testsuite) which would be an empty function for all but __MINGW32__ code. This function could then be called by (gdb) set maint testsuite-mode on command or automatically when a cygwin shell and pipes are detected. I am sorry to bother you again, but I would really like to get a patch that can be used in more general framework and that avoids to change the standard handles when not necessary. And, to finish, I would like to reiterate my support for this patch, even though I am still criticizing it. Sorry to bother you more, Pierre Muller