From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 96704 invoked by alias); 15 May 2015 21:43:18 -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 96694 invoked by uid 89); 15 May 2015 21:43:17 -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,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-HELO: mail-oi0-f52.google.com Received: from mail-oi0-f52.google.com (HELO mail-oi0-f52.google.com) (209.85.218.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 15 May 2015 21:43:16 +0000 Received: by oift201 with SMTP id t201so92555078oif.3 for ; Fri, 15 May 2015 14:43:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=rO1EW+uNg9u9dmyWObl1VteMuIqkbtkk98dc/bwMUu0=; b=fY7JS0IOOT7mZnoKHo0V6PRy4vzzDmJEBvve7Sb3Ara0MvSqdnAnaNF0NM6AcKClrI ypgKPqUGs84Ay2YnqVpG//kDK9pwEFEJnZcgMODZW1zYnak3y2dKJTFUk4mrl1o0h0r7 Surs3ZHcGArdzXvAsCXyOkKF2Nrt4wZfQuhIij8EMPMXAggWKOrKcAJmsbOIy6dLEBBC 4MZ1zCylWyyu23HF9VMrmTIWNqteAQGKQvpZn3JU/omAHE1b6hD2xFaNbrO4xuaK4NXE 0b7W2onqfEW9tT6nF5tPVELz+16jF9MuT8ZvR2jEp/2ItNbMk3h3GTjk/IbcZafosRgG n++w== X-Gm-Message-State: ALoCoQkE3QkJh6sFweR0BSA6NXeLiScSuy5QPmPanQAgbO5I9qtw4LdK8dN37YzmrZqmp0Dqwsl8 X-Received: by 10.202.225.65 with SMTP id y62mr1961749oig.78.1431726194490; Fri, 15 May 2015 14:43:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.243.232 with HTTP; Fri, 15 May 2015 14:42:54 -0700 (PDT) In-Reply-To: <55563C0D.9010903@redhat.com> References: <1431523782-20409-1-git-send-email-patrick@parcs.ath.cx> <55561958.2030105@redhat.com> <55563C0D.9010903@redhat.com> From: Patrick Palka Date: Fri, 15 May 2015 21:43:00 -0000 Message-ID: Subject: Re: [PATCH v2] Fix gdb.base/gdbinit-history.exp when HISTSIZE is set in the environment (Re: [PATCH] [COMMITTED] Fix PR gdb/17820) To: Pedro Alves Cc: "gdb-patches@sourceware.org" Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2015-05/txt/msg00418.txt.bz2 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). Both the original approach (with $have_old_histsize) and this one look fine by me.