From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 130116 invoked by alias); 1 Feb 2017 23:29:10 -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 130103 invoked by uid 89); 1 Feb 2017 23:29:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=H*MI:sk:5892583, H*f:sk:5892583, H*i:sk:5892583 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 01 Feb 2017 23:29:08 +0000 Received: from svr-orw-mbx-03.mgc.mentorg.com ([147.34.90.203]) by relay1.mentorg.com with esmtp id 1cZ4Ko-0007Lr-Qm from Luis_Gustavo@mentor.com ; Wed, 01 Feb 2017 15:29:06 -0800 Received: from [172.30.10.1] (147.34.91.1) by svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Wed, 1 Feb 2017 15:29:03 -0800 Subject: Re: [PATCH] Make language setting tests more robust References: <1485962220-31071-1-git-send-email-lgustavo@codesourcery.com> <331062ebcc7352d7731347260b56dee7@polymtl.ca> <58925832.8050306@redhat.com> To: Keith Seitz , Reply-To: Luis Machado From: Luis Machado Message-ID: <4e14c83a-18fa-5d52-b06a-e32f56bfe2fe@codesourcery.com> Date: Wed, 01 Feb 2017 23:29:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <58925832.8050306@redhat.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: svr-orw-mbx-02.mgc.mentorg.com (147.34.90.202) To svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) X-IsSubscribed: yes X-SW-Source: 2017-02/txt/msg00055.txt.bz2 On 02/01/2017 03:50 PM, Keith Seitz wrote: > Not to belabor the point, but... > > On 02/01/2017 10:38 AM, Simon Marchi wrote: >>> >>> +# Set the language and handle possible warnings output by GDB if we >>> select a >>> +# language that differs from the current frame's language. >>> +# >>> +# The first argument is the language to set. >>> +# The second argument is an optional message to be output by the test. >>> + >>> +proc set_language { args } { >> >> Instead of "args", it might be clearer to use a default argument for the >> second arg: >> >> proc set_language { language { message "" } } { >> >> And lower: >> >> if { $message == "" } { >> set message $command >> } >> >> Not sure about the exact TCL syntax, but I think you get the point :). >> > > Yes, your syntax looks correct to me. [I was in the process of writing > exactly the same thing.] > > Regarding gdb_test_no_output et al, this grokking of args needs to be > banished from the test suite. It adds unnecessary complexity. I would > encourage maintainers to request revision when such a thing is proposed > for the test suite. Thanks for the input. Nice to have that in mind for the future. It does look slightly convoluted. > > As a heads up/reminder, we also have parse_args, which is suitable for > more advanced use cases, involving multiple optional arguments and > flags. mi_make_breakpoint is one such place that demonstrates the use of > this facility. I'll check it out.