From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7554 invoked by alias); 16 Jun 2010 14:14:15 -0000 Received: (qmail 7541 invoked by uid 22791); 16 Jun 2010 14:14:14 -0000 X-SWARE-Spam-Status: No, hits=-5.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_XP,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; Wed, 16 Jun 2010 14:14:05 +0000 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5GEE17d004508 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 16 Jun 2010 10:14:01 -0400 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5GEDwQX024385 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 16 Jun 2010 10:14:00 -0400 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id o5GEDwwP001431; Wed, 16 Jun 2010 16:13:58 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id o5GEDvRU001430; Wed, 16 Jun 2010 16:13:57 +0200 Date: Wed, 16 Jun 2010 14:14:00 -0000 From: Jan Kratochvil To: Pierre Muller Cc: gdb-patches@sourceware.org, drow@false.org Subject: Re: PING [RFC] Testsuite: permit simple transformation of gdb_expect code Message-ID: <20100616141356.GA32701@host0.dyn.jankratochvil.net> References: <000901cb0c52$b7d767b0$27863710$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <000901cb0c52$b7d767b0$27863710$@muller@ics-cnrs.unistra.fr> User-Agent: Mutt/1.5.20 (2009-12-10) X-IsSubscribed: yes 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: 2010-06/txt/msg00363.txt.bz2 On Tue, 15 Jun 2010 08:19:30 +0200, Pierre Muller wrote: > use only a procedure, but this would mean > that there is no way to insert its code inside > gdb.exp itself. I do not understand this part. > This allows to use either > unset transform_gdb_expect_code > or > set transform_gdb_expect_code "" > to disable the transformation at any point > in the testsuite. With the patch proposed below one defines it using: proc transform_gdb_expect_code { expcode } { verbose -log "code = <$expcode>" return $expcode } and undefines it using: rename transform_gdb_expect_code "" Thanks, Jan 2010-06-16 Pierre Muller Jan Kratochvil * lib/gdb.exp (gdb_expect): Call transform_gdb_expect_code procedure if it exists. --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -2178,6 +2178,13 @@ proc gdb_expect { args } { } } + # The global procedure transform_gdb_expect_code can transform the code + # parameter of gdb_expect call in order to cope for some target dependant + # problems. + if { "[info procs transform_gdb_expect_code]" != "" } { + set expcode [transform_gdb_expect_code $expcode] + } + global suppress_flag; global remote_suppress_flag; if [info exists remote_suppress_flag] {