This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
PATCH/testsuite: Fix store.exp
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Fri, 3 Jan 2003 23:04:32 -0500
- Subject: PATCH/testsuite: Fix store.exp
The first of several testsuite patches for this weekend. On my
configuration store.exp generated a number of ERROR: lines; this is a
consequence of the installed TCL version, I suspect. The problem was:
ERROR: TCL error: couldn't compile regular expression pattern: invalid repetition count(s)
[That's not what it _said_, of course. It said, "ERROR: Process no longer
exists", like it always does. That's the next patch, useful error messages
when a gdb_expect blows up.]
The problem:
-check_struct "1" "{s = {0}}" "{s = {1}}"
+check_struct "1" "{s = \\{0}}" "{s = \\{1}}"
" {1}" is a regular expression modifier meaning, "one space character".
" {1, 2}" is a syntax error. Gotta escape those braces.
Checked in as obvious. Note that two tests still fail in my configuration;
FAIL: gdb.base/store.exp: new up struct 1
FAIL: gdb.base/store.exp: new up struct 2
Something is being too clever and value of u is not re-read after it is
modified. That's a problem for another day.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
2003-01-03 Daniel Jacobowitz <drow@mvista.com>
* gdb.base/store.exp: Fix regular expressions.
Index: gdb.base/store.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/store.exp,v
retrieving revision 1.1
diff -u -p -r1.1 store.exp
--- gdb.base/store.exp 5 Dec 2002 01:48:19 -0000 1.1
+++ gdb.base/store.exp 4 Jan 2003 03:57:38 -0000
@@ -1,4 +1,4 @@
-# Copyright 2002 Free Software Foundation, Inc.
+# Copyright 2002, 2003 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -105,10 +105,10 @@ proc check_struct { t old new } {
gdb_test "print u" " = ${new}" "new check struct ${t}"
}
-check_struct "1" "{s = {0}}" "{s = {1}}"
-check_struct "2" "{s = {0, 0}}" "{s = {1, 2}}"
-check_struct "3" "{s = {0, 0, 0}}" "{s = {1, 2, 3}}"
-check_struct "4" "{s = {0, 0, 0, 0}}" "{s = {1, 2, 3, 4}}"
+check_struct "1" "{s = \\{0}}" "{s = \\{1}}"
+check_struct "2" "{s = \\{0, 0}}" "{s = \\{1, 2}}"
+check_struct "3" "{s = \\{0, 0, 0}}" "{s = \\{1, 2, 3}}"
+check_struct "4" "{s = \\{0, 0, 0, 0}}" "{s = \\{1, 2, 3, 4}}"
proc up_struct { t old new } {
global gdb_prompt
@@ -121,10 +121,10 @@ proc up_struct { t old new } {
gdb_test "print u" " = ${new}" "new up struct ${t}"
}
-up_struct "1" "{s = {0}}" "{s = {1}}"
-up_struct "2" "{s = {0, 0}}" "{s = {1, 2}}"
-up_struct "3" "{s = {0, 0, 0}}" "{s = {1, 2, 3}}"
-up_struct "4" "{s = {0, 0, 0, 0}}" "{s = {1, 2, 3, 4}}"
+up_struct "1" "{s = \\{0}}" "{s = \\{1}}"
+up_struct "2" "{s = \\{0, 0}}" "{s = \\{1, 2}}"
+up_struct "3" "{s = \\{0, 0, 0}}" "{s = \\{1, 2, 3}}"
+up_struct "4" "{s = \\{0, 0, 0, 0}}" "{s = \\{1, 2, 3, 4}}"
#