From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11682 invoked by alias); 17 Feb 2012 21:31:40 -0000 Received: (qmail 11662 invoked by uid 22791); 17 Feb 2012 21:31:39 -0000 X-SWARE-Spam-Status: No, hits=-7.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 17 Feb 2012 21:31:22 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q1HLVMiS011806 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 17 Feb 2012 16:31:22 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q1HLVLTB032082; Fri, 17 Feb 2012 16:31:22 -0500 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id q1HLVKoA023418; Fri, 17 Feb 2012 16:31:20 -0500 From: Tom Tromey To: Pedro Alves Cc: gdb-patches@sourceware.org, jan.kratochvil@redhat.com Subject: Re: [PATCH 1/2] gdb.threads/attach-into-signal.exp: cleanup References: <20120217193546.10029.74207.stgit@hit-nxdomain.opendns.com> <20120217193648.10029.26589.stgit@hit-nxdomain.opendns.com> <87pqdd9pjs.fsf@fleche.redhat.com> <4F3EBEAC.1070805@redhat.com> Date: Fri, 17 Feb 2012 22:04:00 -0000 In-Reply-To: <4F3EBEAC.1070805@redhat.com> (Pedro Alves's message of "Fri, 17 Feb 2012 20:55:08 +0000") Message-ID: <87k43l87vb.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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 X-SW-Source: 2012-02/txt/msg00381.txt.bz2 >>>>> "Pedro" == Pedro Alves writes: Pedro> Hmm, the only thing dejagnu does with it is 'concat'. Pedro> /usr/share/dejagnu/framework.exp:681: global pf_prefix Pedro> /usr/share/dejagnu/framework.exp:688: if {[info exists pf_prefix]} { Pedro> /usr/share/dejagnu/framework.exp:689: set message [concat $pf_prefix " " $message] Hm, I thought I had seen weird output in gdb.log caused by using lappend here, which is why I used append elsewhere. Pedro> $ grep -rn pf_prefix *| grep append | grep lappend | wc -l Pedro> 40 Pedro> $ grep -rn pf_prefix *| grep append | grep append | grep -v lappend | wc -l Pedro> 2 Also search for 'set pf_prefix', but filter out the restoring ones. Maybe the bad one is the initial set in lib/gdb.exp: set pf_prefix "[file tail [file dirname $file]]/[file tail $file]:"; ... this should perhaps be wrapped in [list] >> I've occasionally wanted a wrapper like 'with_pf_prefix $whatever { body }'. >> But not enough to write it :) Pedro> Oh, that's a good idea! Try this. I didn't test it in dejagnu, so... proc with_test_prefix {prefix body} { global pf_prefix errorInfo errorCode set saved $pf_prefix lappend pf_prefix $prefix set r [catch {uplevel 1 $body} message] set pf_prefix $saved if {$r == 0} { return $message } else { return -code $r -errorinfo $errorInfo -errorcode $errorCode $message } } I've often thought more of our tests could use this "macro" style. Tom