Re: [RFC] Improve testsuite for poor expect behavior

'Daniel Jacobowitz'
2009-06-13T23:55:05Z

On Sat, Jun 13, 2009 at 10:29:09PM +0200, Pierre Muller wrote:
> I don't get this:
> the patch does not only concern the output from GDB,
> but also from debuggee executables.
> Do you mean that we should set stdout/stderr to binary in
> all testsuite executables too?

That's strange. We run the testsuite on mingw all the time, and I
don't remember seeing this problem. Maybe we haven't noticed it yet.

We already have a file linked in to test executables on Windows,
for this reason: gdb/testsuite/lib/set_unbuffered_mode.c. Can
we use that for the same effect?

We don't need to worry about what happens when running the executables
directly, as long as the right bits are shown to 'expect'.

> > > There is a second aspect, which is mainly a problem of
> > > the cygwin expect: GDB run inside expect does not believe that
> > > they are connected to a terminal, which means that queries are
> > > answered by their default values.
> > > A large part of the patch below is devoted to adding pattern
> > > that recognize correctly the cases where a query is answered
> > automatically.
> >
> > I do not like either of these changes to the testsuite, because
> > they're outright wrong on other platforms. I'd rather fix them in
> > GDB. They're not limitations of expect, but of the environment in
> > which GDB is running.
>
> Here again, I don't understand your position:
> I only add new patterns corresponding to output from GDB
> that only occur if GDB believes that it is not connected to a terminal,
> why should it have adverse effects on platforms for which this works?

I see, I didn't realize that. I still think it would be better to fix
this in GDB rather than complicate the testsuite, though. I vaguely
remember Joel proposing a variable to make GDB pretend there was a
terminal?

--
Daniel Jacobowitz
CodeSourcery