OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [gdb/] [testsuite/] [gdb.c++/] [templates.exp] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
# Copyright 1992, 1994, 1995, 1996, 1997, 1999, 2000
2
# Free Software Foundation, Inc.
3
 
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.
8
#
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.
13
#
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.
17
 
18
# Please email any bugs, comments, and/or additions to this file to:
19
# bug-gdb@prep.ai.mit.edu
20
 
21
# This file was written by Fred Fish. (fnf@cygnus.com)
22
 
23
set ws "\[\r\n\t \]+"
24
 
25
if $tracelevel then {
26
        strace $tracelevel
27
}
28
 
29
if { [skip_cplus_tests] } { continue }
30
 
31
set testfile "templates"
32
set srcfile ${testfile}.cc
33
set binfile ${objdir}/${subdir}/${testfile}
34
 
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++"] {
38
    return -1
39
}
40
source ${binfile}.ci
41
 
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."
44
}
45
 
46
#
47
#  Test printing of the types of templates.
48
#
49
 
50
proc test_ptype_of_templates {} {
51
    global gdb_prompt
52
    global ws
53
 
54
    send_gdb "ptype T5\n"
55
    gdb_expect {
56
        -re "type = class T5 \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;${ws}T5 & operator=\\(T5 const &\\);${ws}T5\\(int\\);${ws}T5\\(T5 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 $" {
57
            pass "ptype T5"
58
        }
59
        -re "type = class T5 \\{${ws}public:${ws}static int X;${ws}int x;${ws}int val;${ws}${ws}T5 \\(int\\);${ws}T5 \\(const class T5 &\\);${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 -- new with unsigned int" }
60
        -re "type = class T5 \\{.*public:.*static int X;.*int x;.*int val;.*T5 \\(int\\);.*T5 \\(const class T5 &\\);.*void ~T5 \\(int\\);.*static void \\* new \\(unsigned long\\);.*static void delete \\(void \\*\\);.*int value \\(void\\);.*\\}\r\n$gdb_prompt $" { pass "ptype T5 -- new with unsigned long" }
61
        -re "type = class T5 \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;((${ws}T5 & operator=\\(T5 const &\\);)|(${ws}T5\\(int\\);)|(${ws}T5\\(T5 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 $" {
62
            pass "ptype T5 (obsolescent gcc or gdb)"
63
        }
64
        -re ".*$gdb_prompt $" {
65
            fail "ptype T5"
66
        }
67
        timeout {
68
            fail "ptype T5 (timeout)"
69
        }
70
    }
71
 
72
    send_gdb "ptype t5i\n"
73
    gdb_expect {
74
        -re "type = class T5 \\{${ws}public:${ws}static int X;${ws}int x;${ws}int val;\r\n${ws}T5\\(int\\);${ws}T5\\(T5 const &\\);${ws}~T5\\(void\\);${ws}static void \\* operator new\\(unsigned int\\);${ws}static void operator delete\\(void \\*\\);${ws}int value\\(void\\);${ws}\\}\r\n$gdb_prompt $" { pass "ptype T5 -- with several fixes from 4.17" }
75
        -re "type = class T5 \\{${ws}public:${ws}static int X;${ws}int x;${ws}int val;\r\n${ws}T5 \\(int\\);${ws}T5 \\(const class T5 &\\);${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 -- new with unsigned int" }
76
        -re "type = class T5 \\{${ws}public:${ws}static int X;${ws}int x;${ws}int val;\r\n${ws}T5 \\(int\\);${ws}T5 \\(const class T5 &\\);${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 -- new with unsigned long" }
77
        -re "type = class T5 \{.*public:.*static int X;.*int x;.*int val;.*.*T5 \\(int\\);.*.*void ~T5 \\(int\\).*.*.*int value \\(void\\);.*\}.*$gdb_prompt $" {
78
            pass "ptype t5i"
79
        }
80
        -re "type = class T5 \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;${ws}T5 & operator=\\(T5 const &\\);${ws}T5\\(int\\);${ws}T5\\(T5 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 $" {
81
            pass "ptype t5i"
82
        }
83
        -re "type = class T5 \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;((${ws}T5 & operator=\\(T5 const &\\);)|(${ws}T5\\(int\\);)|(${ws}T5\\(T5 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)"
85
        }
86
        -re ".*$gdb_prompt $" {
87
            fail "ptype t5i"
88
        }
89
        timeout {
90
            fail "ptype t5i (timeout)"
91
        }
92
    }
93
}
94
 
95
#
96
#  Test breakpoint setting on template methods.
97
#
98
 
