From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 124108 invoked by alias); 19 May 2015 09:59:28 -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 124090 invoked by uid 89); 19 May 2015 09:59:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 19 May 2015 09:59:27 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t4J9xOOT029844 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 19 May 2015 05:59:24 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t4J9xN9E002688; Tue, 19 May 2015 05:59:23 -0400 Message-ID: <555B097A.6080307@redhat.com> Date: Tue, 19 May 2015 09:59:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Patrick Palka CC: "gdb-patches@sourceware.org" Subject: Re: [PATCH v2] Fix gdb.base/gdbinit-history.exp when HISTSIZE is set in the environment (Re: [PATCH] [COMMITTED] Fix PR gdb/17820) References: <1431523782-20409-1-git-send-email-patrick@parcs.ath.cx> <55561958.2030105@redhat.com> <55563C0D.9010903@redhat.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-05/txt/msg00466.txt.bz2 On 05/15/2015 10:42 PM, Patrick Palka wrote: > On Fri, May 15, 2015 at 2:33 PM, Pedro Alves wrote: >> On 05/15/2015 06:03 PM, Patrick Palka wrote: >>> On Fri, May 15, 2015 at 12:05 PM, Pedro Alves wrote: >>>> + if {$have_old_histsize} { >>>> + set env(HISTSIZE) $old_histsize >>>> + } >>> >>> Why not change this predicate to >>> >>> if [info exists old_histsize] >>> >>> to obviate the need for $have_old_histsize altogether? >> >> Yeah, "info exists" is ok since this is local scope; I was worrying >> that the code ends up copied elsewhere to global context, and >> then the "info exists" would be the wrong thing to use, considering >> e.g., [1] and [2]. Maybe I'm worrying too much. But how about instead >> simply saving/restoring the whole env array, like in the updated >> patch below, which sidesteps that issue? > > What a neat language (TCL). :-) (It's more an issue with DejaGnu sourcing all test files into the same context, than language.) > > Both the original approach (with $have_old_histsize) and this one look > fine by me. I've pushed this one in now. Thanks, Pedro Alves