From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1430 invoked by alias); 21 Dec 2019 20:16:14 -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 128749 invoked by uid 89); 21 Dec 2019 20:16:08 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-12.2 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_1,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.1 spammy=imagine, suggestions X-HELO: mailsec106.isp.belgacom.be Received: from mailsec106.isp.belgacom.be (HELO mailsec106.isp.belgacom.be) (195.238.20.102) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 21 Dec 2019 20:15:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=skynet.be; i=@skynet.be; q=dns/txt; s=securemail; t=1576959355; x=1608495355; h=message-id:subject:from:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=xl2AkMq6BEUqlAKIGVn62UaeJ1ChqnphALnaB55/YiM=; b=WdllssmmARn/3dpPRw03ilHvSD/7AL/Htmo78lpHzlMg7XK8sIoDsN2k d5xtXxZBu6BRrg8uXuBdwuOd5iG8CQ==; IronPort-SDR: vrsteRdp68T37+EeECyhYAYh/hk0RseaqaUoc/+QPcnYzNa0Jgh465NWUk/BUj13HrXh/HVw4b bdBQF6rU12HIRCztYOJd1kO9MIqMRe/YMuDuenOSyzjQxiGCSoZBU/p/jvQa1SrWMCD1YmL9ly MmwWTSZfOeX0ccpCs0CoIan9qdYNY4luY1P8yWVLQkDTyCv/bJ7f3ZZKgVVS4CuHIKsyUsDX2v 4loKrhgPFMhInU/kZqvh42FYr2ILUPF2TMu5BrVVSpTralNXP+vM4dmziyc2sybN1h1/weTeU1 uQI= Received: from 156.47-242-81.adsl-dyn.isp.belgacom.be (HELO md) ([81.242.47.156]) by relay.skynet.be with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 21 Dec 2019 21:15:48 +0100 Message-ID: Subject: Re: [RFA 3/3] Document 'set|show exec-file-mismatch (reload|warn|off)' From: Philippe Waroquiers To: Eli Zaretskii Cc: gdb-patches@sourceware.org Date: Sat, 21 Dec 2019 20:16:00 -0000 In-Reply-To: <83o8w1zi8u.fsf@gnu.org> References: <20191221143632.15990-1-philippe.waroquiers@skynet.be> <20191221143632.15990-4-philippe.waroquiers@skynet.be> <83o8w1zi8u.fsf@gnu.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5-1.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2019-12/txt/msg00945.txt.bz2 Thanks for the detailed comments, I will fix/improve according to your suggestions. However, your comments make me think that the words used in the command itself might have to be improved, as the word "reload" seems confusing. I will try to clarify what "reload" currently does using an example. Imagine you have 2 running processes: process PID 123 running program xxxxx process PID 345 running program yyyyy When GDB attaches to 123, it determines that the program is xxxxx. When detaching, and then attaching to 345, GDB git master version *silently keeps* xxxxx as exec-file for PID 345. When the below new option is reload or warn, when attaching to 345, GDB will determine that the exec-file of 345 is yyyyy. It then compares the file name yyyyy with the current exec file xxxxx, and because file differs, it will warn the user and (for reload option) ask the user if the exec-file yyyyy must be reloaded. So, "reload" does not mean: "reload the same file if it was changed on disk", it means "reload a new exec-file, because the PID we attach to runs another exec-file". Note that with the above 2 processes, GDB git master similarly uses the wrong file if you do: gdb xxxxx (gdb) attach 345 => GDB now silently uses the (wrong) file xxxxx to debug 345. That is equally solved (or warned) with the new option. So, maybe "reload" in 'set exec-file-mismatch reload|warn|off' should be replaced by a less confusing word? Maybe 'set exec-file-mismatch ask-to-load|warn|off' ? Feedback ? Any other suggestion ? Thanks Philippe On Sat, 2019-12-21 at 19:44 +0200, Eli Zaretskii wrote: > > From: Philippe Waroquiers > > Cc: Philippe Waroquiers > > 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.