From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 2nhIKe7Ko2C6GQAAWB0awg (envelope-from ) for ; Tue, 18 May 2021 10:10:54 -0400 Received: by simark.ca (Postfix, from userid 112) id 99D911F11C; Tue, 18 May 2021 10:10:54 -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.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 D570E1E783 for ; Tue, 18 May 2021 10:10:53 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C9C4A385481A; Tue, 18 May 2021 14:10:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C9C4A385481A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1621347052; bh=mq155pEV6Qnsf2socOjTAVW1T+8up6gvoDXKP9Um5Pg=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=RXUpeCAIfGnL1ZdkjnYxYQoKAE8kFIaUM3d5Hv/p1z7qsPIqeieUpQdJtkdDAEoeG IqdWBA0+lmX5S8xsbszuZDsu1R+DGGzMYzxz3mjhg5D3Aw/Yd2Fo147SFC5kt1HHwy 0b91g64C3jDrTFU+OooPEmwhJj/41SoTD03W7Rx8= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id DCB8B3854812 for ; Tue, 18 May 2021 14:10:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org DCB8B3854812 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 14IEAjEG012973 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 18 May 2021 10:10:49 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 14IEAjEG012973 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id BF3181E783; Tue, 18 May 2021 10:10:44 -0400 (EDT) Subject: Re: [RFC][gdb/cli] Ignore error in gdb command script To: Tom de Vries , Marco Barisione References: <20210518095958.GA22771@delia> <44B64C9E-9E19-47BD-80CD-0C660C7A9D94@undo.io> Message-ID: <453ffcaa-2a21-62a7-d449-28c7c187231a@polymtl.ca> Date: Tue, 18 May 2021 10:10:44 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Tue, 18 May 2021 14:10:45 +0000 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: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Cc: Tom Tromey , GDB patches mailing list Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 2021-05-18 9:57 a.m., Tom de Vries wrote:> On 5/18/21 1:12 PM, Marco Barisione wrote: >> On 18 May 2021, at 10:59, Tom de Vries wrote: >>> Hi, >>> >>> While trying to reproduce a failing test-case from the testsuite on the >>> command line using a gdb command script, I ran into the problem that a command >>> failed which stopped script execution. >>> >>> I could work around this by splitting the script at each error, but I realized >>> it would be nice if I could tell gdb to ignore the error. >>> >>> Inspired by make, I chose the '-' prefix. >> >> As MI commands are prefixed by “-“, isn’t there a risk of confusion? >> > > Ah, right, I tend to forget about MI, good point. > >> There’s also a “-” command (see tui/tui-win.c) which will stop working with >> your patch. > > I see, that's: > ... > $ gdb -q -batch -ex "help -" > Scroll window backward. > Usage: - [N] [WIN] > Scroll window WIN N lines backwards. Both WIN and N are optional, N > defaults to 1, and WIN defaults to the currently focused window. > ... > > FWIW, did not find any documentation for this command. > > Anyway, the '-' prefix seems a poor choice. > > I've updated the patch to implement the ignore-errors idiom natively (so > it also works without python). > > Also, I've managed to fix the hang, by copying some code from > execute_gdb_command. That sounds useful. I think that "ignore-errors" is a good initial name, because it's clear and self-describing. We can always find and add a short alias later. I didn't look much at the patch itself, but read the commit message. I would vote for implementing it as a command, to avoid adding more complexity / exceptions / special cases in the command handling code. Simon