From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3855 invoked by alias); 16 Jun 2010 15:34:24 -0000 Received: (qmail 3836 invoked by uid 22791); 16 Jun 2010 15:34:21 -0000 X-SWARE-Spam-Status: No, hits=-0.5 required=5.0 tests=AWL,BAYES_20,MSGID_MULTIPLE_AT,TW_XP X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.152) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 16 Jun 2010 15:34:15 +0000 Received: from baal.u-strasbg.fr (baal.u-strasbg.fr [IPv6:2001:660:2402::41]) by mailhost.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id o5GFXxc7045602 ; Wed, 16 Jun 2010 17:33:59 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from mailserver.u-strasbg.fr (ms8.u-strasbg.fr [IPv6:2001:660:2402:d::17]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id o5GFXwur071452 ; Wed, 16 Jun 2010 17:33:59 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from d620muller (gw-ics.u-strasbg.fr [130.79.210.225]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.4/jtpda-5.5pre1) with ESMTP id o5GFXvwL091170 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) ; Wed, 16 Jun 2010 17:33:57 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: "'Jan Kratochvil'" Cc: , References: <000901cb0c52$b7d767b0$27863710$@muller@ics-cnrs.unistra.fr> <20100616141356.GA32701@host0.dyn.jankratochvil.net> In-Reply-To: <20100616141356.GA32701@host0.dyn.jankratochvil.net> Subject: RE: PING [RFC] Testsuite: permit simple transformation of gdb_expect code Date: Wed, 16 Jun 2010 15:34:00 -0000 Message-ID: <000001cb0d69$55b65150$0122f3f0$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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/msg00364.txt.bz2 > -----Message d'origine----- > De=A0: gdb-patches-owner@sourceware.org [mailto:gdb-patches- > owner@sourceware.org] De la part de Jan Kratochvil > Envoy=E9=A0: Wednesday, June 16, 2010 4:14 PM > =C0=A0: Pierre Muller > Cc=A0: gdb-patches@sourceware.org; drow@false.org > Objet=A0: Re: PING [RFC] Testsuite: permit simple transformation of > gdb_expect code >=20 > 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. >=20 > I do not understand this part. Once again, this is due to my lack of knowledge of expect/tcl. =20 > > 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. >=20 > With the patch proposed below one defines it using: > proc transform_gdb_expect_code { expcode } { > verbose -log "code =3D <$expcode>" > return $expcode > } > and undefines it using: > rename transform_gdb_expect_code "" I didn't know about rename builtin command, this means that we could define proc gdb_allow_dos_type_readline { expcode} { which would translate the expcode to cope with the extra \n appearing in that case, and insert later if { [istarget "*-*-mingw*"] || [istarget "*-*-*djgpp*"] } { rename gdb_allow_dos_type_readline transform_gdb_expect_code } This is perfect for me! =20 > Thanks, Thank you for this new simpler proposal! > 2010-06-16 Pierre Muller > Jan Kratochvil >=20 > * lib/gdb.exp (gdb_expect): Call transform_gdb_expect_code > procedure > if it exists. >=20 > --- a/gdb/testsuite/lib/gdb.exp > +++ b/gdb/testsuite/lib/gdb.exp > @@ -2178,6 +2178,13 @@ proc gdb_expect { args } { > } > } >=20 > + # 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]" !=3D "" } { > + set expcode [transform_gdb_expect_code $expcode] > + } > + > global suppress_flag; > global remote_suppress_flag; > if [info exists remote_suppress_flag] {