From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18278 invoked by alias); 2 Jun 2010 12:41:34 -0000 Received: (qmail 18265 invoked by uid 22791); 2 Jun 2010 12:41:32 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,MSGID_MULTIPLE_AT,TW_DJ,TW_GP,TW_JG,TW_XP X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.154) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 02 Jun 2010 12:41:17 +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 o52CfDuh085061 for ; Wed, 2 Jun 2010 14:41:14 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from mailserver.u-strasbg.fr (ms1.u-strasbg.fr [IPv6:2001:660:2402:d::10]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id o52CfBPH020330 for ; Wed, 2 Jun 2010 14:41:13 +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.3/jtpda-5.5pre1) with ESMTP id o52CfAH6027340 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Wed, 2 Jun 2010 14:41:11 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: Subject: [RFC] Testsuite: permit simple transformation of gdb_expect code Date: Wed, 02 Jun 2010 12:41:00 -0000 Message-ID: <000001cb0250$e4034590$ac09d0b0$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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/msg00039.txt.bz2 Following the long discussion about the problem of newlines on some systems, http://sourceware.org/ml/gdb-patches/2009-06/msg00346.html 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. If not empty this variable must expand to the named of a procedure that will take exp_code value and transform it in order to cope with target oddities like the newline problem. This patch was tested on gcc16 without any change in the testuite output. The performance impact should be negligible. Are there objections to this idea? Is this patch likely to be accepted? Pierre Muller Pascal language support maintainer for GDB PS: I do have procedures that try to cope with the newline problems on djgpp or mingw* targets, but nothing works perfectly, thus I would rather like to wait more until I really submit those to gdb-patches. Of course, if it is of interest to some of you, I can email the current status of that part. 2010-06-02 Pierre Muller * testsuite/lib/gdb.exp (transform_gdb_expect_code): New global variable, defauting to empty string. (gdb_expect): Call TRANSFORM_GDB_EXPECT_CODE procedure if not empty. Index: src/gdb/testsuite/lib/gdb.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v retrieving revision 1.148 diff -u -p -r1.148 gdb.exp --- src/gdb/testsuite/lib/gdb.exp 20 May 2010 19:18:58 -0000 1.148 +++ src/gdb/testsuite/lib/gdb.exp 2 Jun 2010 09:06:10 -0000 @@ -98,6 +98,12 @@ if ![info exists env(EXEEXT)] { set octal "\[0-7\]+" +# The variable transform_gdb_expect_code can be set to the name of +# a procedure that will transform the code parameter of gdb_expect call +# in order to cope for some target dependant problems +global transform_gdb_expect_code +set transform_gdb_expect_code "" + ### Only procedures should come after this point. # @@ -2168,6 +2174,10 @@ proc gdb_expect { args } { } } + global transform_gdb_expect_code; + if { "$transform_gdb_expect_code" != "" } { + set expcode [$transform_gdb_expect_code $expcode]; + } global suppress_flag; global remote_suppress_flag; if [info exists remote_suppress_flag] {