diff options
author | Daniel Berlin <dberlin@dberlin.org> | 2000-06-05 20:47:28 +0000 |
---|---|---|
committer | Daniel Berlin <dberlin@dberlin.org> | 2000-06-05 20:47:28 +0000 |
commit | e6d71bf34e01d840417e4fac1bcedae5fff5b9dc (patch) | |
tree | 98b61a565f6386a4c35dc2f238506702f2dd69fa /gdb | |
parent | 9d6eee7847fb08dc1d559227f6190a14fe7008f0 (diff) | |
download | fsf-binutils-gdb-e6d71bf34e01d840417e4fac1bcedae5fff5b9dc.zip fsf-binutils-gdb-e6d71bf34e01d840417e4fac1bcedae5fff5b9dc.tar.gz fsf-binutils-gdb-e6d71bf34e01d840417e4fac1bcedae5fff5b9dc.tar.bz2 |
New tests, fix old tests, make more tests work
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/testsuite/ChangeLog | 11 | ||||
-rw-r--r-- | gdb/testsuite/gdb.c++/Makefile.in | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.c++/ctti.exp | 13 | ||||
-rw-r--r-- | gdb/testsuite/gdb.c++/misc.cc | 10 | ||||
-rw-r--r-- | gdb/testsuite/gdb.c++/namespace.exp | 191 | ||||
-rw-r--r-- | gdb/testsuite/gdb.c++/templates.cc | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.c++/templates.exp | 75 |
7 files changed, 272 insertions, 34 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index b6f4ee5..cfe54ce 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,14 @@ +2000-06-03 Daniel Berlin <dan@cgsoftware.com> + + * gdb.c++/templates.exp (do_tests): Make all of these work under + g++, and stop skipping them. + + * gdb.c++/namespace.exp: Move from gdb.hp/gdb.aCC to here, make it + work under g++. + + * gdb.c++/misc.cc: Fix ambiguous initialization with correct initialization. + + 2000-05-18 Michael Snyder <msnyder@seadog.cygnus.com> * gdb.base/annota1.exp (annotate-signal-handler-caller): diff --git a/gdb/testsuite/gdb.c++/Makefile.in b/gdb/testsuite/gdb.c++/Makefile.in index 58ef94b..ee8e263 100644 --- a/gdb/testsuite/gdb.c++/Makefile.in +++ b/gdb/testsuite/gdb.c++/Makefile.in @@ -3,7 +3,7 @@ srcdir = @srcdir@ EXECUTABLES = ambiguous annota2 anon-union cplusfuncs cttiadd \ derivation inherit local member-ptr method misc \ - overload ovldbreak ref-typ ref-typ2 templates userdef virtfunc + overload ovldbreak ref-typ ref-typ2 templates userdef virtfunc namespace all: @echo "Nothing to be done for all..." diff --git a/gdb/testsuite/gdb.c++/ctti.exp b/gdb/testsuite/gdb.c++/ctti.exp index 135dcf4..fb16b22 100644 --- a/gdb/testsuite/gdb.c++/ctti.exp +++ b/gdb/testsuite/gdb.c++/ctti.exp @@ -1,4 +1,4 @@ -# Copyright (C) 1998, 1999 Free Software Foundation, Inc. +`# Copyright (C) 1998, 1999 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 @@ -42,15 +42,14 @@ if [get_compiler_info ${binfile} "c++"] { return -1; } -if { $gcc_compiled } then { continue } -#if { [gdb_compile "${srcdir}/${subdir}/${srcfile} ${srcdir}/${subdir}/${srcfile1} ${srcdir}/${subdir}/${srcfile2} ${srcdir}/${subdir}/${srcfile3}" "${binfile}" executable {debug c++}] != "" } { -# gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." -#} +if { [gdb_compile "${srcdir}/${subdir}/${srcfile} ${srcdir}/${subdir}/${srcfile1} ${srcdir}/${subdir}/${srcfile2} ${srcdir}/${subdir}/${srcfile3}" "${binfile}" executable {debug c++}] != "" } { + gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." +} -set cmdline "$CXX_FOR_TARGET ${srcdir}/${subdir}/${srcfile} ${srcdir}/${subdir}/${srcfile1} ${srcdir}/${subdir}/${srcfile2} ${srcdir}/${subdir}/${srcfile3} -g -o ${binfile}" +#set cmdline "$CXX_FOR_TARGET ${srcdir}/${subdir}/${srcfile} ${srcdir}/${subdir}/${srcfile1} ${srcdir}/${subdir}/${srcfile2} ${srcdir}/${subdir}/${srcfile3} -g -o ${binfile}" -remote_exec build $cmdline +#remote_exec build $cmdline gdb_exit gdb_start diff --git a/gdb/testsuite/gdb.c++/misc.cc b/gdb/testsuite/gdb.c++/misc.cc index 7c212cc..3090800 100644 --- a/gdb/testsuite/gdb.c++/misc.cc +++ b/gdb/testsuite/gdb.c++/misc.cc @@ -215,6 +215,16 @@ void inheritance1 (void) // ????? = 11; (g_D.A::a = 11; is ambiguous) // ????? = 12; (g_D.A::x = 12; is ambiguous) +/* djb 6-3-2000 + + This should take care of it. Rather than try to initialize using an ambiguous + construct, use 2 unambiguous ones for each. Since the ambiguous a/x member is + coming from C, and B, initialize D's C::a, and B::a, and D's C::x and B::x. + */ + g_D.C::a = 15; + g_D.C::x = 12; + g_D.B::a = 11; + g_D.B::x = 12; g_D.B::b = 13; g_D.B::x = 14; // ????? = 15; diff --git a/gdb/testsuite/gdb.c++/namespace.exp b/gdb/testsuite/gdb.c++/namespace.exp new file mode 100644 index 0000000..9298c90 --- /dev/null +++ b/gdb/testsuite/gdb.c++/namespace.exp @@ -0,0 +1,191 @@ +# Copyright (C) 1997, 1998 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 +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# Please email any bugs, comments, and/or additions to this file to: +# bug-gdb@prep.ai.mit.edu + +# tests for namespaces +# Written by Satish Pai <pai@apollo.hp.com> 1997-07-23 + +# This file is part of the gdb testsuite + +# Note: These tests are geared to the HP aCC compiler, +# which has an idiosyncratic way of emitting debug info +# for namespaces. +# Note: As of 2000-06-03, these pass under g++ - djb + + +if $tracelevel then { + strace $tracelevel + } + +set prms_id 0 +set bug_id 0 + + +set testfile "namespace" +set srcfile ${testfile}.cc +set binfile ${objdir}/${subdir}/${testfile} + +if [get_compiler_info ${binfile}] { + return -1; +} + + + +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { + gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will a +utomatically fail." +} + + + +gdb_exit +gdb_start +gdb_reinitialize_dir $srcdir/$subdir +gdb_load ${binfile} + + +# +# set it up at a breakpoint so we can play with the variable values +# +if ![runto_main] then { + perror "couldn't run to breakpoint" + continue +} + +send_gdb "break marker1\n" ; gdb_expect -re ".*$gdb_prompt $" + send_gdb "cont\n" + gdb_expect { + -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" { + send_gdb "up\n" + gdb_expect { + -re ".*$gdb_prompt $" { pass "up from marker1" } + timeout { fail "up from marker1" } + } + } + -re "$gdb_prompt $" { fail "continue to marker1" } + timeout { fail "(timeout) continue to marker1" } + } + +# Access a data item inside a namespace using colons and +# single quotes :-( + +send_gdb "print 'AAA::c'\n" +gdb_expect { + -re "\\$\[0-9\]* = 0 '\\\\000'\r\n$gdb_prompt $" { pass "print 'AAA::c'" } + -re ".*$gdb_prompt $" { fail "print 'AAA::c'" } + timeout { fail "(timeout) print 'AAA::c'" } +} + +# An object declared using "using". + +send_gdb "print ina\n" +gdb_expect { + -re "\\$\[0-9\]+ = {xx = 33}.*$gdb_prompt $" { + pass "print ina" + } + -re ".*$gdb_prompt $" { fail "print ina" } + timeout { fail "(timeout) print ina" } +} + +send_gdb "ptype ina\n" +gdb_expect { + -re "type = class (AAA::|)inA \{\r\n\[ \]*public:\r\n\[ \]*int xx;\r\n\[ \]*\r\n\[ \]*.*int fum\\(int\\);\r\n\}\r\n$gdb_prompt $" { + pass "ptype ina" + } + -re ".*$gdb_prompt $" { fail "ptype ina" } + timeout { fail "(timeout) ptype ina" } +} + +# Check all functions are known to GDB + +setup_xfail hppa*-*-*11* CLLbs14869 +send_gdb "info func xyzq\n" +gdb_expect { + -re "All functions.*File.*namespace.cc:\r\nint AAA::A_xyzq\\(int\\);\r\nint BBB::B_xyzq\\(int\\);\r\nchar AAA::xyzq\\(char\\);\r\nchar BBB::xyzq\\(char\\);\r\nchar BBB::CCC::xyzq\\(char\\);\r\nchar BBB::Class::xyzq\\(char\\);\r\n$gdb_prompt $" { + pass "info func xyzq" + } + -re ".*$gdb_prompt $" { fail "info func xyzq" } + timeout { fail "(timeout) info func xyzq" } +} + +# Call a function in a namespace + +send_gdb "print 'AAA::xyzq'('x')\n" +gdb_expect { + -re "\\$\[0-9\]* = 97 'a'\r\n$gdb_prompt $" { + pass "print 'AAA::xyzq'('x')" + } + -re ".*$gdb_prompt $" { fail "print 'AAA::xyzq'('x')" } + timeout { fail "(timeout) print 'AAA::xyzq'('x')" } +} + +# Break on a function in a namespace + +send_gdb "break AAA::xyzq\n" +gdb_expect { + -re "Breakpoint.*at $hex: file.*namespace.cc, line 42\\.\r\n$gdb_prompt $" { + pass "break AAA::xyzq" + } + -re ".*$gdb_prompt $" { fail "break AAA::xyzq" } + timeout { fail "(timeout) break AAA::xyzq" } +} + +# Call a function in a nested namespace + +send_gdb "print 'BBB::CCC::xyzq'('x')\n" +gdb_expect { + -re "\\$\[0-9\]* = 122 'z'\r\n$gdb_prompt $" { + pass "print 'BBB::CCC::xyzq'('x')" + } + -re ".*$gdb_prompt $" { fail "print 'BBB::CCC::xyzq'('x')" } + timeout { fail "(timeout) print 'BBB::CCC::xyzq'('x')" } +} + +# Break on a function in a nested namespace + +send_gdb "break BBB::CCC::xyzq\n" +gdb_expect { + -re "Breakpoint.*at $hex: file.*namespace.cc, line 58\\.\r\n$gdb_prompt $" { + pass "break BBB::CCC::xyzq" + } + -re ".*$gdb_prompt $" { fail "break BBB::CCC::xyzq" } + timeout { fail "(timeout) break BBB::CCC::xyzq" } +} + +# Print address of a function in a class in a namespace + +send_gdb "print 'BBB::Class::xyzq'\n" +gdb_expect { + -re "\\$\[0-9\]* = \{char \\((BBB::|)Class \\*, (char|int)\\)\} $hex <BBB::Class::xyzq\\(char\\)>\r\n$gdb_prompt $" { + pass "print 'BBB::Class'::xyzq" + } + -re ".*$gdb_prompt $" { fail "print 'BBB::Class'::xyzq" } + timeout { fail "(timeout) print 'BBB::Class'::xyzq" } +} + +# Break on a function in a class in a namespace + +send_gdb "break BBB::Class::xyzq\n" +gdb_expect { + -re "Breakpoint.*at $hex: file.*namespace.cc, line 63\\.\r\n$gdb_prompt $" { + pass "break BBB::Class::xyzq" + } + -re ".*$gdb_prompt $" { fail "break BBB::Class::xyzq" } + timeout { fail "(timeout) break BBB::Class::xyzq" } +} + diff --git a/gdb/testsuite/gdb.c++/templates.cc b/gdb/testsuite/gdb.c++/templates.cc index 1ef0100..ce4481a 100644 --- a/gdb/testsuite/gdb.c++/templates.cc +++ b/gdb/testsuite/gdb.c++/templates.cc @@ -714,8 +714,8 @@ int main() // New tests added here - Foo<int> fint; - Foo<char> fchar; + Foo<int> fint={0,0}; + Foo<char> fchar={0,0}; Foo<volatile char *> fvpchar = {0, 0}; Bar<int, 33> bint; diff --git a/gdb/testsuite/gdb.c++/templates.exp b/gdb/testsuite/gdb.c++/templates.exp index 5b8875e..91acc82 100644 --- a/gdb/testsuite/gdb.c++/templates.exp +++ b/gdb/testsuite/gdb.c++/templates.exp @@ -209,7 +209,6 @@ proc do_tests {} { do_tests -if {!$hp_aCC_compiler} {continue} # More tests for different kinds of template parameters, # templates with partial specializations, nested templates, etc. @@ -217,7 +216,21 @@ if {!$hp_aCC_compiler} {continue} # work with other compilers because of differences in mangling # schemes. # Added by Satish Pai <pai@apollo.hp.com> 1997-09-25 +# As of 2000-06-03, C++ support has been improved to the point that g++ can +# pass all of theses, excluding what appears to be one that exposes a stabs bug. - djb +# I don't know how HP could be passing these tests without this. They +# weren't breakpointing past a point where the below expressions were +# initialized in the actual source. - djb + +send_gdb "b 770\n" +gdb_expect { + -re ".*$gdb_prompt $" +} +send_gdb "c\n" +gdb_expect { + -re ".*$gdb_prompt $" +} send_gdb "print fint\n" gdb_expect { -re "\\$\[0-9\]* = \\{x = 0, t = 0\\}\r\n$gdb_prompt $" { pass "print fint" } @@ -235,6 +248,9 @@ gdb_expect { # Template Foo<T> setup_xfail hppa2.0w-*-* 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<volatile char \\*>\r\n\[ \t\]*(class |)Foo<char>\r\n\[ \t\]*(class |)Foo<int>\r\n$gdb_prompt $" { pass "ptype Foo" } @@ -247,7 +263,7 @@ gdb_expect { send_gdb "ptype fint\n" gdb_expect { - -re "type = (class |)Foo<int> \\{\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 $" { pass "ptype fint" } + -re "type = (class |)Foo<int> \\{\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 $" { pass "ptype fint" } -re "$gdb_prompt $" { fail "ptype fint" } timeout { fail "(timeout) ptype fint" } } @@ -256,7 +272,7 @@ gdb_expect { send_gdb "ptype fchar\n" gdb_expect { - -re "type = (class |)Foo<char> \\{\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 fchar" } + -re "type = (class |)Foo<char> \\{\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 fchar" } -re "$gdb_prompt $" { fail "ptype fchar" } timeout { fail "(timeout) ptype fchar" } } @@ -265,7 +281,7 @@ gdb_expect { send_gdb "ptype fvpchar\n" gdb_expect { - -re "type = (class |)Foo<volatile char \\*> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*volatile char \\*t;\r\n\r\n\[ \t\]*volatile char \\* foo\\(int, volatile char \\*\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype fvpchar" } + -re "type = (class |)Foo<volatile char \\*> \\{\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 "$gdb_prompt $" { fail "ptype fvpchar" } timeout { fail "(timeout) ptype fvpchar" } } @@ -274,7 +290,7 @@ gdb_expect { send_gdb "print Foo<volatile char *>::foo\n" gdb_expect { - -re "\\$\[0-9\]* = \\{volatile char \\*\\((class |)Foo<volatile char \\*> \\*, int, volatile char \\*\\)\\} $hex <Foo<volatile char \\*>::foo\\(int, volatile char \\*\\)>\r\n$gdb_prompt $" { pass "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 "$gdb_prompt $" { fail "print Foo<volatile char *>::foo" } timeout { fail "(timeout) print Foo<volatile char *>::foo" } } @@ -282,6 +298,8 @@ gdb_expect { # Template Bar<T, int> setup_xfail hppa2.0w-*-* 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<int,(\\(int\\)|)1>\r\n\[ \t\]*(class |)Bar<int,(\\(int\\)|)33>\r\n$gdb_prompt $" { pass "ptype Bar" } @@ -292,10 +310,14 @@ gdb_expect { # ptype Bar<int,33> - +# stabs screws this test royally. +# It thinks it has a badly mangled name. +# I blame stabs, the other formats get it right. -djb +get_debug_format +setup_xfail_format "stabs" send_gdb "ptype bint\n" gdb_expect { - -re "type = (class |)Bar<int,(\\(int\\)|)33> \\{\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<int,(\\(int\\)|)33> \\{\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" } } @@ -304,7 +326,7 @@ gdb_expect { send_gdb "ptype bint2\n" gdb_expect { - -re "type = (class |)Bar<int,(\\(int\\)|)1> \\{\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<int,(\\(int\\)|)1> \\{\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" } } @@ -312,6 +334,8 @@ gdb_expect { # Template Baz<T, char> setup_xfail hppa2.0w-*-* 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<char,(\\(char\\)|)97>\r\n\[ \t\]*(class |)Baz<int,(\\(char\\)|)115>\r\n$gdb_prompt $" { pass "ptype Baz" } @@ -325,7 +349,7 @@ gdb_expect { send_gdb "ptype bazint\n" gdb_expect { - -re "type = (class |)Baz<int,(\\(char\\)|)115> \\{\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<int,(\\(char\\)|)(115|\\'s\\')> \\{\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" } } @@ -334,13 +358,14 @@ gdb_expect { send_gdb "ptype bazint2\n" gdb_expect { - -re "type = (class |)Baz<char,(\\(char\\)|)97> \\{\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<char,(\\(char\\)|)(97|\\'a\\')> \\{\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" } } # Template Qux<T, int (*f)(int) > - +# 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<int,&string>\r\n\[ \t\]*(class |)Qux<char,&string>\r\n$gdb_prompt $" { pass "ptype Qux" } @@ -353,7 +378,7 @@ gdb_expect { send_gdb "ptype quxint\n" gdb_expect { - -re "type = class Qux<int,&string> \\{\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<int,&string> \\{\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 "$gdb_prompt $" { fail "ptype quxint" } timeout { fail "(timeout) ptype quxint" } } @@ -372,6 +397,8 @@ gdb_expect { # Template Spec<T1, T2> setup_xfail hppa2.0w-*-* 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<int,int \\*>\r\n\[ \t\]*(class |)Spec<int,char>\r\n$gdb_prompt $" { pass "ptype Spec" } @@ -384,7 +411,7 @@ gdb_expect { send_gdb "ptype siip\n" gdb_expect { - -re "type = class Spec<int,int \\*> \\{\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<int,int \\*> \\{\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" } } @@ -393,7 +420,7 @@ gdb_expect { send_gdb "ptype Garply<int>\n" gdb_expect { - -re "type = class Garply<int> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int garply\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype Garply<int>" } + -re "type = class Garply<int> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*.*int garply\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype Garply<int>" } -re "$gdb_prompt $" { fail "ptype Garply<int>" } timeout { fail "(timeout) ptype Garply<int>" } } @@ -402,7 +429,7 @@ gdb_expect { send_gdb "ptype Garply<Garply<char> >\n" gdb_expect { - -re "type = (class |)Garply<Garply<char> > \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*(class |)Garply<char> t;\r\n\r\n\[ \t\]*(class |)Garply<char> garply\\(int, (class |)Garply<char>\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype Garply<Garply<char> >" } + -re "type = (class |)Garply<Garply<char> > \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*.*(class |)Garply<char> t;\r\n\r\n\[ \t\]*.*(class |)Garply<char> garply\\(int, (class |)Garply<char>\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype Garply<Garply<char> >" } -re "$gdb_prompt $" { fail "ptype Garply<Garply<char> >" } timeout { fail "(timeout) ptype Garply<Garply<char> >" } } @@ -411,16 +438,16 @@ gdb_expect { send_gdb "print Garply<Garply<char> >::garply\n" gdb_expect { - -re "\\$\[0-9\]* = \\{(class |)Garply<char> \\((class |)Garply<Garply<char> > \\*, int, (class |)Garply<char>\\)\\} $hex <Garply<Garply<char>>::garply\\(int, (class |)Garply<char>\\)>\r\n$gdb_prompt $" { pass "print Garply<Garply<char> >::garply" } + -re "\\$\[0-9\]* = \\{(class |)Garply<char> \\((class |)Garply<Garply<char> > \\*, int, (class |)Garply<char>\\)\\} $hex <Garply<Garply<char>\[ \t\]*>::garply\\(int, (class |)Garply<char>\\)>\r\n$gdb_prompt $" { pass "print Garply<Garply<char> >::garply" } -re ".*$gdb_prompt $" { fail "print Garply<Garply<char> >::garply" } timeout { fail "print Garply<Garply<char> >::garply (timeout)" } } -# UNFORTUNATELY, "break Garply<Garply<char> >::garply" doesn't yet work. - -#send_gdb "break Garply<Garply<char> >::garply -#gdb_expect { -# -re "Breakpoint \[0-9\]* at $hex: file .*templates.cc, line.*\r\n$gdb_prompt $" { pass "break Garply<Garply<char> >::garply" } -# -re ".*$gdb_prompt $" { fail "break Garply<Garply<char> >::garply" } -# timeout { fail "break Garply<Garply<char> >::garply (timeout)" } -#} +# djb - 06-03-2000 +# Now should work fine +send_gdb "break Garply<Garply<char> >::garply\n" +gdb_expect { + -re "Breakpoint \[0-9\]* at $hex: file .*templates.cc, line.*\r\n$gdb_prompt $" { pass "break Garply<Garply<char> >::garply" } + -re ".*$gdb_prompt $" { fail "break Garply<Garply<char> >::garply" } + timeout { fail "break Garply<Garply<char> >::garply (timeout)" } +} |