99
proc test_template_breakpoints {} {
100
    global gdb_prompt
101
    global testfile
102
    global srcdir
103
    global hp_aCC_compiler
104
 
105
    send_gdb "break T5::T5\n"
106
    gdb_expect {
107
        -re "0. cancel.*\[\r\n\]*.1. all.*\[\r\n\]*.2. T5::T5\\(int\\) at .*\[\r\n\]*.3. T5::T5\\(T5 const &\\) at .*\[\r\n\]*> $" {
108
            gdb_test "0" \
109
                "canceled" \
110
                "constructor breakpoint (obsolete format!)"
111
        }
112
        -re ".0. cancel\[\r\n\]*.1. all\[\r\n\]*.2. T5::T5\\(T5 const &\\) at .*templates.cc:.*\[\r\n\]*.3. T5::T5\\(int\\) at .*templates.cc:.*\[\r\n\]*> $" {
113
            gdb_test "0" \
114
                "canceled" \
115
                "constructor breakpoint"
116
        }
117
        -re ".*\n> $" { fail "constructor breakpoint" }
118
        -re ".*$gdb_prompt $" { fail "constructor breakpoint" }
119
        default { fail "constructor breakpoint (timeout)" }
120
    }
121
 
122
# See CLLbs14792
123
    if {$hp_aCC_compiler} {setup_xfail hppa*-*-* CLLbs14792}
124
    gdb_test "break T5::~T5" \
125
        "Breakpoint.*at.* file .*${testfile}.cc, line.*" \
126
        "destructor breakpoint"
127
 
128
    gdb_test "break T5::value" \
129
        "Breakpoint.*at.* file .*${testfile}.cc, line.*" \
130
        "value method breakpoint"
131
 
132
    delete_breakpoints
133
}
134
 
135
#
136
#  Test calling of template methods.
137
#
138
 
139
proc test_template_calls {} {
140
    global gdb_prompt
141
    global hp_aCC_compiler
142
 
143
    if [target_info exists gdb,cannot_call_functions] {
144
        setup_xfail "*-*-*" 2416
145
        fail "This target can not call functions"
146
        return
147
    }
148
 
149
    if {!$hp_aCC_compiler} {setup_xfail hppa*-*-*}
150
    send_gdb "print t5i.value()\n"
151
    gdb_expect {
152
        -re ".* = 2\[\r\n\]*$gdb_prompt $" { pass "print t5i.value()" }
153
        -re "Cannot invoke functions on this machine.*$gdb_prompt $" {
154
            fail "print t5i.value()"
155
        }
156
        -re "Cannot resolve .* to any overloaded instance.*$gdb_prompt $" {
157
            setup_xfail hppa*-*-* CLLbs16899
158
            xfail "print t5i.value"
159
        }
160
        -re ".*$gdb_prompt $" { fail "print t5i.value()" }
161
        timeout { fail "print t5i.value() (timeout)" }
162
    }
163
}
164
 
165
 
166
proc do_tests {} {
167
    global prms_id
168
    global bug_id
169
    global subdir
170
    global objdir
171
    global srcdir
172
    global binfile
173
    global gdb_prompt
174
    global supports_template_debugging
175
 
176
    set prms_id 0
177
    set bug_id 0
178
 
179
    # Start with a fresh gdb.
180
 
181
    gdb_exit
182
    gdb_start
183
    gdb_reinitialize_dir $srcdir/$subdir
184
    gdb_load $binfile
185
 
186
    if { !$supports_template_debugging } {
187
        warning "compiler lacks debugging info for templates; tests suppressed." 0
188
        return
189
    }
190
 
191
    # Get the debug format for the compiled test case.  If that
192
    # format is DWARF 1 then just skip all the tests since none of
193
    # them will pass.
194
 
195
    if [ runto_main] then {
196
        get_debug_format
197
        if [ setup_xfail_format "DWARF 1" ] then {
198
            fail "C++ tests skipped due to limited C++ support in DWARF 1 debug format"
199
            return
200
        }
201
        clear_xfail "*-*-*"
202
    }
203
 
204
    test_ptype_of_templates
205
    test_template_breakpoints
206
 
207
    if [ runto_main] {
208
        test_template_calls
209
    }
210
}
211
 
212
do_tests
213
 
214
 
215
# More tests for different kinds of template parameters,
216
# templates with partial specializations, nested templates, etc.
217
# These have been tested only with HP aCC.  They probably won't
218
# work with other compilers because of differences in mangling
219
# schemes.
220
# Added by Satish Pai  1997-09-25
221
# As of 2000-06-03, C++ support has been improved to the point that g++ can
222
# pass all of theses, excluding what appears to be one that exposes a stabs bug. - djb
223
 
