From: Bob Rossi <bob@brasko.net>
To: gdb-patches@sources.redhat.com
Subject: Re: Fully anchor mi_gdb_test expected results.
Date: Thu, 04 Aug 2005 23:50:00 -0000 [thread overview]
Message-ID: <20050804234959.GC4931@white> (raw)
In-Reply-To: <20050804224351.GA25174@nevyn.them.org>
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
}
next prev parent reply other threads:[~2005-08-04 23:50 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-04 2:50 Bob Rossi
2005-08-04 4:11 ` Daniel Jacobowitz
2005-08-04 14:09 ` Bob Rossi
2005-08-04 14:18 ` Daniel Jacobowitz
2005-08-04 14:26 ` Bob Rossi
2005-08-04 14:33 ` Daniel Jacobowitz
2005-08-04 20:37 ` Bob Rossi
2005-08-04 20:48 ` Bob Rossi
2005-08-04 20:58 ` Daniel Jacobowitz
2005-08-04 21:17 ` Bob Rossi
2005-08-04 20:57 ` Daniel Jacobowitz
2005-08-04 21:18 ` Bob Rossi
2005-08-04 22:40 ` Bob Rossi
2005-08-04 22:43 ` Daniel Jacobowitz
2005-08-04 23:50 ` Bob Rossi [this message]
2005-09-18 1:32 ` Daniel Jacobowitz
2005-09-18 2:10 ` Bob Rossi
2005-09-21 1:26 ` Bob Rossi
2005-09-26 1:42 ` Daniel Jacobowitz
2005-09-27 22:41 ` Bob Rossi
2005-08-04 14:34 ` Bob Rossi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050804234959.GC4931@white \
--to=bob@brasko.net \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox