From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id B53D73953420 for ; Tue, 26 May 2020 18:19:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B53D73953420 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 04QIJRMI006368 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 26 May 2020 14:19:32 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 04QIJRMI006368 Received: from [172.16.0.95] (192-222-181-218.qc.cable.ebox.net [192.222.181.218]) (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 145BD1E5F9; Tue, 26 May 2020 14:19:27 -0400 (EDT) Subject: Re: [PATCH] gdb/testsuite: introduce parse_options procedure To: Keith Seitz , gdb-patches@sourceware.org References: <20200526130222.1956061-1-simon.marchi@polymtl.ca> <6d961a33-08f5-c5d0-c830-a6022e94696a@redhat.com> From: Simon Marchi Message-ID: <0f18d8be-d46c-a0fe-d046-d2281d37704a@polymtl.ca> Date: Tue, 26 May 2020 14:19:26 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <6d961a33-08f5-c5d0-c830-a6022e94696a@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: tl Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Tue, 26 May 2020 18:19:27 +0000 X-Spam-Status: No, score=-9.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, 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: Tue, 26 May 2020 18:19:36 -0000 On 2020-05-26 1:45 p.m., Keith Seitz wrote: > On 5/26/20 6:02 AM, Simon Marchi via Gdb-patches wrote: >> In the testsuite, I really like when procedures take optional arguments >> using shell-like options that start with dash (for example, >> gdb_test_multiple). I think this leads to clearer code than using >> parameters with defaults value. > > Is this sufficiently more robust than parse_args to warrant two variations > of a similar theme? Can they be merged into one implementation? > > Keith > Damn, I completely missed this! No, there's no point in adding another such function. I'll try to use parse_args for what I initially wanted to do (adding an -inferior-args option to gdb_run_cmd). If parse_args doesn't do what I need, I'll look into improving it. Thanks for letting me know about that. Simon