From patchwork Mon Jan 18 16:58:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 10424 Received: (qmail 85302 invoked by alias); 18 Jan 2016 16:58:45 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 85292 invoked by uid 89); 18 Jan 2016 16:58:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: Yes, score=6.8 required=5.0 tests=BAYES_50, KAM_LAZY_DOMAIN_SECURITY, KAM_TK autolearn=no version=3.3.2 spammy=upvar, UD:tk, UD:1.html, Expect X-HELO: usplmg21.ericsson.net Received: from usplmg21.ericsson.net (HELO usplmg21.ericsson.net) (198.24.6.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 18 Jan 2016 16:58:43 +0000 Received: from EUSAAHC008.ericsson.se (Unknown_Domain [147.117.188.96]) by usplmg21.ericsson.net (Symantec Mail Security) with SMTP id 0D.EC.32102.1B91D965; Mon, 18 Jan 2016 17:58:25 +0100 (CET) Received: from [142.133.110.144] (147.117.188.8) by smtp-am.internal.ericsson.com (147.117.188.98) with Microsoft SMTP Server id 14.3.248.2; Mon, 18 Jan 2016 11:58:40 -0500 Subject: Re: [PATCH] testsuite: Remove unused global references in gdb_test To: Pedro Alves , References: <1453133632-32710-1-git-send-email-simon.marchi@ericsson.com> <569D12AE.6060703@redhat.com> From: Simon Marchi Message-ID: <569D19C0.40805@ericsson.com> Date: Mon, 18 Jan 2016 11:58:40 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <569D12AE.6060703@redhat.com> X-IsSubscribed: yes On 16-01-18 11:28 AM, Pedro Alves wrote: >> --- >> gdb/testsuite/lib/gdb.exp | 3 --- >> 1 file changed, 3 deletions(-) >> >> diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp >> index 52220d0..f3f53b7 100644 >> --- a/gdb/testsuite/lib/gdb.exp >> +++ b/gdb/testsuite/lib/gdb.exp >> @@ -976,10 +976,7 @@ proc gdb_test_multiple { command message user_code } { >> # -1 if there was an internal error. >> # >> proc gdb_test { args } { >> - global verbose >> global gdb_prompt >> - global GDB >> - upvar timeout timeout > > The upvar should stay. I think this just follows standard procedure > for expect: > > http://www.tcl.tk/man/expect5.31/expect.1.html > > "Expect takes a rather liberal view of scoping. In particular, variables read > by commands specific to the Expect program will be sought first from the > local scope, and if not found, in the global scope. For example, this obviates > the need to place "global timeout" in every procedure you write that uses expect." > > See also get_largest_timeout. > > So gdb_test_multiple will look at the timeout in the caller, which will be > gdb_test. And this upvar then makes gdb_test_multiple actually look at the > timeout variable in gdb_test's caller frame. Ahh, thanks. I knew there was something. I pushed it with "upvar timeout timeout" kept. From cdd9114f5737fdfbb3c828af3a118fec8aafc26f Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Mon, 18 Jan 2016 11:08:12 -0500 Subject: [PATCH] testsuite: Remove unused global references in gdb_test Those are unused since gdb_test_multiple was added, factoring out most of the content of gdb_test. gdb/testsuite/ChangeLog: * lib/gdb.exp (gdb_test): Remove unused global references. --- gdb/testsuite/lib/gdb.exp | 2 -- 1 file changed, 2 deletions(-) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 52220d0..e6fe62c 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -976,9 +976,7 @@ proc gdb_test_multiple { command message user_code } { # -1 if there was an internal error. # proc gdb_test { args } { - global verbose global gdb_prompt - global GDB upvar timeout timeout if [llength $args]>2 then {