forked from Imagelibrary/binutils-gdb
2012-01-23 Pedro Alves <palves@redhat.com>
* top.c (caution): Rename to ... (confirm): ... this. (show_caution): Rename to ... (show_confirm): ... this. (quit_cover): Adjust. (init_main): Adjust. * top.h (caution): Rename to ... (confirm): ... this. * utils.c (internal_vproblem, defaulted_query): Adjust.
This commit is contained in:
@@ -1,3 +1,15 @@
|
|||||||
|
2012-01-23 Pedro Alves <palves@redhat.com>
|
||||||
|
|
||||||
|
* top.c (caution): Rename to ...
|
||||||
|
(confirm): ... this.
|
||||||
|
(show_caution): Rename to ...
|
||||||
|
(show_confirm): ... this.
|
||||||
|
(quit_cover): Adjust.
|
||||||
|
(init_main): Adjust.
|
||||||
|
* top.h (caution): Rename to ...
|
||||||
|
(confirm): ... this.
|
||||||
|
* utils.c (internal_vproblem, defaulted_query): Adjust.
|
||||||
|
|
||||||
2012-01-23 Pedro Alves <palves@redhat.com>
|
2012-01-23 Pedro Alves <palves@redhat.com>
|
||||||
|
|
||||||
* top.c (caution): Update comment.
|
* top.c (caution): Update comment.
|
||||||
|
|||||||
14
gdb/top.c
14
gdb/top.c
@@ -101,10 +101,10 @@ extern char lang_frame_mismatch_warn[]; /* language.c */
|
|||||||
/* Flag for whether we want to confirm potentially dangerous
|
/* Flag for whether we want to confirm potentially dangerous
|
||||||
operations. Default is yes. */
|
operations. Default is yes. */
|
||||||
|
|
||||||
int caution = 1;
|
int confirm = 1;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
show_caution (struct ui_file *file, int from_tty,
|
show_confirm (struct ui_file *file, int from_tty,
|
||||||
struct cmd_list_element *c, const char *value)
|
struct cmd_list_element *c, const char *value)
|
||||||
{
|
{
|
||||||
fprintf_filtered (file, _("Whether to confirm potentially "
|
fprintf_filtered (file, _("Whether to confirm potentially "
|
||||||
@@ -291,9 +291,9 @@ void (*deprecated_context_hook) (int id);
|
|||||||
/* static */ void
|
/* static */ void
|
||||||
quit_cover (void)
|
quit_cover (void)
|
||||||
{
|
{
|
||||||
caution = 0; /* Throw caution to the wind -- we're exiting.
|
/* Stop asking user for confirmation --- we're exiting. This
|
||||||
This prevents asking the user dumb
|
prevents asking the user dumb questions. */
|
||||||
questions. */
|
confirm = 0;
|
||||||
quit_command ((char *) 0, 0);
|
quit_command ((char *) 0, 0);
|
||||||
}
|
}
|
||||||
#endif /* defined SIGHUP */
|
#endif /* defined SIGHUP */
|
||||||
@@ -1635,11 +1635,11 @@ Show the filename in which to record the command history"), _("\
|
|||||||
show_history_filename,
|
show_history_filename,
|
||||||
&sethistlist, &showhistlist);
|
&sethistlist, &showhistlist);
|
||||||
|
|
||||||
add_setshow_boolean_cmd ("confirm", class_support, &caution, _("\
|
add_setshow_boolean_cmd ("confirm", class_support, &confirm, _("\
|
||||||
Set whether to confirm potentially dangerous operations."), _("\
|
Set whether to confirm potentially dangerous operations."), _("\
|
||||||
Show whether to confirm potentially dangerous operations."), NULL,
|
Show whether to confirm potentially dangerous operations."), NULL,
|
||||||
NULL,
|
NULL,
|
||||||
show_caution,
|
show_confirm,
|
||||||
&setlist, &showlist);
|
&setlist, &showlist);
|
||||||
|
|
||||||
add_setshow_zinteger_cmd ("annotate", class_obscure, &annotation_level, _("\
|
add_setshow_zinteger_cmd ("annotate", class_obscure, &annotation_level, _("\
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ extern char *saved_command_line;
|
|||||||
extern int saved_command_line_size;
|
extern int saved_command_line_size;
|
||||||
extern FILE *instream;
|
extern FILE *instream;
|
||||||
extern int in_user_command;
|
extern int in_user_command;
|
||||||
extern int caution;
|
extern int confirm;
|
||||||
extern char gdb_dirbuf[1024];
|
extern char gdb_dirbuf[1024];
|
||||||
extern int inhibit_gdbinit;
|
extern int inhibit_gdbinit;
|
||||||
extern int epoch_interface;
|
extern int epoch_interface;
|
||||||
|
|||||||
@@ -970,7 +970,7 @@ internal_vproblem (struct internal_problem *problem,
|
|||||||
/* Default (yes/batch case) is to quit GDB. When in batch mode
|
/* Default (yes/batch case) is to quit GDB. When in batch mode
|
||||||
this lessens the likelihood of GDB going into an infinite
|
this lessens the likelihood of GDB going into an infinite
|
||||||
loop. */
|
loop. */
|
||||||
if (caution == 0)
|
if (!confirm)
|
||||||
{
|
{
|
||||||
/* Emit the message and quit. */
|
/* Emit the message and quit. */
|
||||||
fputs_unfiltered (reason, gdb_stderr);
|
fputs_unfiltered (reason, gdb_stderr);
|
||||||
@@ -1384,7 +1384,7 @@ defaulted_query (const char *ctlstr, const char defchar, va_list args)
|
|||||||
|
|
||||||
/* Automatically answer the default value if the user did not want
|
/* Automatically answer the default value if the user did not want
|
||||||
prompts or the command was issued with the server prefix. */
|
prompts or the command was issued with the server prefix. */
|
||||||
if (! caution || server_command)
|
if (!confirm || server_command)
|
||||||
return def_value;
|
return def_value;
|
||||||
|
|
||||||
/* If input isn't coming from the user directly, just say what
|
/* If input isn't coming from the user directly, just say what
|
||||||
|
|||||||
Reference in New Issue
Block a user