From: Eli Zaretskii via Gdb-patches <gdb-patches@sourceware.org>
To: Andrew Burgess <andrew.burgess@embecosm.com>
Cc: tom@tromey.com, gdb-patches@sourceware.org
Subject: Re: [PATCH 4/7] gdb: process startup files and startup command line options
Date: Thu, 08 Oct 2020 09:28:41 +0300 [thread overview]
Message-ID: <83k0w18c4m.fsf@gnu.org> (raw)
In-Reply-To: <d464f7cdbe25902c687e6e1a5904a84fb082d493.1601927355.git.andrew.burgess@embecosm.com> (message from Andrew Burgess on Wed, 7 Oct 2020 21:05:08 +0100)
> From: Andrew Burgess <andrew.burgess@embecosm.com>
> Date: Wed, 7 Oct 2020 21:05:08 +0100
> Cc: Tom Tromey <tom@tromey.com>
>
> 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.
Thanks. Some comments about the documentation parts below.
> diff --git a/gdb/NEWS b/gdb/NEWS
> index c64dda7bbcb..bd3aca84d51 100644
> --- a/gdb/NEWS
> +++ b/gdb/NEWS
> @@ -21,6 +21,17 @@
> $HOME/.gdbinit. On Apple hosts the search order is instead:
> $HOME/Library/Preferences/gdb/gdbinit, $HOME/.gdbinit.
>
> +* GDB will now load and process commands from
> + ~/.config/gdb/gdbstartup, ~/.gdbstartup, or a local file
> + ./.gdbstartup if these files are present. These files are processed
> + earlier than any of the previous initialization files and can effect
^^^^^^
"affect"
> + parts of GDB's startup that previously had already been completed
> + before the initialization files were read.
This begs the question: such as?... Can we at least say something
about that here?
> +* GDB now has two new options "--startup-command" and
> + "--startup-eval-command" with corresponding short options "-sx" and
> + "-sex" that allow startup options to be passed on the command line.
What are "startup options" for this matter? Perhaps an example will
be enough to explain that.
> +@item
> +@cindex startup file
> +Reads startup options from the startup file (if any) in your home
> +directory, followed by any startup options contained in a startup file
> +(if any) in the local directory as long as @samp{set auto-load
> +local-gdbinit} is set to @samp{on} (@pxref{Init File in the Current
> +Directory}), @pxref{Local directory startup file}.
> +
> +@item
> +Any startup command line options (@samp{startup-command} and
> +@samp{startup-eval-command}) are processed.
The previous @item uses the style of others in the list ("Reads ..."),
but this item suddenly switches to a different style. Suggest to
reword:
Processes any startup command-line options ...
> +The files processed are split into two categories @dfn{startup files}
> +and @dfn{initialization files}. The startup files are loaded as
> +early as possible during @value{GDBN}'s startup and allow a limited
> +set of settings to be configured that can affect how the rest of
> +@value{GDBN} starts up. The more general initialization files are
> +processed later after @value{GDBN} has finished its own internal
> +startup process, any commands can be used in these files.
This again leaves unexplained the practical difference between these
two classes. I as a reader am left wondering what kind of commands
and settings would I need to put in the startup files, and why.
Please add some text that explains this, preferably with a couple of
examples.
> +On non-Apple hosts the locations searched are:
> +@table @file
> +@item $XDG_CONFIG_HOME/gdb/gdbstartup
> +@item $HOME/.config/gdb/gdbstartup
> +@item $HOME/.gdbstartup
> +@end table
This should be @itemize, not @table. Also, I wonder whether it is
wise to use the $FOO notation here, as that is a Posix shell-ism. How
about something like this instead:
@item
The @file{gdb/gdbstartup} subdirectory of the directory pointed to
by the environment variable @env{XDG_CONFIG_HOME}, if it is defined.
> +While on Apple hosts the locations searched are:
> +@table @file
> +@item $HOME/Library/Preferences/gdb/gdbstartup
> +@item $HOME/.gdbstartup
> +@end table
I wonder why we make special case for Apple system, but not for
MS-Windows (which also has its own conventions for user-private
settings directories).
> +@anchor{Local directory startup file}
> +@subsubsection Local directory startup file
Instead of @anchor, how about using @node (here and elsewhere)?
> +@value{GDBN} will check the current directory for a file called
> +@file{./.gdbstartup}.
I think the "./" part is redundant here, you already say that the file
is looked up in the current directory.
next prev parent reply other threads:[~2020-10-08 6:28 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-07 20:05 [PATCH 0/7] Adding startup files to GDB Andrew Burgess
2020-10-07 20:05 ` [PATCH 1/7] Add get_standard_config_dir function Andrew Burgess
2020-10-07 20:05 ` [PATCH 2/7] gdb: use get_standard_config_dir when looking for .gdbinit Andrew Burgess
2020-10-08 6:52 ` Eli Zaretskii via Gdb-patches
2020-11-02 10:20 ` Andrew Burgess
2020-10-22 19:07 ` Tom Tromey
2020-11-09 13:52 ` Tom Tromey
2020-11-09 13:55 ` Tom Tromey
2020-10-07 20:05 ` [PATCH 3/7] gdb: new function to wrap up executing command line scripts/commands Andrew Burgess
2020-10-08 15:25 ` Aktemur, Tankut Baris via Gdb-patches
2020-11-02 9:48 ` Andrew Burgess
2020-10-22 19:08 ` Tom Tromey
2020-10-07 20:05 ` [PATCH 4/7] gdb: process startup files and startup command line options Andrew Burgess
2020-10-08 6:28 ` Eli Zaretskii via Gdb-patches [this message]
2020-10-07 20:05 ` [PATCH 5/7] gdb: add mechanism to auto-save startup options Andrew Burgess
2020-10-08 6:36 ` Eli Zaretskii via Gdb-patches
2020-10-07 20:05 ` [PATCH 6/7] Let the user control the startup style Andrew Burgess
2020-10-08 6:40 ` Eli Zaretskii via Gdb-patches
2020-10-07 20:05 ` [PATCH 7/7] Add "set startup-quietly" Andrew Burgess
2020-10-08 6:44 ` Eli Zaretskii via Gdb-patches
2020-10-08 6:56 ` [PATCH 0/7] Adding startup files to GDB Eli Zaretskii via Gdb-patches
2020-10-22 19:02 ` Tom Tromey
2020-10-28 15:29 ` Andrew Burgess
2021-01-11 16:45 ` Andrew Burgess
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83k0w18c4m.fsf@gnu.org \
--to=gdb-patches@sourceware.org \
--cc=andrew.burgess@embecosm.com \
--cc=eliz@gnu.org \
--cc=tom@tromey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox