From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 53117 invoked by alias); 22 Dec 2019 02:46:45 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 53108 invoked by uid 89); 22 Dec 2019 02:46:44 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-29.7 required=5.0 tests=AWL,BAYES_00,ENV_AND_HDR_SPF_MATCH,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,USER_IN_DEF_SPF_WL autolearn=ham version=3.3.1 spammy=HX-Received:1e11, HX-Received:sk:s17mr23, H*c:alternative X-HELO: mail-ot1-f47.google.com Received: from mail-ot1-f47.google.com (HELO mail-ot1-f47.google.com) (209.85.210.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 22 Dec 2019 02:46:42 +0000 Received: by mail-ot1-f47.google.com with SMTP id r27so17319726otc.8 for ; Sat, 21 Dec 2019 18:46:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QRF0/+p1o4EfNHnsstag2sVzeoWn73yrUB6Ng9h5DeE=; b=S295VvM5k9ccGypfEWVDgSH/M2f4P6tV5h+QDomEd5hYhPtymQCaJPVkwKbF1OwvzK PLnyKMfXWzUNIlQE6zGntlrDcWNX8ZvIlvrECFri87eE4a9bgnzaxJJ9a+n7p2oTDZgZ 3zz4waxVF8LjgBkbt3qqi+dSZ0LkYrN0090/66pqIZCLD5CW+HNPOnZrwmybN1za9zG8 4lmyFUgGVgKvElW7I00HBx+Vk+LuGw9nrc/QviZ/uSM3RxwqRGPkZA8WuDMX0vZfTo62 jVyOcLi/OWBJeUugDFTwkhU6VhSjBAiaAX7/aOGc+5Pgn9Xhj+Gbza1fpFoPywko/I1S pubA== MIME-Version: 1.0 References: <20191221143632.15990-1-philippe.waroquiers@skynet.be> <20191221143632.15990-4-philippe.waroquiers@skynet.be> In-Reply-To: <20191221143632.15990-4-philippe.waroquiers@skynet.be> From: "Christian Biesinger via gdb-patches" Reply-To: Christian Biesinger Date: Sun, 22 Dec 2019 02:46:00 -0000 Message-ID: Subject: Re: [RFA 3/3] Document 'set|show exec-file-mismatch (reload|warn|off)' To: Philippe Waroquiers Cc: gdb-patches Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2019-12/txt/msg00951.txt.bz2 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 > > * NEWS: Mention the new option and the set/show commands. > > gdb/doc/ChangeLog > YYYY-MM-DD Philippe Waroquiers > > * 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 > >