From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12837 invoked by alias); 17 Jun 2009 22:39:02 -0000 Received: (qmail 12828 invoked by uid 22791); 17 Jun 2009 22:39:01 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.151) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 17 Jun 2009 22:38:55 +0000 Received: from baal.u-strasbg.fr (baal.u-strasbg.fr [IPv6:2001:660:2402::41]) by mailhost.u-strasbg.fr (8.14.2/jtpda-5.5pre1) with ESMTP id n5HMbDXC003210 ; Thu, 18 Jun 2009 00:37:13 +0200 (CEST) Received: from mailserver.u-strasbg.fr (ms3.u-strasbg.fr [IPv6:2001:660:2402:d::12]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id n5HMbDAS046989 ; Thu, 18 Jun 2009 00:37:13 +0200 (CEST) (envelope-from muller@ics.u-strasbg.fr) Received: from d620muller (lec67-4-82-230-53-140.fbx.proxad.net [82.230.53.140]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id n5HMbC0x087932 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) ; Thu, 18 Jun 2009 00:37:12 +0200 (CEST) (envelope-from muller@ics.u-strasbg.fr) From: "Pierre Muller" To: "'Daniel Jacobowitz'" Cc: "'Joel Brobecker'" , References: <001201c9ebb1$96414b10$c2c3e130$@u-strasbg.fr> <20090613150505.GA28157@caradoc.them.org> <000001c9ec65$9bf13ca0$d3d3b5e0$@u-strasbg.fr> <20090613235454.GA1893@caradoc.them.org> <20090614002516.GO25703@adacore.com> <000001c9ed8a$21cfdc30$656f9490$@u-strasbg.fr> <20090616145756.GB7730@adacore.com> <000c01c9eeda$022d8a70$06889f50$@u-strasbg.fr> <20090617133626.GA24310@caradoc.them.org> In-Reply-To: <20090617133626.GA24310@caradoc.them.org> Subject: RE: [RFC] Improve testsuite for poor expect behavior Date: Wed, 17 Jun 2009 22:39:00 -0000 Message-ID: <001a01c9ef9c$29d21420$7d763c60$@u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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 X-SW-Source: 2009-06/txt/msg00457.txt.bz2 > -----Message d'origine----- > De=A0: 'Daniel Jacobowitz' [mailto:drow@false.org] > Envoy=E9=A0: Wednesday, June 17, 2009 3:36 PM > =C0=A0: Pierre Muller > Cc=A0: 'Joel Brobecker'; gdb-patches@sourceware.org > Objet=A0: Re: [RFC] Improve testsuite for poor expect behavior >=20 > On Wed, Jun 17, 2009 at 01:27:23AM +0200, Pierre Muller wrote: > > I will try to resubmit a much shorter patch > > that just handles this without trying to > > modify the executables. >=20 > FYI, here's what we do for mingw host in our sources, in main.c: >=20 > +#ifdef _WIN32 > + /* A Cygwin ssh session may not look like a terminal to the Windows > + runtime; ensure unbuffered output. */ > + setvbuf (stdout, NULL, _IONBF, BUFSIZ); > + setvbuf (stderr, NULL, _IONBF, BUFSIZ); > +#endif > + Could we use something that would also work for Win64 compilation? > +#ifdef __MINGW32__ > + /* In textmode, a '\n' is automatically expanded into "\r\n". When > + driving the testsuite from a linux host, the '\n' is also > + expanded into "\r\n". This results in expect seing "\r\r\n". > + The tests aren't prepared currently for other forms of eol. As a > + workaround, we force the output to binary mode. Do this only if > + the files are pipes (cygwin ttys are Windows pipes behind the > + scenes). */ > + { > + int in =3D fileno (stdin); > + int out =3D fileno (stdout); > + int err =3D fileno (stderr); > + HANDLE hin =3D (HANDLE) _get_osfhandle (in); > + HANDLE hout =3D (HANDLE) _get_osfhandle (out); > + HANDLE herr =3D (HANDLE) _get_osfhandle (err); > + if (GetFileType (hin) =3D=3D FILE_TYPE_PIPE) > + setmode (in, O_BINARY); > + if (GetFileType (hout) =3D=3D FILE_TYPE_PIPE) > + setmode (out, O_BINARY); > + if (GetFileType (herr) =3D=3D FILE_TYPE_PIPE) > + setmode (err, O_BINARY); > + } > +#endif > + > gdb_stdout =3D stdio_fileopen (stdout); > gdb_stderr =3D stdio_fileopen (stderr); > gdb_stdlog =3D gdb_stderr; /* for moment */ >=20 Wouldn't it be better to move all this into mingw-hdep.c file in the _initialize_mingw_hdep function, the conditional can then be completely removed, no? I would really like to have all these changes (set interactive also) in CVS! Pierre