Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
From: "Topas" <yrwang@cc.nctu.edu.tw>
To: "egor duda" <cygwin@cygwin.com>
Subject: RE: stdout in gdb
Date: Tue, 22 May 2001 16:29:10 +0800
Message-ID: <NFBBJHGBKLKEAOHMECHMKEDDCAAA.yrwang@cc.nctu.edu.tw>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0)
In-reply-To: <57497665435.20010522114113@logos-m.ru>
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id EAA28535


NO! that does not work! 
I saw this answer in gdb mail-list, some one said gdb did not output!
I just try to run bash using DOS-window(/dev/con), 
the program working fine under gdb
it can find
/dev/conout
1
1

Strange, when I use rxvt (/dev/tty0) it doesn't work!


Thanx for your help!

-----Original Message-----
From: egor duda [mailto:deo@logos-m.ru]
Sent: Tuesday, May 22, 2001 3:41 PM
To: Topas
Cc: cygwin@cygwin.com
Subject: Re: stdout in gdb


Hi!

Tuesday, 22 May, 2001 Topas yrwang@cc.nctu.edu.tw wrote:

T> Whenever I run a program under gdb, I find that the stdout is
T> full-buffered. So, I write a simple program to check the problem,

T> int main()
T> {
T> printf("%s\n", ttyname(1));
T> printf("%d\n", isatty(1));
T> printf("%d\n", stdout->_flags & 0x0001);
T> return 0;
T> }

T> the output of the program is
T> /dev/tty0
T> 1
T> 1

T> but when I run the program under gdb, the output becomes
T> (null)
T> 0
T> 0

T> Is there any options/setting I miss in gdb? 

probably.

(gdb) set new-console

Egor.            mailto:deo@logos-m.ru ICQ 5165414 FidoNet 2:5020/496.19