224
# I don't know how HP could be passing these tests without this. They
225
# weren't breakpointing past a point where the below expressions were
226
# initialized in the actual source. - djb
227
 
228
send_gdb "b 770\n"
229
gdb_expect {
230
                -re ".*$gdb_prompt $"
231
}
232
send_gdb "c\n"
233
gdb_expect {
234
                -re ".*$gdb_prompt $"
235
}
236
send_gdb "print fint\n"
237
gdb_expect {
238
   -re "\\$\[0-9\]* = \\{x = 0, t = 0\\}\r\n$gdb_prompt $" { pass "print fint" }
239
   -re "$gdb_prompt $"                     { fail "print fint" }
240
   timeout                             { fail "(timeout) print fint" }
241
}
242
 
243
send_gdb "print fvpchar\n"
244
gdb_expect {
245
   -re "\\$\[0-9\]* = \\{x = 0, t = 0x0\\}\r\n$gdb_prompt $" { pass "print fvpchar" }
246
   -re "$gdb_prompt $"                     { fail "print fvpchar" }
247
   timeout                             { fail "(timeout) print fvpchar" }
248
}
249
 
250
# Template Foo
251
 
252
setup_xfail hppa2.0w-*-* CLLbs16092
253
# g++ can't do the template instantiation in debug info trick, so we
254
# fail this because it's not a real type.
255
if {!$hp_aCC_compiler} { setup_xfail *-*-* }
256
send_gdb "ptype Foo\n"
257
gdb_expect {
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\ntemplate instantiations:\r\n\[ \t\]*(class |)Foo\r\n\[ \t\]*(class |)Foo\r\n\[ \t\]*(class |)Foo\r\n$gdb_prompt $" { pass "ptype Foo" }
259
   -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" }
260
   -re "$gdb_prompt $"                     { fail "ptype Foo" }
261
   timeout                             { fail "(timeout) ptype Foo" }
262
}
263
 
264
# ptype Foo
265
 
266
send_gdb "ptype fint\n"
267
gdb_expect {
268
   -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" }
269
   -re "$gdb_prompt $"                     { fail "ptype fint" }
270
   timeout                             { fail "(timeout) ptype fint" }
271
}
272
 
273
# ptype Foo
274
 
275
send_gdb "ptype fchar\n"
276
gdb_expect {
277
   -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" }
278
   -re "$gdb_prompt $"                     { fail "ptype fchar" }
279
   timeout                             { fail "(timeout) ptype fchar" }
280
}
281
 
282
# ptype Foo
283
 
284
send_gdb "ptype fvpchar\n"
285
gdb_expect {
286
   -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" }
287
   -re "$gdb_prompt $"                     { fail "ptype fvpchar" }
288
   timeout                             { fail "(timeout) ptype fvpchar" }
289
}
290
 
291
# print a function from Foo
292
 
293
send_gdb "print Foo::foo\n"
294
gdb_expect {
295
   -re "\\$\[0-9\]* = \\{.*char \\*\\((class |)Foo \\*, int, .*char \\*\\)\\} $hex ::foo\\(int, .*char.*\\*\\)>\r\n$gdb_prompt $" { pass "print Foo::foo" }
296
   -re "$gdb_prompt $"                     { fail "print Foo::foo" }
297
   timeout                             { fail "(timeout) print Foo::foo" }
298
}
299
 
300
# Template Bar
301
 
302
setup_xfail hppa2.0w-*-* CLLbs16092
303
# same as Foo for g++
304
if {!$hp_aCC_compiler} { setup_xfail *-*-* }
305
send_gdb "ptype Bar\n"
306
gdb_expect {
307
   -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" }
308
   -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" }
309
   -re "$gdb_prompt $"                     { fail "ptype Bar" }
310
   timeout                             { fail "(timeout) ptype Bar" }
311
}
312
 
313
 
314
# ptype Bar
315
# stabs screws this test royally.
316
# It thinks it has a badly mangled name.
317
# I blame stabs, the other formats get it right. -djb
318
get_debug_format
319
setup_xfail_format "stabs"
320
send_gdb "ptype bint\n"
321
gdb_expect {
322
   -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" }
323
   -re "$gdb_prompt $"                     { fail "ptype bint" }
324
   timeout                             { fail "(timeout) ptype bint" }
325
}
326
 
327
# ptype Bar3)>
328
 
329
send_gdb "ptype bint2\n"
330
gdb_expect {
331
   -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" }
332
   -re "$gdb_prompt $"                     { fail "ptype bint2" }
333
   timeout                             { fail "(timeout) ptype bint2" }
334
}
335
 
