summaryrefslogtreecommitdiff
path: root/gdb/top.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2011-01-21 18:56:39 +0000
committerJoel Brobecker <brobecker@gnat.com>2011-01-21 18:56:39 +0000
commitf5e248ca1da7de9a570423cb568b79e50ecdbbd9 (patch)
tree4db4d8ed70128cd66d7ee982933380fa3dcb0257 /gdb/top.c
parent17bbc3495ddc9adff2fbc2d902a4511ef50d9b8a (diff)
downloadgdb-f5e248ca1da7de9a570423cb568b79e50ecdbbd9.tar.gz
move handing of "set interactive-mode" to gdb_has_a_terminal
The real purpose of this setting is really to override what the debugger would otherwise guess from checking the stdin settings. So it seems more natural to see this setting being handled inside gdb_has_a_terminal rather than input_is_terminal (which checks for other things, such as whether the input is stdin, for instance). This patch also adjust the command help and the associated section in the GDB Manual to be a little clearer about that. gdb/ChangeLog: * inflow.c: Include "gdbcmd.h". (interactive_mode): New static global, moved here from top.c. (show_interactive_mode): New function, moved here from top.c. use gdb_has_a_terminal instead of input_from_terminal_p to determine the current mode. (gdb_has_a_terminal): Add handling of the "iteractive-mode" setting. (_initialize_inflow): Add the "set/show interactive-mode" commands. Moved here from top.c, after having adjusted slightly the help text. * top.c (interactive_mode, show_interactive_mode): Delete, moved to inflow.c. (input_from_terminal_p): Remove handling of "interactive-mode" setting, moved to infow.c. (init_main): Remove creation of the "set/show interactive-mode" commands, moved to inflow.c. gdb/doc/ChangeLog: * gdb.texinfo (Other Misc Settings): Rework part of the documentation of the "set interactive mode" command.
Diffstat (limited to 'gdb/top.c')
-rw-r--r--gdb/top.c38
1 files changed, 0 insertions, 38 deletions
diff --git a/gdb/top.c b/gdb/top.c
index bba1a2ddf5f..d14f308942d 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -1263,38 +1263,12 @@ quit_force (char *args, int from_tty)
exit (exit_code);
}
-/* If OFF, the debugger will run in non-interactive mode, which means
- that it will automatically select the default answer to all the
- queries made to the user. If ON, gdb will wait for the user to
- answer all queries. If AUTO, gdb will determine whether to run
- in interactive mode or not depending on whether stdin is a terminal
- or not. */
-static enum auto_boolean interactive_mode = AUTO_BOOLEAN_AUTO;
-
-/* Implement the "show interactive-mode" option. */
-
-static void
-show_interactive_mode (struct ui_file *file, int from_tty,
- struct cmd_list_element *c,
- const char *value)
-{
- if (interactive_mode == AUTO_BOOLEAN_AUTO)
- fprintf_filtered (file, "Debugger's interactive mode "
- "is %s (currently %s).\n",
- value, input_from_terminal_p () ? "on" : "off");
- else
- fprintf_filtered (file, "Debugger's interactive mode is %s.\n", value);
-}
-
/* Returns whether GDB is running on a terminal and input is
currently coming from that terminal. */
int
input_from_terminal_p (void)
{
- if (interactive_mode != AUTO_BOOLEAN_AUTO && instream == stdin)
- return interactive_mode == AUTO_BOOLEAN_TRUE;
-
if (batch_flag)
return 0;
@@ -1627,18 +1601,6 @@ Use \"on\" to enable the notification, and \"off\" to disable it."),
show_exec_done_display_p,
&setlist, &showlist);
- add_setshow_auto_boolean_cmd ("interactive-mode", class_support,
- &interactive_mode, _("\
-Set whether GDB should run in interactive mode or not"), _("\
-Show whether GDB runs in interactive mode"), _("\
-If on, run in interactive mode and wait for the user to answer\n\
-all queries. If off, run in non-interactive mode and automatically\n\
-assume the default answer to all queries. If auto (the default),\n\
-determine which mode to use based on the standard input settings"),
- NULL,
- show_interactive_mode,
- &setlist, &showlist);
-
add_setshow_filename_cmd ("data-directory", class_maintenance,
&gdb_datadir, _("Set GDB's data directory."),
_("Show GDB's data directory."),