* [patch] fix spurious FAIL in templates.exp
@ 2003-02-27 21:38 David Carlton
2003-02-28 17:28 ` David Carlton
0 siblings, 1 reply; 3+ messages in thread
From: David Carlton @ 2003-02-27 21:38 UTC (permalink / raw)
To: gdb-patches; +Cc: Michael Elizabeth Chastain, Daniel Jacobowitz
When I created the test "print Foo<volatile char*>::foo" in
gdb.c++/templates.exp (mimicking the same test with a space between
"char" and "*"), it turned out to FAIL under DWARF-2, for reasons that
weren't clear to me at the time. I've investigated further, and it's
a testsuite bug: the output contains
volatile char *(Foo<volatile char*> * const, int, volatile char *)
and the testsuite doesn't expect the ' const' there. But it's
perfectly reasonable for that to occur there: the first argument is an
artificial parameter that corresponds to 'this', and you're not
allowed to set 'this' to refer to something else. (Note: the 'const'
means that you can't modify the pointer itself, not the object pointed
to by the pointer.)
So this patch modifies that test and its twin to accept an optional
const there. With this patch in place, the test PASSes under
GCC3.1/DWARF-2 and its twin still PASSes under GCC2.95.3/stabs. (And
both of them PASS in both situations once you've patched GDB to fix PR
gdb/33; I'll send out a patch for that shortly.)
I'm planning to commit this tomorrow. Only 5 templates.exp FAILs left
to analyze...
David Carlton
carlton@math.stanford.edu
2003-02-27 David Carlton <carlton@math.stanford.edu>
* gdb.c++/templates.exp (do_tests): Allow const in the two
Foo<volatile char *>::foo tests.
Index: templates.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.c++/templates.exp,v
retrieving revision 1.15
diff -u -p -r1.15 templates.exp
--- templates.exp 26 Feb 2003 20:30:05 -0000 1.15
+++ templates.exp 27 Feb 2003 21:27:30 -0000
@@ -301,7 +301,7 @@ gdb_expect {
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 "\\$\[0-9\]* = \\{.*char \\*\\((class |)Foo<volatile char ?\\*> \\*(| const), 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" }
@@ -310,7 +310,7 @@ gdb_expect {
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 "\\$\[0-9\]* = \\{.*char \\*\\((class |)Foo<volatile char ?\\*> \\*(| const), 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" }
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch] fix spurious FAIL in templates.exp
2003-02-27 21:38 [patch] fix spurious FAIL in templates.exp David Carlton
@ 2003-02-28 17:28 ` David Carlton
0 siblings, 0 replies; 3+ messages in thread
From: David Carlton @ 2003-02-28 17:28 UTC (permalink / raw)
To: gdb-patches; +Cc: Michael Elizabeth Chastain, Daniel Jacobowitz
On 27 Feb 2003 13:38:36 -0800, David Carlton <carlton@math.Stanford.EDU> said:
> I'm planning to commit this tomorrow. Only 5 templates.exp FAILs left
> to analyze...
Committed.
David Carlton
carlton@math.stanford.edu
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch] fix spurious FAIL in templates.exp
@ 2003-02-27 21:51 Michael Elizabeth Chastain
0 siblings, 0 replies; 3+ messages in thread
From: Michael Elizabeth Chastain @ 2003-02-27 21:51 UTC (permalink / raw)
To: carlton, gdb-patches; +Cc: drow
dc> So this patch modifies that test and its twin to accept an optional
dc> const there.
That's entirely cool with me. If the output is correct, and if it
doesn't mislead the user somehow, then accept it.
Michael C
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-02-28 17:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-27 21:38 [patch] fix spurious FAIL in templates.exp David Carlton
2003-02-28 17:28 ` David Carlton
2003-02-27 21:51 Michael Elizabeth Chastain
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox