From: Daniel Berlin Date: Mon, 5 Jun 2000 20:47:28 +0000 (+0000) Subject: New tests, fix old tests, make more tests work X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e6d71bf34e01d840417e4fac1bcedae5fff5b9dc;p=binutils-gdb.git New tests, fix old tests, make more tests work --- diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index b6f4ee5937c..cfe54cedf6c 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,14 @@ +2000-06-03 Daniel Berlin + + * 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 * 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 58ef94bf233..ee8e2635cbf 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 135dcf45538..fb16b2292a4 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 7c212cc5f1c..3090800c7d6 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 00000000000..9298c90e79e --- /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 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 \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 1ef0100438f..ce4481a2fb4 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 fint; - Foo fchar; + Foo fint={0,0}; + Foo fchar={0,0}; Foo fvpchar = {0, 0}; Bar bint; diff --git a/gdb/testsuite/gdb.c++/templates.exp b/gdb/testsuite/gdb.c++/templates.exp index 5b8875eb8e7..91acc822250 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 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 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\r\n\[ \t\]*(class |)Foo\r\n\[ \t\]*(class |)Foo\r\n$gdb_prompt $" { pass "ptype Foo" } @@ -247,7 +263,7 @@ gdb_expect { send_gdb "ptype fint\n" gdb_expect { - -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 $" { pass "ptype fint" } + -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 $" { 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 \\{\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 \\{\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 \\{\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 \\{\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::foo\n" gdb_expect { - -re "\\$\[0-9\]* = \\{volatile char \\*\\((class |)Foo \\*, int, volatile char \\*\\)\\} $hex ::foo\\(int, volatile char \\*\\)>\r\n$gdb_prompt $" { pass "print Foo::foo" } + -re "\\$\[0-9\]* = \\{.*char \\*\\((class |)Foo \\*, int, .*char \\*\\)\\} $hex ::foo\\(int, .*char.*\\*\\)>\r\n$gdb_prompt $" { pass "print Foo::foo" } -re "$gdb_prompt $" { fail "print Foo::foo" } timeout { fail "(timeout) print Foo::foo" } } @@ -282,6 +298,8 @@ gdb_expect { # Template Bar 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\r\n\[ \t\]*(class |)Bar\r\n$gdb_prompt $" { pass "ptype Bar" } @@ -292,10 +310,14 @@ gdb_expect { # ptype Bar - +# 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 \\{\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" } } @@ -304,7 +326,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 "$gdb_prompt $" { fail "ptype bint2" } timeout { fail "(timeout) ptype bint2" } } @@ -312,6 +334,8 @@ gdb_expect { # Template Baz 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\r\n\[ \t\]*(class |)Baz\r\n$gdb_prompt $" { pass "ptype Baz" } @@ -325,7 +349,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 "$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 \\{\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" } } # 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" } @@ -353,7 +378,7 @@ gdb_expect { 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 "$gdb_prompt $" { fail "ptype quxint" } timeout { fail "(timeout) ptype quxint" } } @@ -372,6 +397,8 @@ gdb_expect { # Template Spec 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\r\n\[ \t\]*(class |)Spec\r\n$gdb_prompt $" { pass "ptype Spec" } @@ -384,7 +411,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 "$gdb_prompt $" { fail "ptype siip" } timeout { fail "(timeout) ptype siip" } } @@ -393,7 +420,7 @@ gdb_expect { send_gdb "ptype Garply\n" gdb_expect { - -re "type = class Garply \\{\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" } + -re "type = class Garply \\{\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" } -re "$gdb_prompt $" { fail "ptype Garply" } timeout { fail "(timeout) ptype Garply" } } @@ -402,7 +429,7 @@ gdb_expect { send_gdb "ptype Garply >\n" gdb_expect { - -re "type = (class |)Garply > \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*(class |)Garply t;\r\n\r\n\[ \t\]*(class |)Garply garply\\(int, (class |)Garply\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype Garply >" } + -re "type = (class |)Garply > \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*.*(class |)Garply t;\r\n\r\n\[ \t\]*.*(class |)Garply garply\\(int, (class |)Garply\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype Garply >" } -re "$gdb_prompt $" { fail "ptype Garply >" } timeout { fail "(timeout) ptype Garply >" } } @@ -411,16 +438,16 @@ gdb_expect { send_gdb "print Garply >::garply\n" gdb_expect { - -re "\\$\[0-9\]* = \\{(class |)Garply \\((class |)Garply > \\*, int, (class |)Garply\\)\\} $hex >::garply\\(int, (class |)Garply\\)>\r\n$gdb_prompt $" { pass "print Garply >::garply" } + -re "\\$\[0-9\]* = \\{(class |)Garply \\((class |)Garply > \\*, int, (class |)Garply\\)\\} $hex \[ \t\]*>::garply\\(int, (class |)Garply\\)>\r\n$gdb_prompt $" { pass "print Garply >::garply" } -re ".*$gdb_prompt $" { fail "print Garply >::garply" } timeout { fail "print Garply >::garply (timeout)" } } -# UNFORTUNATELY, "break Garply >::garply" doesn't yet work. - -#send_gdb "break Garply >::garply -#gdb_expect { -# -re "Breakpoint \[0-9\]* at $hex: file .*templates.cc, line.*\r\n$gdb_prompt $" { pass "break Garply >::garply" } -# -re ".*$gdb_prompt $" { fail "break Garply >::garply" } -# timeout { fail "break Garply >::garply (timeout)" } -#} +# djb - 06-03-2000 +# Now should work fine +send_gdb "break Garply >::garply\n" +gdb_expect { + -re "Breakpoint \[0-9\]* at $hex: file .*templates.cc, line.*\r\n$gdb_prompt $" { pass "break Garply >::garply" } + -re ".*$gdb_prompt $" { fail "break Garply >::garply" } + timeout { fail "break Garply >::garply (timeout)" } +}