This is the mail archive of the gdb-patches@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]

Re: [commit] problem sourcing GDB script in interactive-mode on


Thanks for the thorough review!

> There's also the calls to input_from_terminal_p in utils.c to consider.
> What should happen to paging, for example, if interactive-mode = on
> and we're sourcing a script?

I think we should be doing exactly the same as what is happening when
interactive mode is auto.

To answer one of your questions, the purpose of this setting is to
force GDB to think that we're running on a terminal.  This is meant
to be used on Windows, when GDB is configured as a MinGW debugger,
but running inside a cygwin window.  Cygwin implements its "terminal"
as a pair of pipes, and so the MinGW debugger doesn't realize that,
from the user's perspective, we are inside a terminal.

This should explain the patch as it is: I was only being consistent
with what we already do in the rest of the function:

  if (gdb_has_a_terminal () && instream == stdin)
    return 1;

Note what the description of input_from_terminal_p says:

/* Returns whether GDB is running on a terminal and input is
   currently coming from that terminal.  */

But I realize, now, that the option might be poorly named.  The name
I chose does seem to suggest that an interactive mode "on" means
interactive behavior at all times, including while evaluating scripts.

I think that it doesn't really make much sense to force interactive
mode and paging while evaluating a script.  And given also the
description of input_from_terminal_p ("input is currently comming
from that terminal"), I'm actually leaning towards keeping the
"instream == stdin" check in there.

I'm not really surea about the from_tty check, but I think it's
othogonal?

-- 
Joel


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