From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32475 invoked by alias); 27 Feb 2003 21:38:59 -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 32456 invoked from network); 27 Feb 2003 21:38:57 -0000 Received: from unknown (HELO jackfruit.Stanford.EDU) (171.64.38.136) by 172.16.49.205 with SMTP; 27 Feb 2003 21:38:57 -0000 Received: (from carlton@localhost) by jackfruit.Stanford.EDU (8.11.6/8.11.6) id h1RLcak24881; Thu, 27 Feb 2003 13:38:36 -0800 X-Authentication-Warning: jackfruit.Stanford.EDU: carlton set sender to carlton@math.stanford.edu using -f To: gdb-patches@sources.redhat.com Cc: Michael Elizabeth Chastain , Daniel Jacobowitz Subject: [patch] fix spurious FAIL in templates.exp From: David Carlton Date: Thu, 27 Feb 2003 21:38:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-02/txt/msg00788.txt.bz2 When I created the test "print Foo::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 * 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 * gdb.c++/templates.exp (do_tests): Allow const in the two Foo::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::foo\n" gdb_expect { - -re "\\$\[0-9\]* = \\{.*char \\*\\((class |)Foo \\*, int, .*char \\*\\)\\} $hex ::foo\\(int, .*char.*\\*\\)>\r\n$gdb_prompt $" { pass "print Foo::foo" } + -re "\\$\[0-9\]* = \\{.*char \\*\\((class |)Foo \\*(| const), int, .*char \\*\\)\\} $hex ::foo\\(int, .*char.*\\*\\)>\r\n$gdb_prompt $" { pass "print Foo::foo" } -re "No symbol \"Foo\" in current context.\r\n$gdb_prompt $" { kfail "gdb/33" "print Foo::foo" } -re "$gdb_prompt $" { fail "print Foo::foo" } @@ -310,7 +310,7 @@ gdb_expect { send_gdb "print Foo::foo\n" gdb_expect { - -re "\\$\[0-9\]* = \\{.*char \\*\\((class |)Foo \\*, int, .*char \\*\\)\\} $hex ::foo\\(int, .*char.*\\*\\)>\r\n$gdb_prompt $" { pass "print Foo::foo" } + -re "\\$\[0-9\]* = \\{.*char \\*\\((class |)Foo \\*(| const), int, .*char \\*\\)\\} $hex ::foo\\(int, .*char.*\\*\\)>\r\n$gdb_prompt $" { pass "print Foo::foo" } -re "No symbol \"Foo\" in current context.\r\n$gdb_prompt $" { kfail "gdb/33" "print Foo::foo" } -re "$gdb_prompt $" { fail "print Foo::foo" }