From patchwork Sat Jan 11 18:10:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Waroquiers X-Patchwork-Id: 37304 Received: (qmail 15201 invoked by alias); 11 Jan 2020 18:11:20 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 15128 invoked by uid 89); 11 Jan 2020 18:11:19 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=faster, yyyymmdd, yyyy-mm-dd, examine X-HELO: mailsec113.isp.belgacom.be Received: from mailsec113.isp.belgacom.be (HELO mailsec113.isp.belgacom.be) (195.238.20.109) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 11 Jan 2020 18:11:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=skynet.be; i=@skynet.be; q=dns/txt; s=securemail; t=1578766276; x=1610302276; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=EgM9RuN0ql5Z5Xxk4ln7bFcEw/rRyL8gPJOljiIu21U=; b=vtbGT/U0PN3AbiaPH7RUpfdZfg+2zv4R5IHpIeO1HlMDdEowuC3Wv+SG DQBlevEImPbN+Y9LwVDE5I9McK6r7w==; IronPort-SDR: 0mElPFdXFZ8UrurzTDhEzNfb+NSW7NutIWA/H7ljvIDKT4CW+/qLETEwxYsr1h6EIeEUi4RJW2 Q96WjwkY6JqFwW8VXtFNno+drcYABGlUW/5UBJyw7Txjn1pv7/7YNHKPE2oztjbw1l15WLoVmk DpDVdkZC5RNzOZS6uw2thdJL7KHlYJtgahstwCAX4pr/H3NuCS6K2LjtDKC4kVuTD7FG3Mje6C wd2+RtbKoadvdeQnTDLf4dP0qrd8HspvVzUEkiJHJzyplWfkZTDFCSrctQATBkyFMeDIIDfGKk fno= Received: from 156.47-242-81.adsl-dyn.isp.belgacom.be (HELO md.home) ([81.242.47.156]) by relay.skynet.be with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 11 Jan 2020 19:10:47 +0100 From: Philippe Waroquiers To: gdb-patches@sourceware.org Cc: Philippe Waroquiers Subject: [RFAv2 3/3] Document 'set|show exec-file-mismatch (ask|warn|off)' Date: Sat, 11 Jan 2020 19:10:41 +0100 Message-Id: <20200111181041.7163-4-philippe.waroquiers@skynet.be> In-Reply-To: <20200111181041.7163-1-philippe.waroquiers@skynet.be> References: <20200111181041.7163-1-philippe.waroquiers@skynet.be> MIME-Version: 1.0 X-IsSubscribed: yes Mention in NEWS the new option and the set/show commands. Document in gdb.texinfo the new option and the set/show commands. 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. Some more doc changes some more doc changes --- gdb/NEWS | 13 +++++++++++++ gdb/doc/gdb.texinfo | 30 ++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/gdb/NEWS b/gdb/NEWS index 1305eceeca..d4e2e70f38 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -10,6 +10,19 @@ that support it (see entry for GDB 9, below), providing faster performance for programs with many symbols. +* New commands + +set exec-file-mismatch -- Set exec-file-mismatch handling (ask|warn|off). +show exec-file-mismatch -- Show exec-file-mismatch handling (ask|warn|off). + Set or show the option 'exec-file-mismatch'. When GDB attaches to + a running process and can determine the name of the executable file + the process runs, this new option indicates whether to detect mismatch + between the name of the current executable file loaded by GDB + and the name of the executable file used to start the process. + If 'ask', the default, display a warning and ask the user + whether to load the process executable file; if 'warn', just display + a warning; if 'off', don't attempt to detect a mismatch. + *** 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 67882d0cd8..2a38b03f33 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -2905,6 +2905,30 @@ 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 name of the executable file running +in the process it is attaching to, and this file name does not match +the name of the current exec-file loaded by @value{GDBN}, 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{ask|warn|off} + +Whether to detect mismatch between the name of the current executable +file loaded by @value{GDBN} and the name of the executable file used to +start the process. If @samp{ask}, the default, display a warning +and ask the user whether to load the process executable file; if +@samp{warn}, just display a warning; if @samp{off}, don't attempt to +detect a mismatch. + +@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 @@ -21839,6 +21863,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 executable file 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 executable file name running in the process and the name of the +current exec-file loaded by @value{GDBN} (@pxref{set exec-file-mismatch}). + @end table @anchor{Host and target files}