Re: [RFA 3/3] Document 'set|show exec-file-mismatch (reload|warn|off)'

Eli Zaretskii
2019-12-21T17:44:37Z

> From: Philippe Waroquiers <philippe.waroquiers@skynet.be>
> Cc: Philippe Waroquiers <philippe.waroquiers@skynet.be>
> Date: Sat, 21 Dec 2019 15:36:32 +0100
>
> + Set or show the option 'exec-file-mismatch'. When GDB attaches to
> + a running program and can determine the running program, this new option

"attached to a running program and can determine the running program"
sounds strange and confusing (if GDB has attached to a program, it
should not have any trouble determining it, right?). I guess you
meant something like

When GDB attaches to a running process, and can determine the
executable program file the process runs, this new option ...

> + indicates how to handle a mismatch between the current exec-file and
> + the automatically detected file.

Here, instead of "current exec-file" I'd use "the program file on
disk", and instead of "automatically detected" I'd use "the program
file used to start the process". The main point is not to introduce
terminology not referenced in previous text, otherwise you risk losing
or confusing the reader.

> + and reload the automatically determined file after user confirmation.

Well, the "automatically determined file" can no longer be reloaded,
since it was updated on disk, right?

> +@anchor{set exec-file-mismatch}
> +If the debugger can determine the program running in the process
> +and this program does not match the current exec-file, the option
> +@code{exec-file-mismatch} specifies how to handle the mismatch.

Suggest to explain how the mismatch is determined, because otherwise
this text sounds unclear and maybe confusing.

> +@table @code
> +@kindex exec-file-mismatch
> +@cindex set exec-file-mismatch
> +@item set exec-file-mismatch @samp{reload|warn|off}
> +In case of mismatch between the current exec-file and the automatically
> +determined exec-file of the PID the debugger is attaching to,
> +@samp{reload} indicates to give a warning to the user and reload
> +the automatically determined exec-file. The user will be asked to
> +confirm the loading of the automatically determined file.
> +With @samp{warn}, @value{GDBN} just gives a warning to the user to
> +signal the mismatch. @samp{off} indicates to not check for mismatch.
> +The default value is @samp{reload}.

I'd reword this text as follows:

Whether to detect mismatch between the program file used to start
the process and the current executable file of that program on disk.
If @samp{reload}, the default, display a warning and ask the user
whether to reload the program's file; if @samp{warn}, just display a
warning; if @samp{off}, don't attempt to detect a mismatch.

> +Some remote targets allow @value{GDBN} to determine the program running
> +in the process the debugger is attaching to. In such a case, @value{GDBN}
> +uses the value of @code{exec-file-mismatch} to handle a possible mismatch
> +between the program running in the process and the current exec-file.
> +(@pxref{set exec-file-mismatch}).

The period before @pxref in parentheses is redundant and should be
removed.

Thanks.