* Makefile.in (utils.o): Update.
* top.c (in_user_command): New. (command_line_input): Use input_from_terminal_p. (input_from_terminal_p): Don't check caution. Handle stdin == NULL for Insight. * top.h (in_user_command, caution): New declarations. * utils.c: Include "top.h". (query, defaulted_query): Check caution here. Move the call to input_from_terminal_p higher. * cli/cli-script.c (do_restore_user_call_depth): Only decrement the depth. Update in_user_command if necessary. (execute_user_command): Don't clobber old_chain. Set in_user_command. Let do_restore_user_call_depth handle user_call_depth. (read_command_lines): Check whether to prompt before calling Insight hooks. * tui/tui-hooks.c (tui_query_hook): Remove newly unnecessary input_from_terminal_p check.
This commit is contained in:
parent
2f00de94cb
commit
698ba9341e
7 changed files with 81 additions and 38 deletions
19
gdb/utils.c
19
gdb/utils.c
|
@ -54,6 +54,7 @@
|
|||
#include "filenames.h"
|
||||
#include "symfile.h"
|
||||
#include "gdb_obstack.h"
|
||||
#include "top.h"
|
||||
|
||||
#include "inferior.h" /* for signed_pointer_to_address */
|
||||
|
||||
|
@ -1141,16 +1142,17 @@ query (const char *ctlstr, ...)
|
|||
int ans2;
|
||||
int retval;
|
||||
|
||||
/* Automatically answer "yes" if input is not from the user
|
||||
directly, or if the user did not want prompts. */
|
||||
if (!input_from_terminal_p () || !caution)
|
||||
return 1;
|
||||
|
||||
if (deprecated_query_hook)
|
||||
{
|
||||
va_start (args, ctlstr);
|
||||
return deprecated_query_hook (ctlstr, args);
|
||||
}
|
||||
|
||||
/* Automatically answer "yes" if input is not from a terminal. */
|
||||
if (!input_from_terminal_p ())
|
||||
return 1;
|
||||
|
||||
while (1)
|
||||
{
|
||||
wrap_here (""); /* Flush any buffered output */
|
||||
|
@ -1244,15 +1246,16 @@ defaulted_query (const char *ctlstr, const char defchar, va_list args)
|
|||
n_string = "[n]";
|
||||
}
|
||||
|
||||
/* Automatically answer the default value if input is not from the user
|
||||
directly, or if the user did not want prompts. */
|
||||
if (!input_from_terminal_p () || !caution)
|
||||
return def_value;
|
||||
|
||||
if (deprecated_query_hook)
|
||||
{
|
||||
return deprecated_query_hook (ctlstr, args);
|
||||
}
|
||||
|
||||
/* Automatically answer default value if input is not from a terminal. */
|
||||
if (!input_from_terminal_p ())
|
||||
return def_value;
|
||||
|
||||
while (1)
|
||||
{
|
||||
wrap_here (""); /* Flush any buffered output */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue