diff options
author | Tom Tromey <tom@tromey.com> | 2020-07-05 13:02:40 -0600 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2021-04-15 10:34:09 +0100 |
commit | 5809fbf2e289fc524d3086da62918876b66cefa8 (patch) | |
tree | 991a62f7b453e581a709e31f7d7365da9c979d4b /gdb/top.c | |
parent | 92e4e97a9f569bf23b0f74479f32280c1f24cc6b (diff) | |
download | gdb-5809fbf2e289fc524d3086da62918876b66cefa8.zip gdb-5809fbf2e289fc524d3086da62918876b66cefa8.tar.gz gdb-5809fbf2e289fc524d3086da62918876b66cefa8.tar.bz2 |
gdb: add "set startup-quietly" command
This adds a new command to change GDB to behave as though "-quiet"
were always given. This new command can be added to the gdbearlyinit
file to affect future GDB sessions.
gdb/ChangeLog:
* NEWS: Add entry.
* main.c (captured_main_1): Call check_quiet_mode.
* top.c (startup_quiet): New global.
(check_quiet_mode): New function.
(show_startup_quiet): New function.
(init_main): Register new command.
* top.h (check_quiet_mode): Declare.
gdb/doc/ChangeLog:
* gdb.texinfo (Mode Options): Mention "set startup-quietly".
gdb/testsuite/ChangeLog:
* gdb.base/startup-file.exp: Add more tests.
Diffstat (limited to 'gdb/top.c')
-rw-r--r-- | gdb/top.c | 33 |
1 files changed, 33 insertions, 0 deletions
@@ -2163,6 +2163,28 @@ set_history_filename (const char *args, } } +/* Whether we're in quiet startup mode. */ + +static bool startup_quiet; + +/* See top.h. */ + +bool +check_quiet_mode () +{ + return startup_quiet; +} + +/* Show whether GDB should start up in quiet mode. */ + +static void +show_startup_quiet (struct ui_file *file, int from_tty, + struct cmd_list_element *c, const char *value) +{ + fprintf_filtered (file, _("Whether to start up quietly is %s.\n"), + value); +} + static void init_gdb_version_vars (void) { @@ -2319,6 +2341,17 @@ input settings."), show_interactive_mode, &setlist, &showlist); + c = add_setshow_boolean_cmd ("startup-quietly", class_support, + &startup_quiet, _("\ +Set whether GDB should start up quietly."), _(" \ +Show whether GDB should start up quietly."), _("\ +This setting will not affect the current session. Instead this command\n\ +should be added to the .gdbearlyinit file in the users home directory to\n\ +affect future GDB sessions."), + NULL, + show_startup_quiet, + &setlist, &showlist); + c = add_cmd ("new-ui", class_support, new_ui_command, _("\ Create a new UI.\n\ Usage: new-ui INTERPRETER TTY\n\ |