From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30176 invoked by alias); 1 Feb 2017 21:50:46 -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 30164 invoked by uid 89); 1 Feb 2017 21:50:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 01 Feb 2017 21:50:44 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D91C861B9F for ; Wed, 1 Feb 2017 21:50:44 +0000 (UTC) Received: from valrhona.uglyboxes.com (ovpn04.gateway.prod.ext.phx2.redhat.com [10.5.9.4]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v11LoiZw009564 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 1 Feb 2017 16:50:44 -0500 Subject: Re: [PATCH] Make language setting tests more robust References: <1485962220-31071-1-git-send-email-lgustavo@codesourcery.com> <331062ebcc7352d7731347260b56dee7@polymtl.ca> From: Keith Seitz To: gdb-patches@sourceware.org Message-ID: <58925832.8050306@redhat.com> Date: Wed, 01 Feb 2017 21:50:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <331062ebcc7352d7731347260b56dee7@polymtl.ca> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2017-02/txt/msg00050.txt.bz2 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. 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. Keith