From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7190 invoked by alias); 2 Mar 2020 13:34:18 -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 7182 invoked by uid 89); 2 Mar 2020 13:34:18 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1216 X-HELO: us-smtp-delivery-1.mimecast.com Received: from us-smtp-1.mimecast.com (HELO us-smtp-delivery-1.mimecast.com) (207.211.31.81) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 02 Mar 2020 13:34:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583156056; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uqg+qjmm8M776zAr2DH2X/bYTTzTQGIE8+JfNGmBOMI=; b=AnKRuEx+vI0R8FrtVsAfiSiXoKxOxOetY9qvpW3uQyoOGjOR6f6MDzn3USJyzLDctF7Ku4 BZgCDGXYTY/Mp+PRLSxXEJnatdSXa9qXowWmsB3ZIV6jxWzIaESqLbcNkv8RTeQyX3XgOE A4uzi9pXjYnQOvcJiiEUJqBbLbfugag= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-357-sd9dS9tKNiq1qCCgNyBDow-1; Mon, 02 Mar 2020 08:34:14 -0500 Received: by mail-ed1-f70.google.com with SMTP id m21so7785584edp.14 for ; Mon, 02 Mar 2020 05:34:14 -0800 (PST) Return-Path: Received: from ?IPv6:2001:8a0:f909:7b00:21e8:4cd6:8ec1:f387? ([2001:8a0:f909:7b00:21e8:4cd6:8ec1:f387]) by smtp.gmail.com with ESMTPSA id j9sm499577ejb.36.2020.03.02.05.34.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 02 Mar 2020 05:34:12 -0800 (PST) Subject: Re: [RFC][gdb/testsuite] Add -lbl option in gdb_test_multiple To: Tom de Vries , gdb-patches@sourceware.org References: <20200219174014.GA28126@delia> <851a18b0-b172-4b59-e411-ce3379c95c76@redhat.com> <0208e698-e2e1-c13f-486f-caa3f7766d6a@suse.de> <883bfb0f-c8e7-ae6c-aa94-2486b3c76362@redhat.com> <80d69419-60df-8308-9587-295a86c5041b@suse.de> <946e4070-8328-3ff1-eb45-1532a8782acd@redhat.com> <4acd7ab7-7aae-c816-8fd9-830980888ac2@suse.de> From: Pedro Alves Message-ID: <26825c16-2c26-8052-c01c-ecdfaf43bfea@redhat.com> Date: Mon, 02 Mar 2020 13:34:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <4acd7ab7-7aae-c816-8fd9-830980888ac2@suse.de> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2020-03/txt/msg00022.txt On 3/1/20 9:08 AM, Tom de Vries wrote: > On 27-02-2020 17:02, Pedro Alves wrote: >> Alternatively, if you don't like the -lbl within the {} block, and if >> we're going to use "-" options, how about supporting them before >> the {} user code block, so that the user code block is always >> at the end? Like: >> >> gdb_test_multiple "command" "testname" -lbl { >> ... >> } >> >> gdb_test_multiple "command" "testname" -prompt $prompt_regexp { >> ... >> } >> >> That should be doable with: >> >> -proc gdb_test_multiple { command message user_code { prompt_regexp "" } } { >> +proc gdb_test_multiple { command message args } { >> >> and then walking the $args list, processing "-" arguments, and interpreting >> the first non-"-" argument as the user code block (and erroring out if there >> are more arguments). I think the gdb_test_multiple code would look quite similar >> to your patch, except that the user_code parameter would no longer be a parameter, >> instead it would be a local variable set to the first non-"-" element of $args. > > Yes, I like that suggestion. > > Implemented and attached below. > > OK for trunk. OK. Thanks, Pedro Alves