This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 3/3 v2] Load system gdbinit files from a directory
> Date: Sun, 25 Aug 2019 19:33:10 -0500
> From: "Christian Biesinger via gdb-patches" <gdb-patches@sourceware.org>
> Cc: Christian Biesinger <cbiesinger@google.com>
>
> Adds a configure option --with-system-gdbinit-dir to specify a directory
> in which to look for gdbinit files. All files in this directory are
> loaded on startup (subject to -n/-nx as usual).
I think this option's value should be displayed by "show
configuration" and by "gdb --config".
> +* If configured with --with-system-gdbinit-dir, GDB will now also load
I think "also" here might be confusing, because it lacks context. I
think we should say explicitly "in addition to the system-wide gdbinit
file" instead.
> + all files in that directory as system gdbinit files, unless the -nx
> + or -n flag is provided. These files can be written in any supported
Two spaces between sentences (here and elsewhere throughout the
patch).
> +@item @file{system.gdbinit.d}
> +This is the system-wide init directory.
> +Its location is specified with the @code{--with-system-gdbinit-dir}
> +configure option (@pxref{System-wide configuration}).
> +Files in this directory are loaded immediately after system.gdbinit (if
> +enabled) when @value{GDBN} starts, before command line options have been
> +processed.
I'm not sure I understand: _all_ files in that directory will be
loaded, regardless of how they are named? If so, I think we should
say that explicitly. We should probably also say that the order the
files are loaded is arbitrary. Also, we should say something about
that directory including subdirectories, because I think the reader
might wonder about that.
> @cindex init file
> Reads the system-wide @dfn{init file} (if @option{--with-system-gdbinit} was
> used when building @value{GDBN}; @pxref{System-wide configuration,
> - ,System-wide configuration and settings}) and executes all the commands in
> -that file.
> + ,System-wide configuration and settings}) and the files in the system-wide
> +gdbinit directory (if @option{--with-system-gdbinit-dir} was used) and executes
> +all the commands in those files. If scripting languages are enabled, the files
> +can be written in any of the supported languages as long as the extension matches
> +the language.
Is the order of reading as described, i.e. the file first, then the
files in the directory?
Btw, how does this option interact with auto-load safe-path? Would
GDB refuse to load init files from this directory if it considers them
"unsafe"?
> +@item --with-system-gdbinit-dir=@var{directory}
> +Configure @value{GDBN} to automatically load init files from a
> +system-wide directory. @var{directory} should be an absolute path.
^^^^^^^^^^^^^
"absolute file name". The Gnu Coding Standards frown on using "path"
for anything that is not PATH-style lists of directories.
> +@ifset SYSTEM_GDBINIT
> +@value{SYSTEM_GDBINIT_DIR}/*
> +@end ifset
@ifset SYSTEM_GDBINIT or @ifset SYSTEM_GDBINIT_DIR?
Thanks.