From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailsec214.isp.belgacom.be (mailsec214.isp.belgacom.be [195.238.22.110]) by sourceware.org (Postfix) with ESMTPS id 8D9A93848009 for ; Thu, 20 May 2021 08:02:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8D9A93848009 IronPort-SDR: 2WgWn7hQg/wJmroNqGzc1fujA7IEiHHJt6tpImFI911PRvOt9z33QFCdnvvjurY1QP5BaL4wTW 4HWiq1scMILr+whGXBTFUNItFDl/7nB+eVSRqFWi/AWkPnFYp8gwnjPuaWCaAN/sxuJWLX4KR6 RwrNjueChfbEHu2MlXbfsgVHf+IBqvGa2duVjVR2kSjKAH5IeMC9PKwO9IHSzRWSEVEhf35onw LtH0S/U79y29cLMemdgsRva0p4evXY5FxChrzqSSEZSsZ6pIkTMJYupbZmLyKhERiMiOqzyTcZ xcM= X-IPAS-Result: =?us-ascii?q?A2CGAwANF6Zg/yFRiNlagQkJgU6DIlZrhARGiQSIdgM4A?= =?us-ascii?q?Zp2gWgLAQEBAQEBAQEBCTUJAQIEAQGETwKBfyY3Bg4CBAEBAQEDAgMBAQEBB?= =?us-ascii?q?QEBBgEBAQEBAQUEAYEDhRc5DYI4KQGDYwEFIzMzCAMYAgImAgJXBgESgnKDC?= =?us-ascii?q?wupI4EygQGEZYNLgT4GgRAqhwmCY4N3N4FVRIQILz6CYQQYgREBEQIBgzeCY?= =?us-ascii?q?wSCdE4bAxEQBFRsGZILi3mBKp0ALAeDGYEjBguIT5NJKKVDlTeMDJgogWqBD?= =?us-ascii?q?XBtgzxQJ5cjhUtCLzgCBgoBAQMJdAgTiAsBAQ?= IronPort-PHdr: A9a23:hhL2Ix3DL2uXVN5OsmDOsgMyDhhOgF0UFjAc5pdvsb9SaKPrp82kY BWOo68y1BSQBN+TwskHotKei7rnV20E7MTJm1E5W7sIaSU4j94LlRcrGs+PBB6zBvfraysnA JYKDwc9rDm0PkdPBcnxeUDZrGGs4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zdoMgy1knxilNoH1uA6ilfq WV98jzuiWbtN98YhwdcKm7WJVoIkmskKKdg7N6AV7KZmCPhILPFuBfBODZrAEIdReTygZavZ 0QEZSXDLXLfDtHsfo= X-IronPort-Anti-Spam-Filtered: true Received: from 33.81-136-217.adsl-dyn.isp.belgacom.be (HELO md) ([217.136.81.33]) by relay.proximus.be with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 May 2021 10:02:45 +0200 Message-ID: Subject: Re: [RFC][gdb/cli] Ignore error in gdb command script From: Philippe Waroquiers To: Tom de Vries , Tom Tromey , Simon Marchi via Gdb-patches Date: Thu, 20 May 2021 10:02:44 +0200 In-Reply-To: <0ad1098c-3a3a-6f49-6f46-811b0260cf1e@suse.de> References: <20210518095958.GA22771@delia> <44B64C9E-9E19-47BD-80CD-0C660C7A9D94@undo.io> <453ffcaa-2a21-62a7-d449-28c7c187231a@polymtl.ca> <87im3g14ss.fsf@tromey.com> <767cfa6e293d63526275fe614bb6afa108a662b7.camel@skynet.be> <0ad1098c-3a3a-6f49-6f46-811b0260cf1e@suse.de> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5-1.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 May 2021 08:02:50 -0000 On Tue, 2021-05-18 at 23:59 +0200, Tom de Vries wrote: > On 5/18/21 9:16 PM, Philippe Waroquiers wrote: > > > > On Tue, 2021-05-18 at 17:16 +0200, Tom de Vries wrote: > > > On 5/18/21 4:42 PM, Tom Tromey wrote: > > > > > > > > > "Simon" == Simon Marchi via Gdb-patches writes: > > > > > > > > Simon> That sounds useful. I think that "ignore-errors" is a good initial > > > > Simon> name, because it's clear and self-describing. We can always find and > > > > Simon> add a short alias later. > > > > > > > > Fedora has shipped a Python implementation of exactly this for a while now. > > > > So, +1 for this name and approach from me. > > > > > > > > One question is whether it should catch 'quit'. I tend to think not but > > > > it should be considered. > > > > > > > > There is some other prior art too: > > > > > > > > https://sourceware.org/bugzilla/show_bug.cgi?id=8487 > > > > > > > > ignore-errors covers all the uses I've ever wanted personally, though, > > > > so I think it would be fine to just go with that. However if someone is > > > > feeling more maximal, try-catch would also be an ok addition. > > > > > > [ Thanks all for the feedback. Replying to latest email, CC-ing Andrew. ] > > > > > > Changes: > > > - now a proper command > > Instead of adding an ignore-errors command, an alternative could be to implement > > this via a new GDB setting 'set ignore-errors on|off'. > > > > This allows to do e.g. > > with ignore-errors on -- some-command > > or (shorter form): > > with ignore-errors -- some-command > > or when needed > > with ignore-errors off -- some-command > > > > This also allows to use > > set ignore-errors on > > ... > > at the beginning of a script and/or in .gdbinit > > and/or as a -ex 'set ignore-errors on' gdb startup arg. > > > > > > Also, an alias can be defined such as: > > alias ie = with ignore-errors on -- > > > > Hi Philippe, > > good ideas, I'd say, but for now I just want to do the basic > functionality as it has been available and used for some time. > > This could be implemented as follow-up patch, and I don't see a problem > with that approach. Not too sure to understand what is meant by 'follow-up' patch as the approaches are not really aligned: implementing the 'setting approach' later will then add a different way rather than extend this one. For what concerns the naming of the ignore-errors command (discussed in another mail e.g. as it it makes 'ignore' abbreviations ambiguous): it is worth mentioning that 'thread apply' and 'frame apply' have -c and -s arguments to indicate respectively 'print any error and continue' and 'silently ignore any error'. So, maybe the naming of the new setting could be set error-handling [abort-execution|print-and-continue|silently-ignore] (default value abort-execution). If the 'setting approach' is not the initial absolutely to do preferred approach :), then the command could be: error-handle [-a|-c|-s] [--] COMMAND (with -c being the default if no flag specified). Thanks Philippe