From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 58029 invoked by alias); 10 Apr 2015 16:53:27 -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 58017 invoked by uid 89); 10 Apr 2015 16:53:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mail-ob0-f171.google.com Received: from mail-ob0-f171.google.com (HELO mail-ob0-f171.google.com) (209.85.214.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 10 Apr 2015 16:53:25 +0000 Received: by obbry2 with SMTP id ry2so23397444obb.1 for ; Fri, 10 Apr 2015 09:53:23 -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:date :message-id:subject:from:to:cc:content-type; bh=wo9UBKIxIPjCP9MwR9wXk9Tnrnw0wvp9Wy0eBCh6jMA=; b=lfgcYQmDue1GAGm0NjjEdqSvfCUotuNJtrmpO3hAj8KssB/6aXHSa1y6JwtqJdLY3w iUOetqrQvKVSAD1ODUlxGApxtXS5OxcM3nUZLJB+LIU06vUWTI41Ib9lkczrKqkgB+yo 0H02QDLr+iKYiSKi0/pExCsI/XHcCDY168uuWbltV65W0E+ELEf0kl0YmRmNE2+oILHr jeWR80o8wIAVR+3+Yj2oKth2tzYqlnNsDLthVZPKio+0h9VMHmw0J2VygMrRrvZLQsdH BMwUemoztMXuHgVKOqcPysilM7mxnS5Ct+U1Nm6ndvedYExclrRvEiCS+bRA1KOkBfh1 xlxQ== X-Gm-Message-State: ALoCoQlJuP5ASJMoBTz2VMl9gbN6NrPJlq8nnNpcrU5m0Tx7pvHw7sqLZT5EEpZ0b+tg7LvoV4NN MIME-Version: 1.0 X-Received: by 10.60.101.195 with SMTP id fi3mr3087986oeb.65.1428684801690; Fri, 10 Apr 2015 09:53:21 -0700 (PDT) Received: by 10.182.103.101 with HTTP; Fri, 10 Apr 2015 09:53:21 -0700 (PDT) In-Reply-To: <1428666671-12926-1-git-send-email-qiyaoltc@gmail.com> References: <1428666671-12926-1-git-send-email-qiyaoltc@gmail.com> Date: Fri, 10 Apr 2015 16:53:00 -0000 Message-ID: Subject: Re: [RFC] Unset tcl variable addr to avoid clashing From: Doug Evans To: Yao Qi Cc: gdb-patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-04/txt/msg00390.txt.bz2 On Fri, Apr 10, 2015 at 4:51 AM, Yao Qi wrote: > From: Yao Qi > > Hi, > I see some tcl ERRORs in gdb.sum recently: > > ERROR: tcl error sourcing ../../../../../binutils-gdb/gdb/testsuite/gdb.base/dmsym.exp. > ERROR: can't set "addr": variable is array > while executing > "set addr "0x\[0-9a-zA-Z\]+"" > (file "../../../../../binutils-gdb/gdb/testsuite/gdb.base/dmsym.exp" line 45) > invoked from within > "source ../../../../../binutils-gdb/gdb/testsuite/gdb.base/dmsym.exp" > ("uplevel" body line 1) > invoked from within > "uplevel #0 source ../../../../../binutils-gdb/gdb/testsuite/gdb.base/dmsym.exp" > invoked from within > "catch "uplevel #0 source $test_file_name"" > > It is OK to run single dmsym.exp. This error is caused by the name > clashing with coredump-filter.exp, and it can be reproduced, > > $ make check RUNTESTFLAGS='coredump-filter.exp dmsym.exp exception.exp stepi-random-signal.exp' > > as variable addr is used in all of them. This patch is to unset array > addr, but manually unset variables isn't good to me. Is there any > approaches we can do to avoid name clashing? 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. > > gdb/testsuite: > > 2015-04-10 Yao Qi > > * gdb.base/coredump-filter.exp: Unset addr. > --- > gdb/testsuite/gdb.base/coredump-filter.exp | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/gdb/testsuite/gdb.base/coredump-filter.exp b/gdb/testsuite/gdb.base/coredump-filter.exp > index f3203be..2deb7b3 100644 > --- a/gdb/testsuite/gdb.base/coredump-filter.exp > +++ b/gdb/testsuite/gdb.base/coredump-filter.exp > @@ -196,3 +196,5 @@ foreach item $all_anon_corefiles { > with_test_prefix "loading and testing corefile for non-Private-Shared-Anon-File" { > test_disasm $non_private_shared_anon_file_core $main_addr 1 > } > + > +unset addr I'd prefer a comment explaining why that is there appear in the code rather than having to go find it in commit logs or emails.