binutils-gdb/gdb/mi
Pedro Alves 268a799a45 Make stdin be per UI
This commit makes each UI have its own "stdin" stream pointer.  This
is used to determine whether the "from_tty" argument to
execute_command, etc. should be true.

Related, this commit makes input_from_terminal_p take an UI parameter,
and then avoids the gdb_has_a_terminal in it.  gdb_has_a_terminal only
returns info on gdb's own main/primary terminal (the real stdin).
However, the places that call input_from_terminal_p really want to
know is whether the command came from an interactive tty.  This patch
thus renames input_from_terminal_p to input_interactive_p for clarity,
and then makes input_interactive_p check for "set interactive" itself,
along with ISATTY, instead of calling gdb_has_a_terminal.  Actually,
quit_force wants to call input_interactive_p _after_ stdin is closed,
we can't call ISATTY that late.  So instead we save the result of
ISATTY in a field of the UI.

gdb/ChangeLog:
2016-06-21  Pedro Alves  <palves@redhat.com>

	* cli/cli-script.c (read_next_line): Adjust to per-UI stdin.
	(read_command_lines): Use input_interactive_p instead of
	input_from_terminal_p.
	* defs.h (struct ui): Forward declare.
	(input_from_terminal_p): Rename to ...
	(input_interactive_p): ... this.
	* event-top.c (stdin_event_handler): Pass 0 as from_tty argument
	to quit_command.
	(command_handler): Adjust to per-UI stdin.
	(handle_line_of_input): Adjust to per-UI stdin and use
	input_interactive_p instead of ISATTY and input_from_terminal_p.
	(gdb_readline_no_editing_callback): Adjust to per-UI stdin.
	(command_line_handler): Always pass true as "from_tty" parameter
	of handle_line_of_input and execute_command.
	(async_sigterm_handler): Pass 0 as from_tty argument to
	quit_command.
	* inflow.c (interactive_mode, show_interactive_mode): Moved to ...
	(gdb_has_a_terminal): Don't check interactive_mode here.
	(_initialize_inflow): Don't install "set interactive-mode" here.
	* main.c (captured_command_loop): Adjust to per-UI stdin.
	* mi/mi-interp.c (mi_execute_command_wrapper): Adjust to per-UI
	stdin.
	* top.c (new_ui): Save the stdin stream and whether it's a tty.
	(dont_repeat): Adjust to per-UI stdin.
	(command_line_input): Adjust to per-UI stdin and to use
	input_interactive_p.
	(quit_force): Write history if any UI supports interactive input.
	(interactive_mode, show_interactive_mode): Move here, from
	inflow.c.
	(input_from_terminal_p): Rename to ...
	(input_interactive_p): ... this, and check the "interactive_mode"
	global instead of calling gdb_has_a_terminal.
	(_initialize_top): Install "set interactive-mode" here.
	* top.h (struct ui) <stdin_stream, input_interactive_p>: New
	fields.
	* utils.c (quit): Pass 0 as from_tty argument to quit_force.
	(defaulted_query): Adjust to per-UI stdin and to use
	input_interactive_p.
2016-06-21 01:11:54 +01:00
..
ChangeLog-1999-2003
mi-cmd-break.c Enable/update legacy linespecs in MI. 2016-02-09 14:31:04 -08:00
mi-cmd-break.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-cmd-catch.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-cmd-disas.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-cmd-env.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-cmd-file.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-cmd-info.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-cmd-stack.c remove trivialy unused variables 2016-05-07 20:12:53 -04:00
mi-cmd-target.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-cmd-var.c varobj: Cleanup dead code 2016-02-07 09:45:02 -05:00
mi-cmds.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-cmds.h Make raw_stdout be per MI instance 2016-06-21 01:11:50 +01:00
mi-common.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-common.h Make raw_stdout be per MI instance 2016-06-21 01:11:50 +01:00
mi-console.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-console.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-getopt.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-getopt.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-interp.c Make stdin be per UI 2016-06-21 01:11:54 +01:00
mi-main.c New function should_print_stop_to_console 2016-06-21 01:11:52 +01:00
mi-main.h Make raw_stdout be per MI instance 2016-06-21 01:11:50 +01:00
mi-out.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-out.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-parse.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-parse.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mi-symbol-cmds.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00