336
# Template Baz
337
 
338
setup_xfail hppa2.0w-*-* CLLbs16092
339
# Same as Foo, for g++
340
if {!$hp_aCC_compiler} { setup_xfail *-*-* }
341
send_gdb "ptype Baz\n"
342
gdb_expect {
343
   -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" }
344
   -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" }
345
   -re "$gdb_prompt $"                     { fail "ptype Baz" }
346
   timeout                             { fail "(timeout) ptype Baz" }
347
}
348
 
349
 
350
# ptype Baz
351
 
352
send_gdb "ptype bazint\n"
353
gdb_expect {
354
   -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" }
355
   -re "$gdb_prompt $"                     { fail "ptype bazint" }
356
   timeout                             { fail "(timeout) ptype bazint" }
357
}
358
 
359
# ptype Baz
360
 
361
send_gdb "ptype bazint2\n"
362
gdb_expect {
363
   -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" }
364
   -re "$gdb_prompt $"                     { fail "ptype bazint2" }
365
   timeout                             { fail "(timeout) ptype bazint2" }
366
}
367
 
368
# Template Qux
369
# Same as Foo for g++
370
if {!$hp_aCC_compiler} {setup_xfail *-*-*}
371
send_gdb "ptype Qux\n"
372
gdb_expect {
373
   -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" }
374
   -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" }
375
   -re "$gdb_prompt $"                     { fail "ptype Qux" }
376
   timeout                             { fail "(timeout) ptype Qux" }
377
}
378
 
379
# pt Qux
380
 
381
send_gdb "ptype quxint\n"
382
gdb_expect {
383
   -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" }
384
   -re "$gdb_prompt $"                     { fail "ptype quxint" }
385
   timeout                             { fail "(timeout) ptype quxint" }
386
}
387
 
388
# pt Qux
389
 
390
# commented out this as quxint2 declaration was commented out in
391
# templates.exp -- ovidiu
392
# send_gdb "ptype quxint2\n"
393
# gdb_expect {
394
#    -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 $" { pass "ptype quxint2" }
395
#    -re "$gdb_prompt $"                     { fail "ptype quxint2" }
396
#    timeout                             { fail "(timeout) ptype quxint2" }
397
# }
398
 
399
# Template Spec
400
 
401
setup_xfail hppa2.0w-*-* CLLbs16092
402
# Same as Foo for g++
403
if {!$hp_aCC_compiler} { setup_xfail *-*-* }
404
send_gdb "ptype Spec\n"
405
gdb_expect {
406
   -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" }
407
   -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" }
408
   -re "$gdb_prompt $"                     { fail "ptype Spec" }
409
   timeout                             { fail "(timeout) ptype Spec" }
410
}
411
 
412
# pt Spec
413
 
414
send_gdb "ptype siip\n"
415
gdb_expect {
416
   -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" }
417
   -re "$gdb_prompt $"                     { fail "ptype siip" }
418
   timeout                             { fail "(timeout) ptype siip" }
419
}
420
 
421
# pt Garply
422
 
423
send_gdb "ptype Garply\n"
424
gdb_expect {
425
   -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" }
426
   -re "$gdb_prompt $"                     { fail "ptype Garply" }
427
   timeout                             { fail "(timeout) ptype Garply" }
428
}
429
 
430
# ptype of nested template name
431
 
432
send_gdb "ptype Garply >\n"
433
gdb_expect {
434
   -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 >" }
435
   -re "$gdb_prompt $"                     { fail "ptype Garply >" }
436
   timeout                             { fail "(timeout) ptype Garply >" }
437
}
438
 
439
# print out a function from a nested template name
440
 
441
send_gdb "print Garply >::garply\n"
442
gdb_expect {
443
   -re "\\$\[0-9\]* = \\{(class |)Garply \\((class |)Garply > \\*, int, (class |)Garply\\)\\} $hex \[ \t\]*>::garply\\(int, (class |)Garply\\)>\r\n$gdb_prompt $" { pass "print Garply >::garply" }
444
   -re ".*$gdb_prompt $" { fail "print Garply >::garply" }
445
   timeout { fail "print Garply >::garply (timeout)" }
446
}
447
 
448
# djb - 06-03-2000
449
# Now should work fine
450
send_gdb "break Garply >::garply\n"
451
gdb_expect {
452
   -re "Breakpoint \[0-9\]* at $hex: file .*templates.cc, line.*\r\n$gdb_prompt $" { pass "break Garply >::garply" }
453
   -re ".*$gdb_prompt $" { fail "break Garply >::garply" }
454
   timeout { fail "break Garply >::garply (timeout)" }
455
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.