From: Yao Qi <yao@codesourcery.com>
To: <gdb-patches@sourceware.org>
Subject: Re: [PATCH 1/3] New option --cygwin-tty.
Date: Thu, 25 Jul 2013 09:05:00 -0000 [thread overview]
Message-ID: <51F0EA14.1070900@codesourcery.com> (raw)
In-Reply-To: <20130725081820.GA11021@calimero.vinschen.de>
On 07/25/2013 04:18 PM, Corinna Vinschen wrote:
>> Yeah, I agree, but I am worried that stdio handlers (such as stdout)
>> >should be set before any writes to them, so we should set the flag
>> >(cygwin_tty) at the early stage of GDB start up (before command 'set
>> >windows-os-tty on' is processed). If it is not a problem, I am
>> >fine.
> You can use the _setmode() call at any time to switch text/binary mode
> on the descriptors.
>
The doc on _setmode on MSDN says _setmode () should be called before any
input or output operations.
http://msdn.microsoft.com/en-us/library/tw4k6df8.aspx
"_setmode is typically used to modify the default translation mode of
stdin and stdout, but you can use it on any file. If you apply _setmode
to the file descriptor for a stream, call _setmode before you perform
any input or output operations on the stream."
Beside setmode, we also need setvbuf to disable buffering. It should be
called before any input or output on the stream.
>> >I am looking at Corinna's example to see how to detect GDB is
>> >running in Cygwin's TTY. If it works, probably we can get rid of
>> >this new GDB option completely.
> It has been tested under Mingw-w64 and VC++. If you're using Mingw.Org,
> it probably needs some tweaking.
Right, it needs some tweaks on headers files for Mingw.Org.
What is the minimum version of cygwin required for this example? In
cygwin 1.7.20, the file name is
"\cygwin-8c26184c318518a4-pty0-from-master", while in 1.7.9, it is
"\cygwin-c5e39b7a9d22bafb-tty0-from-master".
--
Yao (é½å°§)
next prev parent reply other threads:[~2013-07-25 9:05 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-25 5:10 [PATCH 0/3] Test mingw32 GDB in cygwin Yao Qi
2013-07-25 5:10 ` [PATCH 3/3] native mingw32 gdb, eol format Yao Qi
2013-07-25 5:10 ` [PATCH 2/3] Unbuffer stdout and stderr on windows Yao Qi
2013-07-25 5:10 ` [PATCH 1/3] New option --cygwin-tty Yao Qi
2013-07-25 7:34 ` Corinna Vinschen
2013-07-25 7:37 ` Pierre Muller
2013-07-25 7:55 ` Yao Qi
2013-07-25 8:18 ` Corinna Vinschen
2013-07-25 8:26 ` Corinna Vinschen
2013-07-25 9:05 ` Yao Qi [this message]
2013-07-25 10:20 ` Corinna Vinschen
2013-07-25 12:08 ` Yao Qi
2013-07-25 15:21 ` Corinna Vinschen
2013-07-26 19:40 ` Doug Evans
2013-07-25 7:31 ` [PATCH 0/3] Test mingw32 GDB in cygwin Pierre Muller
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=51F0EA14.1070900@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