From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29205 invoked by alias); 26 Feb 2003 00:35:56 -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 29196 invoked from network); 26 Feb 2003 00:35:55 -0000 Received: from unknown (HELO jackfruit.Stanford.EDU) (171.64.38.136) by 172.16.49.205 with SMTP; 26 Feb 2003 00:35:55 -0000 Received: (from carlton@localhost) by jackfruit.Stanford.EDU (8.11.6/8.11.6) id h1PNi7w16131; Tue, 25 Feb 2003 15:44:07 -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/rfc] gdb.c++/templates.exp, pr gdb/1063 From: David Carlton Date: Wed, 26 Feb 2003 00:35:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-02/txt/msg00682.txt.bz2 I'm starting to clean up FAILs and XFAILs in gdb.c++/templates.exp. I see several (especially in DWARF-2), with various causes, and they're kind of subtle, so I'll probably do multiple patches for this. (Frankly, the whole file is full of HP'isms and regexps that I'm suspicious of, but never mind that.) Anyways: there are 5 tests that were all originally XFAILed that all exhibit the same behavior. Basically, there's a templated classes C, with a few instantiations. Then the test does 'ptype C'. Right now, with GCC 3.1/DWARF-2, GDB arbitrarily picks one of the instantiations and does ptype of that. (Though not always, as I commented in PR gdb/1063.) With GCC 2.95.3/stabs+, however, GDB says that there's no type in question. What the testsuite is requesting is that GDB actually know that it's a templated type, and print out something related to that. For example, say that C is: template class C { T x; }; Then if you do 'ptype C', then in some circumstances, GDB will print out the type of C, in some circumstances GDB won't print out anything (presumably because it knows about the types C, C, or whatever, but not about just C), and the test suite wants output that looks like what I wrote above. To be honest, I can imagine how any of the three possible outputs would be a reasonable choice for GDB. But certainly being inconsistent about this isn't reasonable! So, for now, I've filed a bug report (which I will add to momentarily, giving the additional information about GCC 2.95.3/stabs+), and I'm proposing to KFAIL the tests, sending all current GDB output to that PR. If at some point in the future, we actually decide on the correct output, then we can change the test suite accordingly. (By the way, the patch involved a little bit of reindenting, so the patch looks a little busier than it actually is: I left all existing cases alone.) Comments? Suggestions? I'll apply this patch tomorrow unless anybody has a particular feeling that this isn't an appropriate approach. More patches to this file are in the works; like I said, there are various issues involved. David Carlton carlton@math.stanford.edu 2003-02-25 David Carlton * gdb.c++/templates.exp (do_tests): Convert XFAILs corresponding to PR c++/1063 into KFAILs. Tweak indentation. Update copyright. 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 25 Feb 2003 23:19:41 -0000 @@ -1,4 +1,4 @@ -# Copyright 1992, 1994, 1995, 1996, 1997, 1999, 2000, 2002 +# Copyright 1992, 1994, 1995, 1996, 1997, 1999, 2000, 2002, 2003 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify @@ -242,17 +242,22 @@ gdb_expect { # Template Foo -setup_xfail hppa64-*-* CLLbs16092 # g++ can't do the template instantiation in debug info trick, so we # fail this because it's not a real type. -if {!$hp_aCC_compiler} { setup_xfail *-*-* } send_gdb "ptype Foo\n" gdb_expect { - -re "type = template <(class |)T> (class |)Foo \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Foo\r\n\[ \t\]*(class |)Foo\r\n\[ \t\]*(class |)Foo\r\n$gdb_prompt $" { pass "ptype Foo" } - -re "type = template <(class |)T> (class |)Foo \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\n$gdb_prompt $" { xfail "ptype Foo" } - -re "$gdb_prompt $" { fail "ptype Foo" } - timeout { fail "(timeout) ptype Foo" } + -re "type = template <(class |)T> (class |)Foo \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Foo\r\n\[ \t\]*(class |)Foo\r\n\[ \t\]*(class |)Foo\r\n$gdb_prompt $" { pass "ptype Foo" } + -re "type = template <(class |)T> (class |)Foo \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\n$gdb_prompt $" { xfail "ptype Foo" } + -re "type = class Foo \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int foo\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" + { # GCC 3.1, DWARF-2 output. + kfail "gdb/1063" "ptype Foo" } + -re "No symbol \"Foo\" in current context.\r\n$gdb_prompt $" + { # GCC 2.95.3, stabs+ output. + kfail "gdb/1063" "ptype Foo" } + -re "$gdb_prompt $" { fail "ptype Foo" } + timeout { fail "(timeout) ptype Foo" } } +# -re "type = class Foo \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int foo(int, int);\r\n\\}\r\n$gdb_prompt $" # ptype Foo @@ -292,15 +297,19 @@ gdb_expect { # Template Bar -setup_xfail hppa64-*-* CLLbs16092 # same as Foo for g++ -if {!$hp_aCC_compiler} { setup_xfail *-*-* } send_gdb "ptype Bar\n" gdb_expect { - -re "type = template <(class |)T, (class |)sz> (class |)Bar \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Bar\r\n\[ \t\]*(class |)Bar\r\n$gdb_prompt $" { pass "ptype Bar" } - -re "type = <(class |)T, (class |)sz> (class |)Bar \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\n$gdb_prompt $" { xfail "ptype Bar" } - -re "$gdb_prompt $" { fail "ptype Bar" } - timeout { fail "(timeout) ptype Bar" } + -re "type = template <(class |)T, (class |)sz> (class |)Bar \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Bar\r\n\[ \t\]*(class |)Bar\r\n$gdb_prompt $" { pass "ptype Bar" } + -re "type = <(class |)T, (class |)sz> (class |)Bar \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\n$gdb_prompt $" { xfail "ptype Bar" } + -re "ptype Bar\r\ntype = class Bar {\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int bar\\(int, int\\);\r\n}\r\n$gdb_prompt $" + { # GCC 3.1, DWARF-2 output. + kfail "gdb/1063" "ptype Bar" } + -re "No symbol \"Bar\" in current context.\r\n$gdb_prompt $" + { # GCC 2.95.3, stabs+ output. + kfail "gdb/1063" "ptype Bar" } + -re "$gdb_prompt $" { fail "ptype Bar" } + timeout { fail "(timeout) ptype Bar" } } @@ -324,15 +333,19 @@ gdb_expect { # Template Baz -setup_xfail hppa64-*-* CLLbs16092 # Same as Foo, for g++ -if {!$hp_aCC_compiler} { setup_xfail *-*-* } send_gdb "ptype Baz\n" gdb_expect { - -re "type = template <(class |)T, (class |)sz> (class |)Baz \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Baz\r\n\[ \t\]*(class |)Baz\r\n$gdb_prompt $" { pass "ptype Baz" } - -re "type = <(class |)T, (class |)sz> (class |)Baz \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\n$gdb_prompt $" { xfail "ptype Baz" } - -re "$gdb_prompt $" { fail "ptype Baz" } - timeout { fail "(timeout) ptype Baz" } + -re "type = template <(class |)T, (class |)sz> (class |)Baz \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Baz\r\n\[ \t\]*(class |)Baz\r\n$gdb_prompt $" { pass "ptype Baz" } + -re "type = <(class |)T, (class |)sz> (class |)Baz \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\n$gdb_prompt $" { xfail "ptype Baz" } + -re "type = class Baz {\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int baz\\(int, int\\);\r\n}\r\n$gdb_prompt $" + { # GCC 3.1, DWARF-2 output. + kfail "gdb/1063" "ptype Baz" } + -re "No symbol \"Baz\" in current context.\r\n$gdb_prompt $" + { # GCC 2.95.3, stabs+ output. + kfail "gdb/1063" "ptype Baz" } + -re "$gdb_prompt $" { fail "ptype Baz" } + timeout { fail "(timeout) ptype Baz" } } @@ -356,13 +369,18 @@ gdb_expect { # Template Qux # Same as Foo for g++ -if {!$hp_aCC_compiler} {setup_xfail *-*-*} send_gdb "ptype Qux\n" gdb_expect { - -re "type = template <(class |)T, (class |)sz> (class |)Qux \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Qux\r\n\[ \t\]*(class |)Qux\r\n$gdb_prompt $" { pass "ptype Qux" } - -re ".*type = template <(class |)T.*, (class |)sz> (class |)Qux \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}.*$gdb_prompt $" { pass "ptype Qux" } - -re "$gdb_prompt $" { fail "ptype Qux" } - timeout { fail "(timeout) ptype Qux" } + -re "type = template <(class |)T, (class |)sz> (class |)Qux \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Qux\r\n\[ \t\]*(class |)Qux\r\n$gdb_prompt $" { pass "ptype Qux" } + -re ".*type = template <(class |)T.*, (class |)sz> (class |)Qux \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}.*$gdb_prompt $" { pass "ptype Qux" } + -re "type = class Qux {\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*char t;\r\n\r\n\[ \t\]*char qux\\(int, char\\);\r\n}\r\n$gdb_prompt $" + { # GCC 3.1, DWARF-2 output. + kfail "gdb/1063" "ptype Qux" } + -re "No symbol \"Qux\" in current context.\r\n$gdb_prompt $" + { # GCC 2.95.3, stabs+ output. + kfail "gdb/1063" "ptype Qux" } + -re "$gdb_prompt $" { fail "ptype Qux" } + timeout { fail "(timeout) ptype Qux" } } # pt Qux @@ -387,15 +405,19 @@ gdb_expect { # Template Spec -setup_xfail hppa64-*-* CLLbs16092 # Same as Foo for g++ -if {!$hp_aCC_compiler} { setup_xfail *-*-* } send_gdb "ptype Spec\n" gdb_expect { - -re "type = template <(class |)T1, (class |)T2> (class |)Spec \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Spec\r\n\[ \t\]*(class |)Spec\r\n$gdb_prompt $" { pass "ptype Spec" } - -re "type = <(class |)T1, (class |)T2> (class |)Spec \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\\}\r\n$gdb_prompt $" { xfail "ptype Spec" } - -re "$gdb_prompt $" { fail "ptype Spec" } - timeout { fail "(timeout) ptype Spec" } + -re "type = template <(class |)T1, (class |)T2> (class |)Spec \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Spec\r\n\[ \t\]*(class |)Spec\r\n$gdb_prompt $" { pass "ptype Spec" } + -re "type = <(class |)T1, (class |)T2> (class |)Spec \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\\}\r\n$gdb_prompt $" { xfail "ptype Spec" } + -re "type = class Spec {\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\r\n\[ \t\]*int spec\\(char\\);\r\n}\r\n$gdb_prompt $" + { # GCC 3.1, DWARF-2 output. + kfail "gdb/1063" "ptype Spec" } + -re "No symbol \"Spec\" in current context.\r\n$gdb_prompt $" + { # GCC 2.95.3, stabs+ output. + kfail "gdb/1063" "ptype Spec" } + -re "$gdb_prompt $" { fail "ptype Spec" } + timeout { fail "(timeout) ptype Spec" } } # pt Spec