From: "Pierre Muller" <muller@ics.u-strasbg.fr>
To: "'Daniel Jacobowitz'" <drow@false.org>
Cc: "'Joel Brobecker'" <brobecker@adacore.com>, <gdb-patches@sourceware.org>
Subject: RE: [RFC] Improve testsuite for poor expect behavior
Date: Wed, 17 Jun 2009 22:39:00 -0000 [thread overview]
Message-ID: <001a01c9ef9c$29d21420$7d763c60$@u-strasbg.fr> (raw)
In-Reply-To: <20090617133626.GA24310@caradoc.them.org>
> -----Message d'origine-----
> De : 'Daniel Jacobowitz' [mailto:drow@false.org]
> Envoyé : Wednesday, June 17, 2009 3:36 PM
> À : Pierre Muller
> Cc : 'Joel Brobecker'; gdb-patches@sourceware.org
> Objet : Re: [RFC] Improve testsuite for poor expect behavior
>
> 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.
>
> FYI, here's what we do for mingw host in our sources, in main.c:
>
> +#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 = fileno (stdin);
> + int out = fileno (stdout);
> + int err = fileno (stderr);
> + HANDLE hin = (HANDLE) _get_osfhandle (in);
> + HANDLE hout = (HANDLE) _get_osfhandle (out);
> + HANDLE herr = (HANDLE) _get_osfhandle (err);
> + if (GetFileType (hin) == FILE_TYPE_PIPE)
> + setmode (in, O_BINARY);
> + if (GetFileType (hout) == FILE_TYPE_PIPE)
> + setmode (out, O_BINARY);
> + if (GetFileType (herr) == FILE_TYPE_PIPE)
> + setmode (err, O_BINARY);
> + }
> +#endif
> +
> gdb_stdout = stdio_fileopen (stdout);
> gdb_stderr = stdio_fileopen (stderr);
> gdb_stdlog = gdb_stderr; /* for moment */
>
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
next prev parent reply other threads:[~2009-06-17 22:39 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-12 23:00 Pierre Muller
2009-06-13 14:52 ` Doug Evans
2009-06-13 15:05 ` Daniel Jacobowitz
2009-06-13 20:29 ` Pierre Muller
2009-06-13 23:55 ` 'Daniel Jacobowitz'
2009-06-14 0:25 ` Joel Brobecker
2009-06-15 7:23 ` Pierre Muller
2009-06-16 14:58 ` Joel Brobecker
2009-06-16 23:29 ` Pierre Muller
2009-06-17 13:36 ` 'Daniel Jacobowitz'
2009-06-17 14:54 ` Joel Brobecker
2009-06-17 17:25 ` Eli Zaretskii
2009-06-17 19:39 ` Joel Brobecker
2009-06-18 14:38 ` Eli Zaretskii
2009-06-18 14:59 ` Joel Brobecker
2009-06-18 15:25 ` Eli Zaretskii
2009-06-18 15:33 ` Joel Brobecker
2009-06-18 15:58 ` Samuel Bronson
2009-06-18 23:02 ` Eli Zaretskii
2009-06-17 17:17 ` Eli Zaretskii
2009-06-17 20:17 ` Pierre Muller
2009-06-17 21:00 ` Pierre Muller
2009-06-18 14:33 ` Eli Zaretskii
2009-06-18 15:57 ` Pierre Muller
2009-06-18 16:08 ` Pedro Alves
2009-06-18 23:18 ` Eli Zaretskii
2009-06-18 16:19 ` Pedro Alves
2009-06-17 21:56 ` Pierre Muller
2009-06-18 14:48 ` Eli Zaretskii
2009-06-17 22:39 ` Pierre Muller [this message]
2009-06-17 22:43 ` 'Daniel Jacobowitz'
2009-06-17 22:54 ` Pierre Muller
2009-06-17 23:21 ` 'Daniel Jacobowitz'
2009-06-17 23:18 ` Joel Brobecker
2009-06-18 6:31 ` Mark Kettenis
2009-06-23 18:14 ` Joel Brobecker
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='001a01c9ef9c$29d21420$7d763c60$@u-strasbg.fr' \
--to=muller@ics.u-strasbg.fr \
--cc=brobecker@adacore.com \
--cc=drow@false.org \
--cc=gdb-patches@sourceware.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox