From 3e5fc8d2407d2bb8996c507c2c795d451a38bc83 Mon Sep 17 00:00:00 2001 From: David Carlton Date: Wed, 14 Jan 2004 19:03:32 +0000 Subject: [PATCH] 2004-01-14 David Carlton * gdb.cp/rtti.exp: Update copyright. KFAIL test with repect to PR c++/1511 and update coment. * gdb.cp/templates.exp: Update patterns to match current output. If changes involve something other than whitespace, KFAIL w.r.t. PR c++/1512 or PR c++/931 as appropriate. --- gdb/testsuite/ChangeLog | 8 +++++++ gdb/testsuite/gdb.cp/rtti.exp | 22 ++++++++--------- gdb/testsuite/gdb.cp/templates.exp | 38 +++++++++++++++++++++--------- 3 files changed, 45 insertions(+), 23 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 59737777b7..3f3b1d39be 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2004-01-14 David Carlton + + * gdb.cp/rtti.exp: Update copyright. KFAIL test with repect to + PR c++/1511 and update coment. + * gdb.cp/templates.exp: Update patterns to match current output. + If changes involve something other than whitespace, KFAIL + w.r.t. PR c++/1512 or PR c++/931 as appropriate. + 2004-01-14 David Carlton * gdb.cp/namespace.exp: Add tests involving classes defined within diff --git a/gdb/testsuite/gdb.cp/rtti.exp b/gdb/testsuite/gdb.cp/rtti.exp index 6177f80d00..124166587f 100644 --- a/gdb/testsuite/gdb.cp/rtti.exp +++ b/gdb/testsuite/gdb.cp/rtti.exp @@ -1,4 +1,4 @@ -# Copyright 2003 Free Software Foundation, Inc. +# Copyright 2003, 2004 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 @@ -102,15 +102,14 @@ gdb_test_multiple "print *e1" "print *e1" { } } -# NOTE: carlton/2003-05-16: This test fails on my branch with an -# "" message because, within rtt1.cc, GDB has no way -# of knowing that the class is called 'n2::D2' instead of just 'D2'. -# This is an artifical test case, though: if we were using these -# classes in a more substantial way, G++ would emit more debug info. -# As is, I don't think there's anything that GDB can do about this -# case until G++ starts emitting DW_TAG_namespace info; when that part -# of the branch gets merged in, then we'll probably want to convert -# that fail branch to an xfail. +# NOTE: carlton/2004-01-14: This test with an "" +# message because, within rtt1.cc, GDB has no way of knowing that the +# class is called 'n2::D2' instead of just 'D2'. This is an artifical +# test case, though: if we were using these classes in a more +# substantial way, G++ would emit more debug info. As is, I don't +# think there's anything that GDB can do about this case until G++ +# starts emitting DW_TAG_namespace info; this should arrive with GCC +# 3.4. gdb_test_multiple "print *e2" "print *e2" { -re "warning: RTTI symbol not found for class 'n2::D2'.*$gdb_prompt $" { @@ -122,8 +121,7 @@ gdb_test_multiple "print *e2" "print *e2" { kfail "gdb/488" "print *e2" } -re "\\$\[0-9\]* = \r\n$gdb_prompt $" { - # See above NOTE. - fail "print *e2" + kfail "gdb/1511" "print *e2" } -re "\\$\[0-9\]* = { = .*}\r\n$gdb_prompt $" { pass "print *e2" diff --git a/gdb/testsuite/gdb.cp/templates.exp b/gdb/testsuite/gdb.cp/templates.exp index 67cfb0eb89..e3425f4a12 100644 --- a/gdb/testsuite/gdb.cp/templates.exp +++ b/gdb/testsuite/gdb.cp/templates.exp @@ -314,6 +314,9 @@ send_gdb "ptype fvpchar\n" gdb_expect { -re "type = (class |)Foo \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*.*char.*\\*t;\r\n\r\n\[ \t\]*.*char \\* foo\\(int,.*char.*\\*\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype fvpchar" } -re "type = (class |)Foo \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*.*char.*\\*t;\r\n\r\n\[ \t\]*.*char \\* foo\\(int,.*char.*\\*\\);.*\r\n\\}\r\n$gdb_prompt $" { pass "ptype fvpchar" } + -re "type = (class |)Foo \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*.*char.*\\*t;\r\n\r\n\[ \t\]*.*char \\* foo\\(int,.*char.*\\*\\);\r\n\\}\r\n$gdb_prompt $" { + kfail "gdb/1512" "ptype fvpchar" + } -re "$gdb_prompt $" { fail "ptype fvpchar" } timeout { fail "(timeout) ptype fvpchar" } } @@ -328,8 +331,10 @@ gdb_expect { -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 $" { - # This used to be a kfail gdb/33, but it shouldn't occur any more now. - fail "print Foo::foo" + # This used to be a kfail gdb/33. That problem has been + # fixed, but now gdb/931 and gdb/1512 are rearing their ugly + # heads. + kfail "gdb/931" "print Foo::foo" } -re "$gdb_prompt $" { fail "print Foo::foo" } timeout { fail "(timeout) print Foo::foo" } @@ -340,8 +345,10 @@ gdb_expect { -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 $" { - # This used to be a kfail gdb/33, but it shouldn't occur any more now. - fail "print Foo::foo" + # This used to be a kfail gdb/33. That problem has been + # fixed, but now gdb/931 and gdb/1512 are rearing their ugly + # heads. + kfail "gdb/931" "print Foo::foo" } -re "$gdb_prompt $" { fail "print Foo::foo" } timeout { fail "(timeout) print Foo::foo" } @@ -354,7 +361,7 @@ 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 "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 $" + -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/57" "ptype Bar" } -re "No symbol \"Bar\" in current context.\r\n$gdb_prompt $" @@ -369,7 +376,7 @@ gdb_expect { send_gdb "ptype bint\n" gdb_expect { - -re "type = (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 $" { pass "ptype bint" } + -re "type = (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 $" { pass "ptype bint" } -re "type = (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 $" { pass "ptype bint" } -re "$gdb_prompt $" { fail "ptype bint" } timeout { fail "(timeout) ptype bint" } @@ -379,7 +386,7 @@ gdb_expect { send_gdb "ptype bint2\n" gdb_expect { - -re "type = (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 $" { pass "ptype bint2" } + -re "type = (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 $" { pass "ptype bint2" } -re "type = (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 $" { pass "ptype bint2" } -re "$gdb_prompt $" { fail "ptype bint2" } timeout { fail "(timeout) ptype bint2" } @@ -395,6 +402,9 @@ gdb_expect { -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/57" "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.x, DWARF-2 output, running into gdb/57 and gdb/1512. + kfail "gdb/57" "ptype Baz" } -re "No symbol \"Baz\" in current context.\r\n$gdb_prompt $" { # GCC 2.95.3, stabs+ output. pass "ptype Baz" } @@ -407,7 +417,7 @@ gdb_expect { send_gdb "ptype bazint\n" gdb_expect { - -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 $" { pass "ptype bazint" } + -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 $" { pass "ptype bazint" } -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 $" { pass "ptype bazint" } -re "$gdb_prompt $" { fail "ptype bazint" } timeout { fail "(timeout) ptype bazint" } @@ -417,7 +427,7 @@ gdb_expect { send_gdb "ptype bazint2\n" gdb_expect { - -re "type = (class |)Baz \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*char t;\r\n\r\n\[ \t\]*.*char baz\\(int, char\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype bazint2" } + -re "type = (class |)Baz \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*char t;\r\n\r\n\[ \t\]*.*char baz\\(int, char\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype bazint2" } -re "type = (class |)Baz \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*char t;\r\n\r\n\[ \t\]*char baz\\(int, char\\);.*\r\n\\}\r\n$gdb_prompt $" { pass "ptype bazint2" } -re "$gdb_prompt $" { fail "ptype bazint2" } timeout { fail "(timeout) ptype bazint2" } @@ -432,6 +442,9 @@ gdb_expect { -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/57" "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.x, DWARF-2 output; gdb/57 + gdb/1512. + kfail "gdb/57" "ptype Qux" } -re "No symbol \"Qux\" in current context.\r\n$gdb_prompt $" { # GCC 2.95.3, stabs+ output. pass "ptype Qux" } @@ -445,6 +458,9 @@ send_gdb "ptype quxint\n" gdb_expect { -re "type = class Qux \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*.*int qux\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype quxint" } -re "type = class Qux \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int qux\\(int, int\\);.*\r\n\\}\r\n$gdb_prompt $" { pass "ptype quxint" } + -re "type = class Qux \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int qux\\(int, int\\);.*\r\n\\}\r\n$gdb_prompt $" { + kfail "gdb/1512" "ptype quxint" + } -re "$gdb_prompt $" { fail "ptype quxint" } timeout { fail "(timeout) ptype quxint" } } @@ -467,7 +483,7 @@ 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 "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 $" + -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/57" "ptype Spec" } -re "No symbol \"Spec\" in current context.\r\n$gdb_prompt $" @@ -481,7 +497,7 @@ gdb_expect { send_gdb "ptype siip\n" gdb_expect { - -re "type = class Spec \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\r\n\[ \t\]*.*int spec\\(int ?\\*\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype siip" } + -re "type = class Spec \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\r\n\[ \t\]*.*int spec\\(int ?\\*\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype siip" } -re "type = class Spec \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\r\n\[ \t\]*int spec\\(int ?\\*\\);.*\r\n\\}\r\n$gdb_prompt $" { pass "ptype siip" } -re "$gdb_prompt $" { fail "ptype siip" } timeout { fail "(timeout) ptype siip" }