1 # Copyright 1992, 1994, 1995, 1996, 1997, 1999, 2000, 2002, 2003
2 # Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 # Please email any bugs, comments, and/or additions to this file to:
19 # bug-gdb@prep.ai.mit.edu
21 # This file was written by Fred Fish. (fnf@cygnus.com)
29 if { [skip_cplus_tests] } { continue }
31 set testfile "templates"
32 set srcfile ${testfile}.cc
33 set binfile ${objdir}/${subdir}/${testfile}
35 # Create and source the file that provides information about the compiler
36 # used to compile the test case.
37 if [get_compiler_info ${binfile} "c++"] {
42 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
43 gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
47 # Test printing of the types of templates.
50 proc test_ptype_of_templates {} {
54 send_gdb "ptype T5<int>\n"
56 -re "type = class T5<int> \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;${ws}T5<int> & operator=\\(T5<int> const ?&\\);${ws}T5\\(int\\);${ws}T5\\((T5<int> const|const T5<int>) ?&\\);${ws}~T5\\((void|)\\);${ws}static void \\* operator new\\(unsigned( int| long)?\\);${ws}static void operator delete\\(void ?\\*\\);${ws}int value\\((void|)\\);${ws}\}\r\n$gdb_prompt $" {
59 -re "type = class T5<int> \\{${ws}public:${ws}static int X;${ws}int x;${ws}int val;${ws}${ws}T5 \\(int\\);${ws}T5 \\(const class T5<int> &\\);${ws}void ~T5 \\(int\\);${ws}static void \\* new \\(unsigned int\\);${ws}static void delete \\(void ?\\*\\);${ws}int value \\((void|)\\);${ws}\\}${ws}$gdb_prompt $" { pass "ptype T5<int> -- new with unsigned int" }
60 -re "type = class T5<int> \\{.*public:.*static int X;.*int x;.*int val;.*T5 \\(int\\);.*T5 \\(const class T5<int> &\\);.*void ~T5 \\(int\\);.*static void \\* new \\(unsigned long\\);.*static void delete \\(void ?\\*\\);.*int value \\((void|)\\);.*\\}\r\n$gdb_prompt $" { pass "ptype T5<int> -- new with unsigned long" }
61 -re "type = class T5<int> \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;((${ws}T5<int> & operator=\\(T5<int> const ?&\\);)|(${ws}T5\\(int\\);)|(${ws}T5\\((T5<int> const|const T5<int>) ?&\\);)|(${ws}~T5\\((void|)\\);)|(${ws}static void \\* operator new\\(unsigned( int| long)?\\);)|(${ws}static void operator delete\\(void ?\\*\\);)|(${ws}int value\\((void|)\\);))*${ws}\}\r\n$gdb_prompt $" {
62 pass "ptype T5<int> (obsolescent gcc or gdb)"
64 -re ".*$gdb_prompt $" {
68 fail "ptype T5<int> (timeout)"
72 send_gdb "ptype t5i\n"
74 -re "type = class T5<int> \\{${ws}public:${ws}static int X;${ws}int x;${ws}int val;\r\n${ws}T5\\(int\\);${ws}T5\\(T5<int> const ?&\\);${ws}~T5\\((void|)\\);${ws}static void \\* operator new\\(unsigned( int| long)?\\);${ws}static void operator delete\\(void ?\\*\\);${ws}int value\\((void|)\\);${ws}\\}\r\n$gdb_prompt $" { pass "ptype T5<int> -- with several fixes from 4.17" }
75 -re "type = class T5<int> \\{${ws}public:${ws}static int X;${ws}int x;${ws}int val;\r\n${ws}T5 \\(int\\);${ws}T5 \\(const class T5<int> &\\);${ws}void ~T5 \\(int\\);${ws}static void \\* new \\(unsigned int\\);${ws}static void delete \\(void ?\\*\\);${ws}int value \\((void|)\\);${ws}\\}\r\n$gdb_prompt $" { pass "ptype t5i<int> -- new with unsigned int" }
76 -re "type = class T5<int> \\{${ws}public:${ws}static int X;${ws}int x;${ws}int val;\r\n${ws}T5 \\(int\\);${ws}T5 \\(const class T5<int> &\\);${ws}void ~T5 \\(int\\);${ws}static void \\* new \\(unsigned long\\);${ws}static void delete \\(void ?\\*\\);${ws}int value \\((void|)\\);${ws}\\}\r\n$gdb_prompt $" { pass "ptype t5i<int> -- new with unsigned long" }
77 -re "type = class T5<int> \{.*public:.*static int X;.*int x;.*int val;.*.*T5 \\(int\\);.*.*void ~T5 \\(int\\).*.*.*int value \\((void|)\\);.*\}.*$gdb_prompt $" {
80 -re "type = class T5<int> \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;${ws}T5<int> & operator=\\(T5<int> const ?&\\);${ws}T5\\(int\\);${ws}T5\\((T5<int> const|const T5<int>) ?&\\);${ws}~T5\\((void|)\\);${ws}static void \\* operator new\\(unsigned( int| long)?\\);${ws}static void operator delete\\(void ?\\*\\);${ws}int value\\((void|)\\);${ws}\}\r\n$gdb_prompt $" {
83 -re "type = class T5<int> \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;((${ws}T5<int> & operator=\\(T5<int> const ?&\\);)|(${ws}T5\\(int\\);)|(${ws}T5\\(T5<int> const ?&\\);)|(${ws}~T5\\((void|)\\);)|(${ws}static void \\* operator new\\(unsigned( int| long)?\\);)|(${ws}static void operator delete\\(void ?\\*\\);)|(${ws}int value\\((void|)\\);))*${ws}\}\r\n$gdb_prompt $" {
84 pass "ptype t5i (obsolescent gcc or gdb)"
86 -re ".*$gdb_prompt $" {
90 fail "ptype t5i (timeout)"
96 # Test breakpoint setting on template methods.
99 proc test_template_breakpoints {} {
103 global hp_aCC_compiler
105 send_gdb "break T5<int>::T5\n"
107 -re "0. cancel.*\[\r\n\]*.1. all.*\[\r\n\]*.2. T5<int>::T5\\(int\\) at .*\[\r\n\]*.3. T5<int>::T5\\((T5<int> const|const T5<int>) ?&\\) at .*\[\r\n\]*> $" {
110 "constructor breakpoint (obsolete format!)"
112 -re ".0. cancel\[\r\n\]*.1. all\[\r\n\]*.2. T5<int>::T5\\((T5<int> const|const T5<int>) ?&\\) at .*templates.cc:.*\[\r\n\]*.3. T5<int>::T5\\(int\\) at .*templates.cc:.*\[\r\n\]*> $" {
115 "constructor breakpoint"
119 "nonsense intended to insure that this test fails" \
120 "constructor breakpoint (bad menu choices)"
122 -re ".*$gdb_prompt $" { fail "constructor breakpoint" }
123 default { fail "constructor breakpoint (timeout)" }
127 if {$hp_aCC_compiler} {setup_xfail hppa*-*-* CLLbs14792}
128 gdb_test "break T5<int>::~T5" \
129 "Breakpoint.*at.* file .*${testfile}.cc, line.*" \
130 "destructor breakpoint"
132 gdb_test "break T5<int>::value" \
133 "Breakpoint.*at.* file .*${testfile}.cc, line.*" \
134 "value method breakpoint"
140 # Test calling of template methods.
143 proc test_template_calls {} {
145 global hp_aCC_compiler
147 if [target_info exists gdb,cannot_call_functions] {
148 setup_xfail "*-*-*" 2416
149 fail "This target can not call functions"
153 if {!$hp_aCC_compiler} {setup_xfail hppa*-*-*}
154 send_gdb "print t5i.value()\n"
156 -re ".* = 2\[\r\n\]*$gdb_prompt $" { pass "print t5i.value()" }
157 -re "Cannot invoke functions on this machine.*$gdb_prompt $" {
158 fail "print t5i.value()"
160 -re "Cannot resolve .* to any overloaded instance.*$gdb_prompt $" {
161 setup_xfail hppa*-*-* CLLbs16899
162 xfail "print t5i.value"
164 -re ".*$gdb_prompt $" { fail "print t5i.value()" }
165 timeout { fail "print t5i.value() (timeout)" }
178 global supports_template_debugging
183 # Start with a fresh gdb.
187 gdb_reinitialize_dir $srcdir/$subdir
190 if { !$supports_template_debugging } {
191 warning "compiler lacks debugging info for templates; tests suppressed." 0
197 test_ptype_of_templates
198 test_template_breakpoints
208 # More tests for different kinds of template parameters,
209 # templates with partial specializations, nested templates, etc.
210 # These have been tested only with HP aCC. They probably won't
211 # work with other compilers because of differences in mangling
213 # Added by Satish Pai <pai@apollo.hp.com> 1997-09-25
214 # As of 2000-06-03, C++ support has been improved to the point that g++ can
215 # pass all of theses, excluding what appears to be one that exposes a stabs bug. - djb
217 # I don't know how HP could be passing these tests without this. They
218 # weren't breakpointing past a point where the below expressions were
219 # initialized in the actual source. - djb
223 -re ".*$gdb_prompt $"
227 -re ".*$gdb_prompt $"
229 send_gdb "print fint\n"
231 -re "\\$\[0-9\]* = \\{x = 0, t = 0\\}\r\n$gdb_prompt $" { pass "print fint" }
232 -re "$gdb_prompt $" { fail "print fint" }
233 timeout { fail "(timeout) print fint" }
236 send_gdb "print fvpchar\n"
238 -re "\\$\[0-9\]* = \\{x = 0, t = 0x0\\}\r\n$gdb_prompt $" { pass "print fvpchar" }
239 -re "$gdb_prompt $" { fail "print fvpchar" }
240 timeout { fail "(timeout) print fvpchar" }
245 # Neither stabs nor DWARF-2 contains type information about templates
246 # (as opposed to instantiations of templates), so in those
247 # circumstances we expect GDB to not find a symbol. HP has a debug
248 # format that contains more info, though, so it's also correct to
249 # print out template info. (This affects several subsequent tests as
252 # NOTE: carlton/2003-02-26: However, because of a bug in the way GDB
253 # handles nested types, we don't get this right in the DWARF-2 case.
255 send_gdb "ptype Foo\n"
257 -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" }
258 -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" }
259 -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 $"
260 { # GCC 3.1, DWARF-2 output.
261 kfail "gdb/57" "ptype Foo" }
262 -re "No symbol \"Foo\" in current context.\r\n$gdb_prompt $"
263 { # GCC 2.95.3, stabs+ output.
265 -re "$gdb_prompt $" { fail "ptype Foo" }
266 timeout { fail "(timeout) ptype Foo" }
268 # -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 $"
272 send_gdb "ptype fint\n"
274 -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" }
275 -re "$gdb_prompt $" { fail "ptype fint" }
276 timeout { fail "(timeout) ptype fint" }
281 send_gdb "ptype fchar\n"
283 -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" }
284 -re "$gdb_prompt $" { fail "ptype fchar" }
285 timeout { fail "(timeout) ptype fchar" }
288 # ptype Foo<volatile char *>
290 send_gdb "ptype fvpchar\n"
292 -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" }
293 -re "$gdb_prompt $" { fail "ptype fvpchar" }
294 timeout { fail "(timeout) ptype fvpchar" }
297 # print a function from Foo<volatile char *>
299 send_gdb "print Foo<volatile char *>::foo\n"
301 -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" }
302 -re "$gdb_prompt $" { fail "print Foo<volatile char *>::foo" }
303 timeout { fail "(timeout) print Foo<volatile char *>::foo" }
306 # Template Bar<T, int>
308 # same as Foo for g++
309 send_gdb "ptype Bar\n"
311 -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" }
312 -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" }
313 -re "ptype Bar\r\ntype = class Bar<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 $"
314 { # GCC 3.1, DWARF-2 output.
315 kfail "gdb/57" "ptype Bar" }
316 -re "No symbol \"Bar\" in current context.\r\n$gdb_prompt $"
317 { # GCC 2.95.3, stabs+ output.
319 -re "$gdb_prompt $" { fail "ptype Bar" }
320 timeout { fail "(timeout) ptype Bar" }
326 send_gdb "ptype bint\n"
328 -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" }
329 -re "$gdb_prompt $" { fail "ptype bint" }
330 timeout { fail "(timeout) ptype bint" }
333 # ptype Bar<int, (4>3)>
335 send_gdb "ptype bint2\n"
337 -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" }
338 -re "$gdb_prompt $" { fail "ptype bint2" }
339 timeout { fail "(timeout) ptype bint2" }
342 # Template Baz<T, char>
344 # Same as Foo, for g++
345 send_gdb "ptype Baz\n"
347 -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" }
348 -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" }
349 -re "type = class Baz<int,'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 $"
350 { # GCC 3.1, DWARF-2 output.
351 kfail "gdb/57" "ptype Baz" }
352 -re "No symbol \"Baz\" in current context.\r\n$gdb_prompt $"
353 { # GCC 2.95.3, stabs+ output.
355 -re "$gdb_prompt $" { fail "ptype Baz" }
356 timeout { fail "(timeout) ptype Baz" }
360 # ptype Baz<int, 's'>
362 send_gdb "ptype bazint\n"
364 -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" }
365 -re "$gdb_prompt $" { fail "ptype bazint" }
366 timeout { fail "(timeout) ptype bazint" }
369 # ptype Baz<char, 'a'>
371 send_gdb "ptype bazint2\n"
373 -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" }
374 -re "$gdb_prompt $" { fail "ptype bazint2" }
375 timeout { fail "(timeout) ptype bazint2" }
378 # Template Qux<T, int (*f)(int) >
379 # Same as Foo for g++
380 send_gdb "ptype Qux\n"
382 -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" }
383 -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" }
384 -re "type = class Qux<char,&string> {\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 $"
385 { # GCC 3.1, DWARF-2 output.
386 kfail "gdb/57" "ptype Qux" }
387 -re "No symbol \"Qux\" in current context.\r\n$gdb_prompt $"
388 { # GCC 2.95.3, stabs+ output.
390 -re "$gdb_prompt $" { fail "ptype Qux" }
391 timeout { fail "(timeout) ptype Qux" }
394 # pt Qux<int,&string>
396 send_gdb "ptype quxint\n"
398 -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" }
399 -re "$gdb_prompt $" { fail "ptype quxint" }
400 timeout { fail "(timeout) ptype quxint" }
405 # commented out this as quxint2 declaration was commented out in
406 # templates.exp -- ovidiu
407 # send_gdb "ptype quxint2\n"
409 # -re "type = class Qux<char,&string> \\{\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 $" { pass "ptype quxint2" }
410 # -re "$gdb_prompt $" { fail "ptype quxint2" }
411 # timeout { fail "(timeout) ptype quxint2" }
414 # Template Spec<T1, T2>
416 # Same as Foo for g++
417 send_gdb "ptype Spec\n"
419 -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" }
420 -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" }
421 -re "type = class Spec<int,char> {\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\r\n\[ \t\]*int spec\\(char\\);\r\n}\r\n$gdb_prompt $"
422 { # GCC 3.1, DWARF-2 output.
423 kfail "gdb/57" "ptype Spec" }
424 -re "No symbol \"Spec\" in current context.\r\n$gdb_prompt $"
425 { # GCC 2.95.3, stabs+ output.
427 -re "$gdb_prompt $" { fail "ptype Spec" }
428 timeout { fail "(timeout) ptype Spec" }
433 send_gdb "ptype siip\n"
435 -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" }
436 -re "$gdb_prompt $" { fail "ptype siip" }
437 timeout { fail "(timeout) ptype siip" }
442 send_gdb "ptype Garply<int>\n"
444 -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>" }
445 -re "$gdb_prompt $" { fail "ptype Garply<int>" }
446 timeout { fail "(timeout) ptype Garply<int>" }
449 # ptype of nested template name
451 send_gdb "ptype Garply<Garply<char> >\n"
453 -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> >" }
454 -re "$gdb_prompt $" { fail "ptype Garply<Garply<char> >" }
455 timeout { fail "(timeout) ptype Garply<Garply<char> >" }
458 # print out a function from a nested template name
460 send_gdb "print Garply<Garply<char> >::garply\n"
462 -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" }
463 -re ".*$gdb_prompt $" { fail "print Garply<Garply<char> >::garply" }
464 timeout { fail "print Garply<Garply<char> >::garply (timeout)" }
468 # Now should work fine
469 send_gdb "break Garply<Garply<char> >::garply\n"
471 -re "Breakpoint \[0-9\]* at $hex: file .*templates.cc, line.*\r\n$gdb_prompt $" { pass "break Garply<Garply<char> >::garply" }
472 -re ".*$gdb_prompt $" { fail "break Garply<Garply<char> >::garply" }
473 timeout { fail "break Garply<Garply<char> >::garply (timeout)" }