delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/01/26/14:23:23

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <40156914.8CE8D966@atp.tuwien.ac.at>
Date: Mon, 26 Jan 2004 20:23:00 +0100
From: RS <rs AT atp DOT tuwien DOT ac DOT at>
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
CC: rs AT atp DOT tuwien DOT ac DOT at
Subject: gdb problem
X-Virus-Scanned: by amavisd-milter (http://amavis.org/)

Using gdb under cygwin I had a problem that can be demonstrated with
following
little program:

==================================
#include <stdio.h>

int main()
{
  char str[100];
  printf("Hello !\n");
  scanf("%s", str);
  printf("str: %s\n", str);
  scanf("%s", str);
  printf("str: %s\n", str);
  return -1;
}
==================================

With Linux (Debian Woody) gdb works fine:
==================================
$ gdb hello
GNU gdb 2002-04-01-cvs
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "i386-linux"...
(gdb) r
Starting program: /home/rs/t/hello
Hello !
ttt
str: ttt
sss
str: sss

Program exited with code 0377.
==================================

Under Cygwin (Win98 and Win2k) text written to stdout is printed only
after finishing the
last input to stdin:
==================================
bash-2.05b$ gdb hello
GNU gdb 2003-09-20-cvs (cygwin-special)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "i686-pc-cygwin"...
(gdb) r
Starting program: /home/rs/t/hello.exe
ttt
sss
Hello !
str: ttt
str: sss

Program exited with code 0177777.
==================================

Thank you for any hint,
Robert




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019