From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4901 invoked by alias); 21 Dec 2019 14:36:43 -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 4597 invoked by uid 89); 21 Dec 2019 14:36:43 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-9.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.1 spammy=UD:be, UD:attach.exp, attachexp, attach.exp X-HELO: mailsec109.isp.belgacom.be Received: from mailsec109.isp.belgacom.be (HELO mailsec109.isp.belgacom.be) (195.238.20.105) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 21 Dec 2019 14:36:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=skynet.be; i=@skynet.be; q=dns/txt; s=securemail; t=1576939000; x=1608475000; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=38sqslc0wHKr76/w4grsRzrAG5xfc0ugJj1ACbysrpU=; b=ajS3ox8djdt597xbZpu9FlRQ+I3mcWYD1p55RFriccFiOsnHx9iDO0Ad y3CZRCwTndkSBG079UuMDp+z/qG0Eg==; IronPort-SDR: cLjw+4xbYBTHFSHpb996aA5URGXVvR7cduucbTDiFF0dXOr/Y88HOHd3FiE93txQLYPikBBCEt /DlwVepHc0J0Sdca2AMhx3LGZISl7nsU86nLVbHuINwWbP8F1yhGw8mkw48fWIIYC+y0yqJY/U OEGsnLJJtTQ0ij0aw+t7xunRQD0Ps0K8TENkhny1tpke66c1OjoYh5FmvDdTcr9sXTySj7Sz4I h9sUgm+9FA8xHwz1V04riZm1l75ud2tvc0ofyoUnIdTzMXF93FITGCabf2Tw5eCKxDXPQuKx8Q wtY= 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; 21 Dec 2019 15:36:38 +0100 From: Philippe Waroquiers To: gdb-patches@sourceware.org Subject: [RFA 1/3] New option 'set exec-file-mismatch (reload|warn|off)'. Fixes PR gdb/17626. Date: Sat, 21 Dec 2019 14:36:00 -0000 Message-Id: <20191221143632.15990-1-philippe.waroquiers@skynet.be> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2019-12/txt/msg00937.txt.bz2 New option 'set exec-file-mismatch (reload|warn|off)'. Fixes PR gdb/17626. This option allows to tell GDB to detect and possibly handle mismatched exec-files. A recurrent problem with GDB is that GDB uses the wrong exec-file when using the attach/detach commands successively. Also, in case the user specifies a file on the command line but attaches to the wrong PID, this error is not made visible and gives a not user understandable behaviour. RFA 1/3 Implement 'set/show exec-file-mismatch'. implements the option. RFA 2/2 modifies gdb.base/attach.exp to test the option. RFA 3/3 documents the option in NEWS and in gdb.texinfo Compared to the RFC, this version handles the comments of Tom. Some feedback related to these comments: * I have styled the warning/error messages mentionning files in exec.c, but styling in such messages only works with the patch: [RFA] Ensure GDB warnings are styled. https://sourceware.org/ml/gdb-patches/2019-12/msg00691.html * Related to new lines in the warning message: many other warning messages have new lines. I have kept them, as it looks to me that the message is more clear like that. Of course, I can remove them if deemed better without. * What happens if the inferior execs another program ? This option only controls the behaviour when attaching to a running program. The behaviour of 'exec' is not changed: GDB already properly determines the executable to use after exec.