From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id Fm6xKcM4pGCLJQAAWB0awg (envelope-from ) for ; Tue, 18 May 2021 17:59:31 -0400 Received: by simark.ca (Postfix, from userid 112) id 99AFD1F11C; Tue, 18 May 2021 17:59:31 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=MAILING_LIST_MULTI, RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id BAE011E813 for ; Tue, 18 May 2021 17:59:30 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 733F03858034; Tue, 18 May 2021 21:59:30 +0000 (GMT) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id 3AA783858034 for ; Tue, 18 May 2021 21:59:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3AA783858034 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tdevries@suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 5CFCFACFD; Tue, 18 May 2021 21:59:27 +0000 (UTC) Subject: Re: [RFC][gdb/cli] Ignore error in gdb command script To: Philippe Waroquiers , Tom Tromey , Simon Marchi via Gdb-patches 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> From: Tom de Vries Message-ID: <0ad1098c-3a3a-6f49-6f46-811b0260cf1e@suse.de> Date: Tue, 18 May 2021 23:59:26 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: <767cfa6e293d63526275fe614bb6afa108a662b7.camel@skynet.be> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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: , Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" 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. Thanks, - Tom