Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: <gdb-patches@sourceware.org>
Subject: [PATCH 0/3 V4] Test mingw32 GDB in cygwin
Date: Tue, 13 Aug 2013 09:35:00 -0000	[thread overview]
Message-ID: <1376386468-26249-1-git-send-email-yao@codesourcery.com> (raw)

Hi,
Here is the V4 of this patch series, which fix problems we've seen on
running mingw32 native for testing cygwin.  V3 was reviewed in this thread 
http://sourceware.org/ml/gdb-patches/2013-07/msg00691.html by Eli mostly.
All the questions/comments were addressed, AFAIK.  However, no one
approved it explicitly.  I post them again, and call it V4, which is
identical to patches I finally posted in V3 thread.  It is sort of a
patch ping.

These patches was discussed some times (since 2009), and people think
they are useful, but unfortunately, they were not checked in since then.
There are some issues in GDB on Windows (including mingw32 and cygwin),
and Pierre has some other fixes too on top of mine.  The patch series
can be a good starting point.

Here is the description in V3, for people who don't have much context
of this series....

-----------------------------------------------------------
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.

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.

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.

The whole series are tested on native mingw32 GDB running in cygwin.
Test results are improved dramatically.

My plan next step would be to wrap isatty by gdb_isatty, which uses
the logic in Corinna's example to return the correct result on
cygwin pty.  I didn't include this change into this series, because
I get some exceptions when GDB starts up from time to time:

  (gdb) Exception condition detected on fd 0
  error detected on stdin

It takes time investigating and I decide to stop here.

*** BLURB HERE ***

Yao Qi (3):
  Detect GDB is in cygwin
  Unbuffer stdout and stderr in cygwin
  Set stdout/stderr to binary mode in cygwin.

 gdb/config.in    |    6 +++
 gdb/configure    |   30 +++++++++++++++++
 gdb/configure.ac |    7 ++++
 gdb/defs.h       |    4 ++
 gdb/main.c       |   24 +++++++++++++
 gdb/mingw-hdep.c |   96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 167 insertions(+), 0 deletions(-)

-- 
1.7.7.6


             reply	other threads:[~2013-08-13  9:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-13  9:35 Yao Qi [this message]
2013-08-13  9:35 ` [PATCH 2/3] Unbuffer stdout and stderr " Yao Qi
2013-08-13  9:35 ` [PATCH 1/3] Detect GDB is " Yao Qi
2013-08-13  9:35 ` [PATCH 3/3] Set stdout/stderr to binary mode " Yao Qi
2013-08-13 16:00 ` [PATCH 0/3 V4] Test mingw32 GDB " Eli Zaretskii
2013-08-15 17:43   ` Christopher Faylor

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=1376386468-26249-1-git-send-email-yao@codesourcery.com \
    --to=yao@codesourcery.com \
    --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