From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3341 invoked by alias); 21 Sep 2005 18:35:07 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 3308 invoked by uid 22791); 21 Sep 2005 18:34:54 -0000 Received: from brmea-mail-4.sun.com (HELO brmea-mail-4.sun.com) (192.18.98.36) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 21 Sep 2005 18:34:54 +0000 Received: from phys-mpk-1 ([129.146.11.81]) by brmea-mail-4.sun.com (8.12.10/8.12.9) with ESMTP id j8LIYmXZ026580 for ; Wed, 21 Sep 2005 12:34:53 -0600 (MDT) Received: from conversion-daemon.mpk-mail1.sfbay.sun.com by mpk-mail1.sfbay.sun.com (iPlanet Messaging Server 5.2 HotFix 1.24 (built Dec 19 2003)) id <0IN600701JCUJQ@mpk-mail1.sfbay.sun.com> (original mail from Olatunji.Ruwase@Sun.COM) for gdb@sourceware.org; Wed, 21 Sep 2005 11:34:50 -0700 (PDT) Received: from Sun.COM (ruwase.SFBay.Sun.COM [129.146.78.63]) by mpk-mail1.sfbay.sun.com (iPlanet Messaging Server 5.2 HotFix 1.24 (built Dec 19 2003)) with ESMTP id <0IN600G7OJM2Z3@mpk-mail1.sfbay.sun.com> for gdb@sourceware.org; Wed, 21 Sep 2005 11:34:50 -0700 (PDT) Date: Wed, 21 Sep 2005 18:35:00 -0000 From: Olatunji Ruwase Subject: Help with gdb testsuite (lib/gdb.exp) To: gdb@sourceware.org Reply-to: Olatunji.Ruwase@Sun.COM Message-id: <4331A7CA.6050807@Sun.COM> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.4) Gecko/20041214 X-SW-Source: 2005-09/txt/msg00161.txt.bz2 Hi, I hope this is the right medium for my problem, if not I apologise and would appreciate if this could be forwarded to the appropriate list. I recently started playing with the gdb testsuite and ran into a problem I traced as far as gdb_test_multiple in lib/gdb.exp. Below is the command line and error message in gdb.log. % runtest -tool gdb GDB=../gdb -di gdb.asm ********************************** (gdb) ERROR: tcl error sourcing gdb-6.3-src/gdb/testsuite/gdb.asm/asm-source.exp. ERROR: can't read "patter": no such variable while executing "list -re "\[\r\ \]*($patter )\[\r\ \]+$gdb_prompt $" { if ![stri g match "" $message] the { pass "$message" } }" ("uplevel" body line 1) invoked from within "uplevel list $subst_code" (procedure "gdb_test_multiple" line 35) invoked from within "gdb_test_multiple $command $message { -re "\[\r\n\]*($pattern)\[\r\n\]+$gdb_prompt $" { if ![string match "" $message] then { pass "$message" ..." (procedure "gdb_test" line 22) invoked from within "gdb_test "f" "asmsrc1\[.\]s:29.*several_nops" "f at main"" (file "gdb-6.3-src/gdb/testsuite/gdb.asm/asm-source.exp" line 237) invoked from within "source gdb-6.3-src/gdb/testsuite/gdb.asm/asm-source.exp" ("uplevel" body line 1) invoked from within "uplevel #0 source gdb-6.3-src/gdb/testsuite/gdb.asm/asm-source.exp" invoked from within "catch "uplevel #0 source $test_file_name"" ********************************************** So I tried debugging using the Tcl debugger option -D1, and it seems the "regsub -all {\n} ..." command in gdb_test_multiple is at fault, (debug session is given below). It removes all 'n' in the pattern although its supposed to remove only newline '\n'. I tried fixing this using "regsub -all {\\n}..." command, and I ran into another testsuite failure further down the road. Perhaps this a bug or not, I m not sure, but it could be due to my dejagnu, tcl and expect versions. My understanding is that some regular expression patterns e.g '\n' dont have a consensus matching semantics across different tools. I m willing to provide more information if needed. Thanks tunji dejagnu 1.4.4 expect 5.43 gdb 6.4 tcl 8.4.9 breakpoint 0: -re "gdb_test_multiple" 13: gdb_test_multiple $command $message { -re "\[\r\n\]*($pattern)\[\r\n\]+... dbg13.4> b -r regsub 1 dbg13.5> c breakpoint 1: -re "regsub" 14: regsub -all {\n} ${user_code} { } subst_code dbg14.6> p $user_code -re "\[\r\n\]*($pattern)\[\r\n\]+$gdb_prompt $" { if ![string match "" $message] then { pass "$message" } } -re "(${question_string})$" { send_gdb "$response_string\n"; exp_continue; } dbg14.7> n 14: uplevel list $subst_code dbg14.8> p $subst_code -re "\[\r\ \]*($patter )\[\r\ \]+$gdb_prompt $" { if ![stri g match "" $message] the { pass "$message" } } -re "(${questio _stri g})$" { se d_gdb "$respo se_stri g\ "; exp_co ti ue; }