This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] KFAIL tests in templates.exp for gdb/33


The test "print Foo<volatile char *>::foo" fails with GCC 3.1/DWARF-2,
because GDB is incorrectly sensitive to whitespace when matching
template names.  (Basically, the debug info in question generates a
name without the space between 'char' and '*'.)  Michael Chastain
analyzed this problem in GDB a couple of years ago, and it's easy
enough to fix; I'm planning to do that soon, but I first wanted to
make sure that the test suite fully tests the behavior in question.
That will make it easy to tell if the situation regresses in the
future.

The test currently passes with GCC 2.95.3/stabs+, but the bug's still
there in that case: it's just that GDB expects the space and won't
work right if the user _doesn't_ type the space.  So what I've done is
make a copy of the aforementioned test, but in the second copy I use
'volatile char*' instead of 'volatile char *'.  Then, in both cases,
I've added a KFAILed regexp, so that the regexp in one of the tests
gets triggered with old GDB's and the one in the other test gets
triggered with new GDB's.  So you see one KFAIL corresponding to that
PR, no matter which GDB you use.

The story doesn't end there: it turns out that, while GCC 2.95.3
KFAILs one test and PASSes the other test, GCC 3.1 KFAILs one test and
FAILs the other!  So there's another issue here; at first, I thought
it was a GDB bug, but now I think it's a testsuite bug.  But it really
is a separate issue, unrelated to the PR in question; I'm going to
leave it to a separate patch, once I've had a little more time to
think about it.

That was a long explanation, but I think/hope it's a pretty
uncontroversial idea.  I'll apply this patch tomorrow.

David "templates are a pain, but a strangely compelling pain" Carlton
carlton at math dot stanford dot edu

2003-02-25  David Carlton  <carlton at math dot stanford dot edu>

	* gdb.c++/templates.exp (do_tests): KFAIL the "print Foo<volatile
	char *>::foo" test with respect to PR c++/33.  Create a new test
	which is identical to that one except that it doesn't put the
	space between the "char" and the "*"; KFAIL it, too.

Index: templates.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.c++/templates.exp,v
retrieving revision 1.13
diff -u -p -r1.13 templates.exp
--- templates.exp	13 Feb 2003 21:33:20 -0000	1.13
+++ templates.exp	26 Feb 2003 01:05:59 -0000
@@ -283,11 +283,25 @@ gdb_expect {   
 
 # print a function from Foo<volatile char *>
 
+# This test is sensitive to whitespace matching, so we'll do it twice,
+# varying the spacing, because of PR gdb/33.
+
 send_gdb "print Foo<volatile char *>::foo\n"   
 gdb_expect {   
-   -re "\\$\[0-9\]* = \\{.*char \\*\\((class |)Foo<volatile char \\*> \\*, int, .*char \\*\\)\\} $hex <Foo<.*char.*\\*>::foo\\(int, .*char.*\\*\\)>\r\n$gdb_prompt $" { pass "print Foo<volatile char *>::foo" }
-   -re "$gdb_prompt $"                     { fail "print Foo<volatile char *>::foo" }
-   timeout                             { fail "(timeout) print Foo<volatile char *>::foo" }
+    -re "\\$\[0-9\]* = \\{.*char \\*\\((class |)Foo<volatile char ?\\*> \\*, int, .*char \\*\\)\\} $hex <Foo<.*char.*\\*>::foo\\(int, .*char.*\\*\\)>\r\n$gdb_prompt $" { pass "print Foo<volatile char *>::foo" }
+    -re "No symbol \"Foo<volatile char \\*>\" in current context.\r\n$gdb_prompt $"
+    { kfail "gdb/33" "print Foo<volatile char *>::foo" }
+    -re "$gdb_prompt $"                     { fail "print Foo<volatile char *>::foo" }
+    timeout                             { fail "(timeout) print Foo<volatile char *>::foo" }
+}
+
+send_gdb "print Foo<volatile char*>::foo\n"   
+gdb_expect {   
+    -re "\\$\[0-9\]* = \\{.*char \\*\\((class |)Foo<volatile char ?\\*> \\*, int, .*char \\*\\)\\} $hex <Foo<.*char.*\\*>::foo\\(int, .*char.*\\*\\)>\r\n$gdb_prompt $" { pass "print Foo<volatile char*>::foo" }
+    -re "No symbol \"Foo<volatile char\\*>\" in current context.\r\n$gdb_prompt $"
+    { kfail "gdb/33" "print Foo<volatile char*>::foo" }
+    -re "$gdb_prompt $"                     { fail "print Foo<volatile char*>::foo" }
+    timeout                             { fail "(timeout) print Foo<volatile char*>::foo" }
 }
 
 # Template Bar<T, int>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]