This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA/RFC] new setting against auto-answer? (because "input not from terminal")
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Sat, 25 Oct 2008 10:05:33 +0200
- Subject: Re: [RFA/RFC] new setting against auto-answer? (because "input not from terminal")
- References: <20081025010445.GC29038@adacore.com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Fri, 24 Oct 2008 18:04:45 -0700
> From: Joel Brobecker <brobecker@adacore.com>
>
> If you have been in that situation, and you use a MinGW debugger,
> then you probably know that there are a few issues with the "terminal".
> One of the issues that is causing us some trouble is the fact that
> GDB automatically assumes the default answer for its y/n queries.
> For instance:
>
> (top-gdb) start
> The program being debugged has been started already.
> Start it from the beginning? (y or n) [answered Y; input not from terminal]
> [...]
>
> I propose a new "set/show interactive-mode (auto|on|off)" command
> to allow the user to override what GDB detects.
Isn't it better to fix the original problem?
Is the problem with isatty returning the wrong value? If so, did you
(or can you) try the following trick?
#define ISATTY(fd) (isatty(fd) && lseek(fd,SEEK_CUR,0) == -1)
and then use ISATTY instead of isatty?