From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23719 invoked by alias); 4 Aug 2005 23:50:13 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 23706 invoked by uid 22791); 4 Aug 2005 23:50:06 -0000 Received: from eastrmmtao01.cox.net (HELO eastrmmtao01.cox.net) (68.230.240.38) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Thu, 04 Aug 2005 23:50:06 +0000 Received: from white ([68.9.64.121]) by eastrmmtao01.cox.net (InterMail vM.6.01.04.00 201-2131-118-20041027) with ESMTP id <20050804235001.FMYT12912.eastrmmtao01.cox.net@white> for ; Thu, 4 Aug 2005 19:50:01 -0400 Received: from bob by white with local (Exim 3.35 #1 (Debian)) id 1E0pTM-0001JN-00 for ; Thu, 04 Aug 2005 19:50:00 -0400 Date: Thu, 04 Aug 2005 23:50:00 -0000 From: Bob Rossi To: gdb-patches@sources.redhat.com Subject: Re: Fully anchor mi_gdb_test expected results. Message-ID: <20050804234959.GC4931@white> Mail-Followup-To: gdb-patches@sources.redhat.com References: <20050804041121.GB29482@nevyn.them.org> <20050804140937.GB4054@white> <20050804141750.GA11536@nevyn.them.org> <20050804142601.GC4054@white> <20050804143238.GA11996@nevyn.them.org> <20050804203704.GA4472@white> <20050804205747.GA22030@nevyn.them.org> <20050804211834.GD4472@white> <20050804224044.GB4931@white> <20050804224351.GA25174@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050804224351.GA25174@nevyn.them.org> User-Agent: Mutt/1.3.28i X-SW-Source: 2005-08/txt/msg00078.txt.bz2 On Thu, Aug 04, 2005 at 06:43:51PM -0400, Daniel Jacobowitz wrote: > On Thu, Aug 04, 2005 at 06:40:44PM -0400, Bob Rossi wrote: > > Here are my testsuite results. The first one looks like a bug I > > introduced, and the others look like random thread pass/failures. Is > > that correct? > > Yes. Does removing two backslashes in sizeof.exp fix it? They > shouldn't have been there at all. Geez Daniel, thanks for all the help. Here is the patch that plays nicely with the testsuite. I captured both the MI input command and the MI output command. Eventually testing can be done on the MI input command also. Thanks, Bob Rossi Index: gdb/testsuite/ChangeLog + * gdb.mi/mi-disassemble.exp, gdb.mi/mi2-disassemble.exp: Remove .* + from test. Escape the | in mi_gdb_test call. + * lib/mi-support.exp: Remove arbitrary .* from tests. + (mi_gdb_test): Fully anchor GDB/MI expected results in mi_gdb_test. + * lib/gdb.exp (string_to_regexp): Escape the ] character. + * gdb.base/sizeof.exp: Remove escape character. Correct test. Index: gdb/testsuite/gdb.base/sizeof.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/sizeof.exp,v retrieving revision 1.7 diff -u -r1.7 sizeof.exp --- gdb/testsuite/gdb.base/sizeof.exp 13 Jul 2004 17:08:36 -0000 1.7 +++ gdb/testsuite/gdb.base/sizeof.exp 4 Aug 2005 23:47:58 -0000 @@ -131,7 +131,7 @@ set signof_signed_char [get_valueof "/d" "(int) (signed char) -1" -1] set signof_unsigned_char [get_valueof "/d" "(int) (unsigned char) -1" -1] -check_valueof "'\\\\377'" ${signof_byte} +check_valueof "'\\377'" ${signof_byte} check_valueof "(int) (char) -1" ${signof_char} check_valueof "(int) (signed char) -1" ${signof_signed_char} check_valueof "(int) (unsigned char) -1" ${signof_unsigned_char} Index: gdb/testsuite/gdb.mi/mi-disassemble.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-disassemble.exp,v retrieving revision 1.13 diff -u -r1.13 mi-disassemble.exp --- gdb/testsuite/gdb.mi/mi-disassemble.exp 15 Aug 2004 10:15:58 -0000 1.13 +++ gdb/testsuite/gdb.mi/mi-disassemble.exp 4 Aug 2005 23:47:58 -0000 @@ -163,7 +163,7 @@ # -data-disassembly -f basics.c -l 32 -- 9 mi_gdb_test "123-data-disassemble -f foo -l abc -n 0 -- 0" \ - ".*123\\^error,msg=\"mi_cmd_disassemble: Invalid filename.\"" \ + "123\\^error,msg=\"mi_cmd_disassemble: Invalid filename.\"" \ "data-disassemble bogus filename" mi_gdb_test "321-data-disassemble -s foo -e bar -- 0" \ @@ -171,7 +171,7 @@ "data-disassemble bogus address" mi_gdb_test "456-data-disassemble -s \$pc -f basics.c -- 0" \ - "456\\^error,msg=\"mi_cmd_disassemble: Usage: \\( .-f filename -l linenum .-n howmany.. | .-s startaddr -e endaddr.\\) .--. mixed_mode.\"" \ + "456\\^error,msg=\"mi_cmd_disassemble: Usage: \\( .-f filename -l linenum .-n howmany.. \\| .-s startaddr -e endaddr.\\) .--. mixed_mode.\"" \ "data-disassemble mix different args" mi_gdb_test "789-data-disassemble -f basics.c -l $line_main_body -- 9" \ Index: gdb/testsuite/gdb.mi/mi2-disassemble.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-disassemble.exp,v retrieving revision 1.3 diff -u -r1.3 mi2-disassemble.exp --- gdb/testsuite/gdb.mi/mi2-disassemble.exp 15 Aug 2004 10:15:58 -0000 1.3 +++ gdb/testsuite/gdb.mi/mi2-disassemble.exp 4 Aug 2005 23:47:58 -0000 @@ -163,7 +163,7 @@ # -data-disassembly -f basics.c -l 32 -- 9 mi_gdb_test "123-data-disassemble -f foo -l abc -n 0 -- 0" \ - ".*123\\^error,msg=\"mi_cmd_disassemble: Invalid filename.\"" \ + "123\\^error,msg=\"mi_cmd_disassemble: Invalid filename.\"" \ "data-disassemble bogus filename" mi_gdb_test "321-data-disassemble -s foo -e bar -- 0" \ @@ -171,7 +171,7 @@ "data-disassemble bogus address" mi_gdb_test "456-data-disassemble -s \$pc -f basics.c -- 0" \ - "456\\^error,msg=\"mi_cmd_disassemble: Usage: \\( .-f filename -l linenum .-n howmany.. | .-s startaddr -e endaddr.\\) .--. mixed_mode.\"" \ + "456\\^error,msg=\"mi_cmd_disassemble: Usage: \\( .-f filename -l linenum .-n howmany.. \\| .-s startaddr -e endaddr.\\) .--. mixed_mode.\"" \ "data-disassemble mix different args" mi_gdb_test "789-data-disassemble -f basics.c -l $line_main_body -- 9" \ Index: gdb/testsuite/lib/gdb.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v retrieving revision 1.63 diff -u -r1.63 gdb.exp --- gdb/testsuite/lib/gdb.exp 8 May 2005 13:42:04 -0000 1.63 +++ gdb/testsuite/lib/gdb.exp 4 Aug 2005 23:47:59 -0000 @@ -864,7 +864,7 @@ proc string_to_regexp {str} { set result $str - regsub -all {[]*+.|()^$\[]} $str {\\&} result + regsub -all {[]*+.|()^$\[\\]} $str {\\&} result return $result } Index: gdb/testsuite/lib/mi-support.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v retrieving revision 1.29 diff -u -r1.29 mi-support.exp --- gdb/testsuite/lib/mi-support.exp 4 Aug 2005 01:52:31 -0000 1.29 +++ gdb/testsuite/lib/mi-support.exp 4 Aug 2005 23:47:59 -0000 @@ -246,7 +246,7 @@ send_gdb "y\n"; exp_continue } - -re ".*102-break-delete\r\n102\\\^done\r\n$mi_gdb_prompt$" { + -re "102-break-delete\r\n102\\\^done\r\n$mi_gdb_prompt$" { # This happens if there were no breakpoints } timeout { perror "Delete all breakpoints in mi_delete_breakpoints (timeout)" ; return } @@ -596,6 +596,8 @@ set result -1 set string "${command}\n"; + set string_regex [string_to_regexp $command] + if { $command != "" } { while { "$string" != "" } { set foo [string first "\n" "$string"]; @@ -659,7 +661,10 @@ gdb_start set result -1 } - -re "\[\r\n\]*($pattern)\[\r\n\]+$mi_gdb_prompt\[ \]*$" { + -re "^(.*$string_regex.*)($pattern\[\r\n\]+$mi_gdb_prompt\[ \]*)$" { + # At this point, $expect_out(1,string) is the MI input command. + # and $expect_out(2,string) is the MI output command. + if ![string match "" $message] then { pass "$message" } @@ -917,11 +922,11 @@ global fullname_syntax send_gdb "220-$cmd\n" gdb_expect { - -re ".*220\\^running\r\n${mi_gdb_prompt}.*220\\*stopped,reason=\"$reason\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=$args,file=\".*$file\",fullname=\"${fullname_syntax}$file\",line=\"$line\"\}$extra\r\n$mi_gdb_prompt$" { + -re "220\\^running\r\n${mi_gdb_prompt}.*220\\*stopped,reason=\"$reason\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=$args,file=\".*$file\",fullname=\"${fullname_syntax}$file\",line=\"$line\"\}$extra\r\n$mi_gdb_prompt$" { pass "$test" return 0 } - -re ".*220\\^running\r\n${mi_gdb_prompt}.*220\\*stopped,reason=\"$reason\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\".*\",args=\[\\\[\{\].*\[\\\]\}\],file=\".*\",fullname=\"${fullname_syntax}.*\",line=\"\[0-9\]*\"\}.*\r\n$mi_gdb_prompt$" { + -re "220\\^running\r\n${mi_gdb_prompt}.*220\\*stopped,reason=\"$reason\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\".*\",args=\[\\\[\{\].*\[\\\]\}\],file=\".*\",fullname=\"${fullname_syntax}.*\",line=\"\[0-9\]*\"\}.*\r\n$mi_gdb_prompt$" { fail "$test (stopped at wrong place)" return -1 }