Re: [PATCHv2 3/3] gdb: add "set startup-quietly" command

Eli Zaretskii via Gdb-patches
2021-01-26T15:12:43Z

> From: Andrew Burgess <andrew.burgess@embecosm.com>
> Date: Tue, 26 Jan 2021 09:48:13 +0000
> Cc: Tom Tromey <tom@tromey.com>
>
> From: Tom Tromey <tom@tromey.com>
>
> This adds a new command to change GDB to behave as though "-quiet"
> were always given. This new command can be added to the gdbstartup
> 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.

Thanks.

> +set startup-quietly on|off
> +show startup-quietly
> + When enabled, this causes GDB to act as if "-silent" were always
> + passed on the command line. This command needs to be added to a
> + gdbstartup file in order to affect GDB.

What is "gdbstartup file"?

Also, the manual seems to describe the use of this feature
differently:

> +@kindex set startup-quietly
> +@kindex show startup-quietly
> +This can also be enabled using @code{set startup-quietly on}. The
> +default is @code{off}. Use @code{show startup-quietly} to see the
> +current setting. Changing this setting will have no affect on the
> +current @value{GDBN} session. Add @code{set startup-quietly on} to
> +the startup command file (@pxref{Initialization Files,,Initialization
> +Files}) to affect future @value{GDBN} sessions.

Why is there a difference between the two descriptions?

Also, the sentence starting with "Changing this setting will have" is
slightly confusing, because it is not absolutely clear that it refers
only to the "set" command issued from the CLI, and does NOT affect the
startup file setting. Could you please clarify this text?