This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Cygwin GDB DejaGnu testsuite problems


  I was trying to understand why Cygwin's GDB
testsuite results were so bad (around 500 failures).

  Examining fileio.exp, I discovered that one big problem
is that the output of executable generated from fileio.c source
is buffered because within the testsuite
isatty(stdout) returns false.

  Adding a setvbuf (stdout, NULL, _IONBF, 0);
at the beginning of main
reduced the number of failures from 38
to only three.
  The 3 remaining failures are:
FAIL: gdb.base/fileio.exp: Isatty (stdin) (gdb prompt found alone)
FAIL: gdb.base/fileio.exp: Isatty (stdout) (gdb prompt found alone)
FAIL: gdb.base/fileio.exp: Isatty (stderr) (gdb prompt found alone)
Which perfectly illustrates the problem:
  fileio.exe knows that the output is redirected to
a file or pipe, and thus buffers the output, 
to the point that the whole output is printed out in 
two packets and most tests of fileio.exp fail.

  It seems that DejaGnu on Cygwin is not
able to get gdb.exe or fileio.exe to believe that it
is on a terminal. But I suppose that this
works on other systems, no?
  

  I have no clue if this is a Cygwin, Tcl, Expect or DejaGnu
bug...

  I am using the DejaGnu that is deployed by Cygwin SetUp program,
which is rather old, but I couldn't find anything
more recent, nor configure and make a newer distribution of DejaGnu.

Three questions:
1)  Is there a way to get a recent DejaGnu for Cygwin?
  Does that more recent version fix that isatty problem?
2)  Is it possible to set some option to prevent the Cygwin system
from using the file buffering?
3) Would patches that add  setvbuf calls to testsuite 
executable be acceptable for GDB?
(with some conditional macro
that would be set for Cygwin, or 
more generally for systems where isatty(stdin) 
returns zero within DejaGnu).


Pierre Muller



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]