From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4246 invoked by alias); 3 Jun 2010 06:40:15 -0000 Received: (qmail 4225 invoked by uid 22791); 3 Jun 2010 06:40:13 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,MSGID_MULTIPLE_AT X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.155) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 03 Jun 2010 06:40:03 +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 o536djYw098613 ; Thu, 3 Jun 2010 08:39:45 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from mailserver.u-strasbg.fr (ms2.u-strasbg.fr [IPv6:2001:660:2402:d::11]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id o536djI5010649 ; Thu, 3 Jun 2010 08:39:45 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from d620muller (lec67-4-82-230-53-140.fbx.proxad.net [82.230.53.140]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id o536dicM081027 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) ; Thu, 3 Jun 2010 08:39:44 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: "'Joel Brobecker'" Cc: References: <000001cb0250$e4034590$ac09d0b0$@muller@ics-cnrs.unistra.fr> <20100602212929.GX3019@adacore.com> In-Reply-To: <20100602212929.GX3019@adacore.com> Subject: RE: [RFC] Testsuite: permit simple transformation of gdb_expect code Date: Thu, 03 Jun 2010 06:40:00 -0000 Message-ID: <002101cb02e7$90ecf3a0$b2c6dae0$@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/msg00095.txt.bz2 > -----Message d'origine----- > De=A0: gdb-patches-owner@sourceware.org [mailto:gdb-patches- > owner@sourceware.org] De la part de Joel Brobecker > Envoy=E9=A0: Wednesday, June 02, 2010 11:29 PM > =C0=A0: Pierre Muller > Cc=A0: gdb-patches@sourceware.org > Objet=A0: Re: [RFC] Testsuite: permit simple transformation of gdb_expect > code >=20 > > I would like to insert a no-op change to lib/gdb.exp that allows > > easily to write a transformation function (that can be inside the > > target board file). The idea is to simply add a global variable > > named `transform_gdb_expect_code' that defaults to empty. >=20 > No objection from my end in principle; I guess there is no way to > make that decision automatic? In AdaCore's testsuite, we get > the version information in GDB and determine from there the host > and target, and that allows to whether or not certain features > are available, etc. >=20 > In terms of implementation, rather than having an empty global, > perhaps it'd be just as simple to test its existence? Just thinking > out loud... Do you mean the variable or the procedure itself? I thought about it, but I still didn't really understand all the tcl command details: info exists VAR_NAME will return 1 if VAR_NAME exists as either a global or a local variable, but it seems that info proc PROC_NAME works as a regular expression, and can thus return a list containing both PROC_NAME and PROC_NAME_VERSION_2 procedures ... But I might be wrong. I am still not very skilled in tcl in general: does=20 global VAR; already create that variable? or does it just say that that name VAR should be looked up in global namespace? If it does not create the variable then using=20 global gdb_transform_expect_code; and if [info exists gdb_transform_expect_code] { would be cleaner probably. I am still so new to tcl that I didn't even=20 try it out, out of fear that I would not really correctly interpret the results I see! Pierre