Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Christian Biesinger via gdb-patches" <gdb-patches@sourceware.org>
To: Philippe Waroquiers <philippe.waroquiers@skynet.be>
Cc: gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [RFA 3/3] Document 'set|show exec-file-mismatch (reload|warn|off)'
Date: Sun, 22 Dec 2019 02:46:00 -0000	[thread overview]
Message-ID: <CAPTJ0XFS8ey34xpdHxU-uX_qiyLxv3WoQPpa1_hXu_eB5LNkUQ@mail.gmail.com> (raw)
In-Reply-To: <20191221143632.15990-4-philippe.waroquiers@skynet.be>

On Sat, Dec 21, 2019, 09:37 Philippe Waroquiers <
philippe.waroquiers@skynet.be> wrote:

> Mention in NEWS the new option and the set/show commands.
>
> Document in gdb.texinfo the new option and the set/show commands.
>

When would someone set this to off, or even warn? I'm wondering is it makes
sense to add this setting vs always having the reload behavior?


> gdb/ChangeLog
> YYYY-MM-DD  Philippe Waroquiers  <philippe.waroquiers@skynet.be>
>
>         * NEWS: Mention the new option and the set/show commands.
>
> gdb/doc/ChangeLog
> YYYY-MM-DD  Philippe Waroquiers  <philippe.waroquiers@skynet.be>
>
>         * gdb.texinfo (Attach): Document the new option and the
>         set/show commands.
>         (Connecting): Reference the exec-file-mismatch option.
> ---
>  gdb/NEWS            | 12 ++++++++++++
>  gdb/doc/gdb.texinfo | 31 +++++++++++++++++++++++++++++++
>  2 files changed, 43 insertions(+)
>
> diff --git a/gdb/NEWS b/gdb/NEWS
> index ee10914fd8..1a90862b0d 100644
> --- a/gdb/NEWS
> +++ b/gdb/NEWS
> @@ -3,6 +3,18 @@
>
>  *** Changes since GDB 9
>
> +* New commands
> +
> +set exec-file-mismatch -- Set exec-file-mismatch handling
> (reload|warn|off).
> +show exec-file-mismatch -- Show exec-file-mismatch handling
> (reload|warn|off).
> +  Set or show the option 'exec-file-mismatch'.  When GDB attaches to
> +  a running program and can determine the running program, this new option
> +  indicates how to handle a mismatch between the current exec-file and
> +  the automatically detected file.
> +  'reload' is the default value: in case of mismatch, GDB will warn the
> user
> +  and reload the automatically determined file after user confirmation.
> +
> +
>  *** Changes in GDB 9
>
>  * 'thread-exited' event is now available in the annotations interface.
> diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
> index 4d25f755d7..a246ba0bf5 100644
> --- a/gdb/doc/gdb.texinfo
> +++ b/gdb/doc/gdb.texinfo
> @@ -2904,6 +2904,31 @@ the program is not found) by using the source file
> search path
>  the @code{file} command to load the program.  @xref{Files, ,Commands to
>  Specify Files}.
>
> +@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.
> +
> +@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}.
> +
> +
> +@cindex show exec-file-mismatch
> +@item show exec-file-mismatch
> +Show the current value of @code{exec-file-mismatch}.
> +
> +@end table
> +
>  The first thing @value{GDBN} does after arranging to debug the specified
>  process is to stop it.  You can examine and modify an attached process
>  with all the @value{GDBN} commands that are ordinarily available when
> @@ -21780,6 +21805,12 @@ established.  If you are using @code{gdbserver},
> you may also invoke
>  @code{gdbserver} using the @option{--attach} option
>  (@pxref{Running gdbserver}).
>
> +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}).
> +
>  @end table
>
>  @anchor{Host and target files}
> --
> 2.20.1
>
>


  parent reply	other threads:[~2019-12-22  2:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-21 14:36 [RFA 1/3] New option 'set exec-file-mismatch (reload|warn|off)'. Fixes PR gdb/17626 Philippe Waroquiers
2019-12-21 14:36 ` [RFA 2/3] Test 'set exec-file-mismatch reload|warn|off' Philippe Waroquiers
2019-12-21 14:36 ` [RFA 1/3] Implement 'set/show exec-file-mismatch' Philippe Waroquiers
2020-01-08  0:58   ` Tom Tromey
2019-12-21 14:36 ` [RFA 3/3] Document 'set|show exec-file-mismatch (reload|warn|off)' Philippe Waroquiers
2019-12-21 17:44   ` Eli Zaretskii
2019-12-21 20:16     ` Philippe Waroquiers
2019-12-22 18:20       ` Eli Zaretskii
2019-12-22  2:46   ` Christian Biesinger via gdb-patches [this message]
2019-12-22  9:09     ` Philippe Waroquiers
2020-01-08  0:52     ` Tom Tromey

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=CAPTJ0XFS8ey34xpdHxU-uX_qiyLxv3WoQPpa1_hXu_eB5LNkUQ@mail.gmail.com \
    --to=gdb-patches@sourceware.org \
    --cc=cbiesinger@google.com \
    --cc=philippe.waroquiers@skynet.be \
    /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