From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 74337 invoked by alias); 10 Apr 2015 17:55:48 -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 74326 invoked by uid 89); 10 Apr 2015 17:55:47 -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,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham 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; Fri, 10 Apr 2015 17:55:46 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t3AHteiC027288 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 10 Apr 2015 13:55:41 -0400 Received: from valrhona.uglyboxes.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t3AHtcZ9016060 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 10 Apr 2015 13:55:40 -0400 Message-ID: <55280E9A.1020204@redhat.com> Date: Fri, 10 Apr 2015 17:55:00 -0000 From: Keith Seitz User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Doug Evans , Yao Qi CC: gdb-patches Subject: Re: [RFC] Unset tcl variable addr to avoid clashing References: <1428666671-12926-1-git-send-email-qiyaoltc@gmail.com> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-04/txt/msg00402.txt.bz2 On 04/10/2015 09:53 AM, Doug Evans wrote: > Bleah. :-) > The first thing that comes to mind is of course a convention that > array globals must be prefixed with the name of the test. > OTOH gdb_base_coredump_filter_addr is painful. I've had to do this in several places, too, with my big locations patchset. In the end, I felt the path-of-least-resistance was to encapsulate the whole test in its own namespace and then declare variables: namespace eval $testfile { variable addr variable linespec variable location # do all test stuff } namespace delete $testfile This is rather inconvenient, so I played for a short while with trying to automate this in some way. The only solution that I could devise that didn't involve modifying dejagnu was to track the global variable list in standard_testfile or prepare_for_testing, unset'ing "new" globals every time the procedure was called. It proved a bit problematic, and I ended up with the namespace approach. It was far less risky/invasive. If there is any interest, I could dig that up and play with it some more. Keith