From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16245 invoked by alias); 10 Dec 2013 15:16:26 -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 16233 invoked by uid 89); 10 Dec 2013 15:16:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: mail-gw2-out.broadcom.com Received: from Unknown (HELO mail-gw2-out.broadcom.com) (216.31.210.63) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 10 Dec 2013 15:16:21 +0000 Received: from irvexchcas08.broadcom.com (HELO IRVEXCHCAS08.corp.ad.broadcom.com) ([10.9.208.57]) by mail-gw2-out.broadcom.com with ESMTP; 10 Dec 2013 07:21:17 -0800 Received: from IRVEXCHSMTP2.corp.ad.broadcom.com (10.9.207.52) by IRVEXCHCAS08.corp.ad.broadcom.com (10.9.208.57) with Microsoft SMTP Server (TLS) id 14.1.438.0; Tue, 10 Dec 2013 07:16:13 -0800 Received: from mail-irva-13.broadcom.com (10.10.10.20) by IRVEXCHSMTP2.corp.ad.broadcom.com (10.9.207.52) with Microsoft SMTP Server id 14.1.438.0; Tue, 10 Dec 2013 07:16:13 -0800 Received: from [10.177.73.57] (unknown [10.177.73.57]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id 194C3246A3; Tue, 10 Dec 2013 07:16:11 -0800 (PST) Message-ID: <52A7303B.2080901@broadcom.com> Date: Tue, 10 Dec 2013 15:16:00 -0000 From: Andrew Burgess User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 MIME-Version: 1.0 To: Pedro Alves CC: "gdb-patches@sourceware.org" Subject: Re: [PATCH] Call get_compiler_info directly from test_compiler_info if needed. References: <52A728A0.1050208@broadcom.com> <52A72C70.5040305@redhat.com> In-Reply-To: <52A72C70.5040305@redhat.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2013-12/txt/msg00377.txt.bz2 On 10/12/2013 3:00 PM, Pedro Alves wrote: > On 12/10/2013 02:43 PM, Andrew Burgess wrote: >> proc test_compiler_info { {compiler ""} } { >> global compiler_info >> >> + # Check that compiler_info has been initialised >> + if [string match "" $compiler_info] { >> + if [get_compiler_info] { >> + warning "Could not get compiler info" >> + return -1 >> + } >> + } > > What about get_compiler_info's $arg? In the cases where I removed calls to get_compiler_info no arg was being passed anyway, my assumption then is that in most cases the "default" result of get_compiler_info is fine. If you really want to pass some args to get_compiler_info you can still do that in a separate call, and I left in place (in gdb.exp) a call that does just this. The code in test_compiler_info will not overwrite an existing compiler_info value, so if you've taken care to call get_compiler_info yourself then all should still work as expected. Thanks, Andrew