Re: [PATCHv2 2/3] gdb: process startup files and startup command line options

Simon Marchi via Gdb-patches
2021-01-26T15:30:44Z

On 2021-01-26 4:48 a.m., Andrew Burgess wrote:> Adds the ability to process commands at a new phase during GDB's
> startup. This phase is earlier than the current initialisation file
> processing, before GDB has produced any output.
>
> The number of commands that can be processed at this early stage will
> be limited, and it is expected that the only commands that would be
> processed at this stage will relate to some of the fundamentals of how
> GDB starts up.
>
> Currently the only commands that it makes sense to add to this startup
> file are those like 'set style version ....' as the version string is
> displayed during startup before the standard initialization files are
> parsed. As such this commit fully resolved bug cli/25956.
>
> This commit adds a mechanism to find these startup files as well as
> some corresponding command line flags.
>
> The startup files that GDB will currently check for are
> ~/.config/gdb/gdbstartup (on Linux like systems) or ~/.gdbstartup if
> the former is not found.
>
> The output of 'gdb --help' has been extended to include a list of the
> startup files being processed.

Functionally, that all LGTM.

Sorry if I'm late to the game, but I have to admit that I find the name
a bit confusing. If I didn't already know which is which, I couldn't
tell which of "init" and "startup" happens earlier than the other.
"init" and "earlyinit" would be unambiguous, for example. But this is a
minor detail, feel free to ignore. The documentation still makes it
clear.

Simon