import gdb-1999-08-02 snapshot
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / ptype.exp
CommitLineData
c906108c
SS
1# Copyright (C) 1988, 1990, 1991, 1992, 1994, 1997 Free Software Foundation, Inc.
2
3# This program is free software; you can redistribute it and/or modify
4# it under the terms of the GNU General Public License as published by
5# the Free Software Foundation; either version 2 of the License, or
6# (at your option) any later version.
7#
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11# GNU General Public License for more details.
12#
13# You should have received a copy of the GNU General Public License
14# along with this program; if not, write to the Free Software
15# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16
17# Please email any bugs, comments, and/or additions to this file to:
18# bug-gdb@prep.ai.mit.edu
19
20# This file was written by Rob Savoye. (rob@cygnus.com)
21
22if $tracelevel then {
23 strace $tracelevel
24 }
25
26#
27# test running programs
28#
29set prms_id 0
30set bug_id 0
31
32set testfile "ptype"
33set srcfile ${testfile}.c
34set binfile ${objdir}/${subdir}/${testfile}
35if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
36 gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
37}
38
39# Create and source the file that provides information about the compiler
40# used to compile the test case.
41if [get_compiler_info ${binfile}] {
42 return -1;
43}
44
45gdb_exit
46gdb_start
47gdb_reinitialize_dir $srcdir/$subdir
48gdb_load ${binfile}
49
50# Test ptype of unnamed enumeration members before any action causes
51# the partial symbol table to be expanded to full symbols. This fails
52# with stabs compilers which fail to use a nameless stab (such as
53# pre-2.4.5 versions of gcc and most non-gcc compilers).
54
55send_gdb "ptype red1\n"
56gdb_expect {
57 -re "type = enum primary1_tag \{red1, green1, blue1\}.*$gdb_prompt $"\
58 {
59 # The workaround is in effect. As this is a compiler, not GDB,
60 # bug, we'll make it a PASS but perhaps it should be an XFAIL.
61 pass "ptype unnamed enumeration member (worked around)"
62 }
63 -re "type = enum \{red1, green1, blue1\}.*$gdb_prompt $"\
64 { pass "ptype unnamed enumeration member" }
65 -re ".*$gdb_prompt $" { fail "ptype unnamed enumeration member" }
66 timeout { fail "(timeout) ptype unnamed enumeration member" }
67}
68
69#
70# test ptype command with structures
71#
72# Here and elsewhere, we accept
73# "long", "long int", or "int" for long variables (whatis.exp already
74# has an XFAIL for "int" (Sun cc bug), so no need to fail it here).
75gdb_test "ptype struct t_struct" "type = struct t_struct \{.*\[\r\n\] (unsigned |)char v_char_member;.*\[\r\n\] (short|short int) v_short_member;.*\[\r\n\] int v_int_member;.*\[\r\n\] (long|long int|int) v_long_member;.*\[\r\n\] float v_float_member;.*\[\r\n\] double v_double_member;.*\[\r\n\]\}.*" "ptype structure"
76
77
78# Test the equivalence between '.' and '->' for struct member references.
79
80if [gdb_test "ptype v_struct1.v_float_member" "type = float"]<0 then {
81 return -1
82}
83if [gdb_test "ptype v_struct1->v_float_member" "type = float"]<0 then {
84 return -1
85}
86if [gdb_test "ptype v_t_struct_p.v_float_member" "type = float"]<0 then {
87 return -1
88}
89if [gdb_test "ptype v_t_struct_p->v_float_member" "type = float"]<0 then {
90 return -1
91}
92
93
94# IBM's xlc puts out bogus stabs--the stuff field is type 42,
95# which isn't defined.
96
085dd6e6 97gdb_test "ptype struct link" "type = struct link \{\[\r\n\]+\[ \t\]+struct link \\*next;\[\r\n\]+\[ \t\]+struct link \\*\\(\\*linkfunc\\)\\((struct link \\*, int|void|)\\);\[\r\n\]+\[ \t\]+struct t_struct stuff.1..2..3.;\[\r\n\]+\}.*" "ptype linked list structure"
c906108c
SS
98
99#
100# test ptype command with unions
101#
102gdb_test "ptype union t_union" "type = union t_union \{.*\[\r\n\] (unsigned |)char v_char_member;.*\[\r\n\] (short|short int) v_short_member;.*\[\r\n\] int v_int_member;.*\[\r\n\] (long|long int|int) v_long_member;.*\[\r\n\] float v_float_member;.*\[\r\n\] double v_double_member;.*\[\r\n\]\}.*" "ptype union"
103
104# IBM's xlc puts out bogus stabs--the stuff field is type 42,
105# which isn't defined.
085dd6e6 106gdb_test "ptype union tu_link" "type = union tu_link \{\[\r\n\]+\[ \t\]+struct link \\*next;\[\r\n\]+\[ \t\]+struct link \\*\\(\\*linkfunc\\)\\((struct link \\*, int|void|)\\);\[\r\n\]+\[ \t\]+struct t_struct stuff.1..2..3.;\[\r\n\]+\}.*" "ptype linked list union"
c906108c
SS
107
108#
109# test ptype command with enums
110#
111
112gdb_test "ptype primary" "type = enum .red, green, blue.*" "ptype unnamed enumeration"
113
114gdb_test "ptype enum colors" "type = enum colors \{yellow, purple, pink\}.*" "ptype named enumeration"
115
116
117#
118# test ptype command with enums as typedef
119#
085dd6e6 120gdb_test "ptype boolean" "type = enum (boolean |)\{FALSE, TRUE\}.*" "ptype unnamed typedef'd enumeration"
c906108c
SS
121
122# And check that whatis shows the name, not "enum {...}".
123# This probably fails for all DWARF 1 cases, so assume so for now. -fnf
124# The problem with xlc is that the stabs look like
125# :t51=eFALSE:0,TRUE:1,;
126# boolean:t55=51
127# v_boolean:G51
128# GDB's behavior is correct; the type which the variable is defined
129# as (51) doesn't have a name. Only 55 has a name.
130
085dd6e6 131if {!$gcc_compiled && !$hp_aCC_compiler} {
a0b3c4fd
JM
132 setup_xfail "rs6000-*-*" "i*86-*-sysv4*"
133 setup_xfail "hppa*-*-*" CLLbs14773
085dd6e6 134}
9846de1b 135get_debug_format
c906108c 136setup_xfail_format "DWARF 1"
085dd6e6 137gdb_test "whatis v_boolean" "type = (enum |)boolean" \
c906108c
SS
138 "whatis unnamed typedef'd enum (compiler bug in IBM's xlc)"
139
140# Same thing with struct and union.
085dd6e6 141gdb_test "ptype t_struct3" "type = struct (t_struct3 |)\{.*
c906108c
SS
142 *double v_double_member;.*
143 *int v_int_member;.*\}" "printing typedef'd struct"
144
085dd6e6 145gdb_test "ptype t_union3" "type = union (t_union3 |)\{.*
c906108c
SS
146 *double v_double_member;.*
147 *int v_int_member;.*\}" "printing typedef'd union"
148
085dd6e6 149gdb_test "ptype enum bvals" "type = enum bvals \{my_false, my_true\}.*" "ptype named typedef'd enumf'd enum"
c906108c
SS
150
151#
152# test ptype command with out-of-order enum values
153#
154gdb_test "ptype enum misordered" "type = enum misordered \{two = 2, one = 1, zero = 0, three = 3\}.*" "ptype misordered enumeration"
155
156#
157# test ptype command with a named enum's value
158#
159gdb_test "ptype three" "type = enum misordered \{two = 2, one = 1, zero = 0, three = 3\}.*" "ptype named enumeration member"
160
161gdb_test "ptype red" "type = enum \{red, green, blue\}.*" "ptype unnamed enumeration member #2"
162
163#
164# test ptype command with basic C types
165#
166# I've commented most of this out because it duplicates tests in whatis.exp.
167# I've just left in a token test or 2 which is designed to test that ptype
168# acts like whatis for basic types. If it is thought to be necessary to
169# test both whatis and ptype for all the types, the tests should be
170# merged into whatis.exp, or else maintenance will be a royal pain -kingdon
171#setup_xfail "i960-*-*" 1821
172#setup_xfail "mips-idt-*" "mips-sgi-*" "a29k-*-*"
173#send "ptype v_char\n"
174#gdb_expect {
175# -re "type = char.*$gdb_prompt $" { pass "ptype char" }
176# -re ".*$gdb_prompt $" { fail "ptype char" }
177# timeout { fail "(timeout) ptype char" }
178#}
179#
180#
181#setup_xfail "mips-*-*" "a29k-*-*"
182#send "ptype v_signed_char\n"
183#gdb_expect {
184# -re "type = signed char.*$gdb_prompt $" { pass "ptype signed char" }
185# -re ".*$gdb_prompt $" { fail "ptype signed char" }
186# timeout { fail "(timeout) ptype signed char" }
187#}
188#
189#
190#send "ptype v_unsigned_char\n"
191#gdb_expect {
192# -re "type = unsigned char.*$gdb_prompt $" { pass "ptype unsigned char" }
193# -re ".*$gdb_prompt $" { fail "ptype unsigned char" }
194# timeout { fail "(timeout) ptype unsigned char" }
195#}
196
197gdb_test "ptype v_short" "type = short(| int).*" "ptype short"
198
199#send "ptype v_signed_short\n"
200#gdb_expect {
201# -re "type = short.*$gdb_prompt $" { pass "ptype signed short" }
202# -re ".*$gdb_prompt $" { fail "ptype signed short" }
203# timeout { fail "(timeout) ptype signed short" }
204#}
205#
206#
207#send "ptype v_unsigned_short\n"
208#gdb_expect {
209# -re "type = unsigned short.*$gdb_prompt $" { pass "ptype unsigned short" }
210# -re ".*$gdb_prompt $" { fail "ptype unsigned short" }
211# timeout { fail "(timeout) ptype unsigned short" }
212#}
213
214
215gdb_test "ptype v_int" "type = int.*" "ptype int"
216
217#send "ptype v_signed_int\n"
218#gdb_expect {
219# -re "type = int.*$gdb_prompt $" { pass "ptype signed int" }
220# -re ".*$gdb_prompt $" { fail "ptype signed int" }
221# timeout { fail "(timeout) ptype signed int" }
222#}
223#
224#
225#send "ptype v_unsigned_int\n"
226#gdb_expect {
227# -re "type = unsigned int.*$gdb_prompt $" { pass "ptype unsigned int" }
228# -re ".*$gdb_prompt $" { fail "ptype unsigned int" }
229# timeout { fail "(timeout) ptype unsigned int" }
230#}
231#
232#
233#send "ptype v_long\n"
234#gdb_expect {
235# -re "type = long.*$gdb_prompt $" { pass "ptype long" }
236# -re ".*$gdb_prompt $" { fail "ptype long" }
237# timeout { fail "(timeout) ptype long" }
238#}
239#
240#
241#send "ptype v_signed_long\n"
242#gdb_expect {
243# -re "type = long.*$gdb_prompt $" { pass "ptype signed long" }
244# -re ".*$gdb_prompt $" { fail "ptype signed long" }
245# timeout { fail "(timeout) ptype signed long" }
246#}
247#
248#
249#send "ptype v_unsigned_long\n"
250#gdb_expect {
251# -re "type = unsigned long.*$gdb_prompt $" { pass "ptype unsigned long" }
252# -re ".*$gdb_prompt $" { fail "ptype unsigned long" }
253# timeout { fail "(timeout) ptype unsigned long" }
254#}
255#
256#
257#send "ptype v_float\n"
258#gdb_expect {
259# -re "type = float.*$gdb_prompt $" { pass "ptype float" }
260# -re ".*$gdb_prompt $" { fail "ptype float" }
261# timeout { fail "(timeout) ptype float" }
262#}
263#
264#
265#send "ptype v_double\n"
266#gdb_expect {
267# -re "type = double.*$gdb_prompt $" { pass "ptype double" }
268# -re ".*$gdb_prompt $" { fail "ptype double" }
269# timeout { fail "(timeout) ptype double" }
270#}
271
272
273#
274# test ptype command with arrays
275#
276#setup_xfail "i960-*-*" 1821
277#setup_xfail "mips-idt-*" "mips-sgi-*" "a29k-*-*"
278#send "ptype v_char_array\n"
279#gdb_expect {
280# -re "type = char .2..*$gdb_prompt $" { pass "ptype char array" }
281# -re ".*$gdb_prompt $" { fail "ptype char array" }
282# timeout { fail "(timeout) ptype char array" }
283#}
284#
285#
286#setup_xfail "mips-*-*" "a29k-*-*"
287#send "ptype v_signed_char_array\n"
288#gdb_expect {
289# -re "type = (|signed )char .2..*$gdb_prompt $" { pass "ptype signed char array" }
290# -re ".*$gdb_prompt $" { fail "ptype signed char array" }
291# timeout { fail "(timeout) ptype signed char array" }
292#}
293#
294#
295#send "ptype v_unsigned_char_array\n"
296#gdb_expect {
297# -re "type = unsigned char .2..*$gdb_prompt $" { pass "ptype unsigned char array" }
298# -re ".*$gdb_prompt $" { fail "ptype unsigned char array" }
299# timeout { fail "(timeout) ptype unsigned char array" }
300#}
301#
302#
303#
304#send "ptype v_int_array\n"
305#gdb_expect {
306# -re "type = int .2..*$gdb_prompt $" { pass "ptype int array" }
307# -re ".*$gdb_prompt $" { fail "ptype int array" }
308# timeout { fail "(timeout) ptype int array" }
309#}
310#
311#
312#send "ptype v_signed_int_array\n"
313#gdb_expect {
314# -re "type = int .2..*$gdb_prompt $" { pass "ptype signed int array" }
315# -re ".*$gdb_prompt $" { fail "ptype signed int array" }
316# timeout { fail "(timeout) ptype signed int array" }
317#}
318#
319#
320#send "ptype v_unsigned_int_array\n"
321#gdb_expect {
322# -re "type = unsigned int .2..*$gdb_prompt $" { pass "ptype unsigned int array" }
323# -re ".*$gdb_prompt $" { fail "ptype unsigned int array" }
324# timeout { fail "(timeout) ptype unsigned int array" }
325#}
326#
327#
328#send "ptype v_long_array\n"
329#gdb_expect {
330# -re "type = (long|int|long int) .2..*$gdb_prompt $" {
331# pass "ptype long array" }
332# -re ".*$gdb_prompt $" { fail "ptype long array" }
333# timeout { fail "(timeout) ptype long array" }
334#}
335#
336#
337#send "ptype v_signed_long_array\n"
338#gdb_expect {
339# -re "type = (long|int|long int) .2..*$gdb_prompt $" {
340# pass "ptype signed long array" }
341# -re ".*$gdb_prompt $" { fail "ptype signed long array" }
342# timeout { fail "(timeout) ptype signed long array" }
343#}
344#
345#
346#send "ptype v_unsigned_long_array\n"
347#gdb_expect {
348# -re "type = unsigned long .2..*$gdb_prompt $" { pass "ptype unsigned long array" }
349# -re ".*$gdb_prompt $" { fail "ptype unsigned long array" }
350# timeout { fail "(timeout) ptype unsigned long array" }
351#}
352#
353#
354#send "ptype v_float_array\n"
355#gdb_expect {
356# -re "type = float .2..*$gdb_prompt $" { pass "ptype float array" }
357# -re ".*$gdb_prompt $" { fail "ptype float array" }
358# timeout { fail "(timeout) ptype float array" }
359#}
360#
361#
362#send "ptype v_double_array\n"
363#gdb_expect {
364# -re "type = double .2..*$gdb_prompt $" { pass "ptype double array" }
365# -re ".*$gdb_prompt $" { fail "ptype double array" }
366# timeout { fail "(timeout) ptype double array" }
367#}
368#
369
370if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" "i*86-*-sysv4*" }
371setup_xfail_format "DWARF 1"
085dd6e6 372if {$hp_aCC_compiler} {setup_xfail "hppa*-*-*"}
c906108c
SS
373gdb_test "ptype t_char_array" "type = (|unsigned )char \\\[0?\\\]"
374
375#
376##
377## test ptype command with pointers
378##
379#setup_xfail "i960-*-*" 1821
380#setup_xfail "mips-idt-*" "mips-sgi-*" "a29k-*-*"
381#send "ptype v_char_pointer\n"
382#gdb_expect {
383# -re "type = char \*.*$gdb_prompt $" { pass "ptype char pointer" }
384# -re ".*$gdb_prompt $" { fail "ptype char pointer" }
385# timeout { fail "(timeout) ptype char pointer" }
386#}
387#
388#
389#setup_xfail "mips-*-*" "a29k-*-*"
390#send "ptype v_signed_char_pointer\n"
391#gdb_expect {
392# -re "type = (|signed )char \*.*$gdb_prompt $"
393# { pass "ptype signed char pointer" }
394# -re ".*$gdb_prompt $" { fail "ptype signed char pointer" }
395# timeout { fail "(timeout) ptype signed char pointer" }
396#}
397#
398#
399#send "ptype v_unsigned_char_pointer\n"
400#gdb_expect {
401# -re "type = unsigned char \*.*$gdb_prompt $" { pass "ptype unsigned char pointer" }
402# -re ".*$gdb_prompt $" { fail "ptype unsigned char pointer" }
403# timeout { fail "(timeout) ptype unsigned char pointer" }
404#}
405#
406#
407#send "ptype v_short_pointer\n"
408#gdb_expect {
409# -re "type = (short|short int) \*.*$gdb_prompt $" { pass "ptype short pointer" }
410# -re ".*$gdb_prompt $" { fail "ptype short pointer" }
411# timeout { fail "(timeout) ptype short pointer" }
412#}
413#
414#
415#send "ptype v_signed_short_pointer\n"
416#gdb_expect {
417# -re "type = short \*.*$gdb_prompt $" { pass "ptype signed short pointer" }
418# -re ".*$gdb_prompt $" { fail "ptype signed short pointer" }
419# timeout { fail "(timeout) ptype signed short pointer" }
420#}
421#
422#
423#send "ptype v_unsigned_short_pointer\n"
424#gdb_expect {
425# -re "type = unsigned short \*.*$gdb_prompt $" { pass "ptype unsigned short pointer" }
426# -re ".*$gdb_prompt $" { fail "ptype unsigned short pointer" }
427# timeout { fail "(timeout) ptype unsigned short pointer" }
428#}
429#
430#
431#send "ptype v_int_pointer\n"
432#gdb_expect {
433# -re "type = int \*.*$gdb_prompt $" { pass "ptype int pointer" }
434# -re ".*$gdb_prompt $" { fail "ptype int pointer" }
435# timeout { fail "(timeout) ptype int pointer" }
436#}
437#
438#
439#send "ptype v_signed_int_pointer\n"
440#gdb_expect {
441# -re "type = int \*.*$gdb_prompt $" { pass "ptype signed int pointer" }
442# -re ".*$gdb_prompt $" { fail "ptype signed int pointer" }
443# timeout { fail "(timeout) ptype signed int pointer" }
444#}
445#
446#
447#send "ptype v_unsigned_int_pointer\n"
448#gdb_expect {
449# -re "type = unsigned int \*.*$gdb_prompt $" { pass "ptype unsigned int pointer" }
450# -re ".*$gdb_prompt $" { fail "ptype unsigned int pointer" }
451# timeout { fail "(timeout) ptype unsigned int pointer" }
452#}
453#
454#
455#send "ptype v_long_pointer\n"
456#gdb_expect {
457# -re "type = long \*.*$gdb_prompt $" { pass "ptype long pointer" }
458# -re ".*$gdb_prompt $" { fail "ptype long pointer" }
459# timeout { fail "(timeout) ptype long pointer" }
460#}
461#
462#
463#send "ptype v_signed_long_pointer\n"
464#gdb_expect {
465# -re "type = long \*.*$gdb_prompt $" { pass "ptype signed long pointer" }
466# -re ".*$gdb_prompt $" { fail "ptype signed long pointer" }
467# timeout { fail "(timeout) ptype signed long pointer" }
468#}
469#
470#
471#send "ptype v_unsigned_long_pointer\n"
472#gdb_expect {
473# -re "type = unsigned long \*.*$gdb_prompt $" { pass "ptype unsigned long pointer" }
474# -re ".*$gdb_prompt $" { fail "ptype unsigned long pointer" }
475# timeout { fail "(timeout) ptype unsigned long pointer" }
476#}
477#
478#
479#send "ptype v_float_pointer\n"
480#gdb_expect {
481# -re "type = float \*.*$gdb_prompt $" { pass "ptype float pointer" }
482# -re ".*$gdb_prompt $" { fail "ptype float pointer" }
483# timeout { fail "(timeout) ptype float pointer" }
484#}
485#
486#
487#send "ptype v_double_pointer\n"
488#gdb_expect {
489# -re "type = double \*.*$gdb_prompt $" { pass "ptype double pointer" }
490# -re ".*$gdb_prompt $" { fail "ptype double pointer" }
491# timeout { fail "(timeout) ptype double pointer" }
492#}
493
494#
495# test ptype command with nested structure and union
496#
085dd6e6
JM
497if {$hp_aCC_compiler} {
498 set outer "outer_struct::"
499 set struct ""
500 set union ""
501} else {
502 set outer ""
503 set struct "struct"
504 set union "union"
505}
506gdb_test "ptype struct outer_struct" "type = struct outer_struct \{.*\[\r\n\]+\
507.*int outer_int;.*\[\r\n\]+\
508.*(struct|) ${outer}inner_struct inner_struct_instance;.*\[\r\n\]+\
509.*(union|) ${outer}inner_union inner_union_instance;.*\[\r\n\]+\
510.*(long|long int|int) outer_long;.*\[\r\n\]\}.*" "ptype outer structure"
c906108c 511
085dd6e6 512gdb_test "ptype ${struct} ${outer}inner_struct" "type = struct ${outer}inner_struct \{.*\[\r\n\] int inner_int;.*\[\r\n\] (long|long int|int) inner_long;.*\[\r\n\]\}.*" "ptype inner structure"
c906108c 513
085dd6e6 514gdb_test "ptype ${union} ${outer}inner_union" "type = union ${outer}inner_union \{.*\[\r\n\] int inner_union_int;.*\[\r\n\] (long|long int|int) inner_union_long;.*\[\r\n\]\}.*" "ptype inner union"
c906108c 515
085dd6e6 516gdb_test "ptype nested_su" "type = struct outer_struct \{.*\[\r\n\] int outer_int;.*\[\r\n\] (struct |)${outer}inner_struct inner_struct_instance;.*\[\r\n\] (union |)${outer}inner_union inner_union_instance;.*\[\r\n\] (long|long int|int) outer_long;.*\[\r\n\]\}.*" "ptype nested structure"
c906108c
SS
517
518gdb_test "ptype nested_su.outer_int" "type = int.*" "ptype outer int"
519
085dd6e6 520gdb_test "ptype nested_su.inner_struct_instance" "type = struct ${outer}inner_struct \{.*\[\r\n\] int inner_int;.*\[\r\n\] (long|long int|int) inner_long;.*\[\r\n\]\}.*" "ptype nested structure #2"
c906108c
SS
521
522gdb_test "ptype nested_su.inner_struct_instance.inner_int" "type = int.*" "ptype inner int"
523
085dd6e6 524gdb_test "ptype nested_su.inner_union_instance" "type = union ${outer}inner_union \{.*\[\r\n\] int inner_union_int;.*\[\r\n\] (long|long int|int) inner_union_long;.*\[\r\n\]\}.*" "ptype nested union"
c906108c
SS
525
526# Test printing type of string constants and array constants, but
527# requires a running process. These call malloc, and can take a long
528# time to execute over a slow serial link, so increase the timeout.
529
530# UDI can't do this (PR 2416). XFAIL is not suitable, because attempting
531# the operation causes a slow painful death rather than a nice simple failure.
532
533if [runto_main] then {
534
c906108c
SS
535 if [target_info exists gdb,cannot_call_functions] {
536 setup_xfail "*-*-*" 2416
537 fail "This target can not call functions"
538 continue
539 }
540
9846de1b
JM
541 # We need to up this because this can be really slow on some boards.
542 # (malloc() is called as part of the test).
543 set timeout 60;
544
c906108c
SS
545 gdb_test "ptype \"abc\"" "type = char \\\[4\\\]"
546 gdb_test "ptype {'a','b','c'}" "type = char \\\[3\\\]"
547 gdb_test "ptype {0,1,2}" "type = int \\\[3\\\]"
548 gdb_test "ptype {(long)0,(long)1,(long)2}" "type = long \\\[3\\\]"
549 gdb_test "ptype {(float)0,(float)1,(float)2}" "type = float \\\[3\\\]"
550 gdb_test "ptype {{0,1,2},{3,4,5}}" "type = int \\\[2\\\]\\\[3\\\]"
551 gdb_test "ptype {4,5,6}\[2\]" "type = int"
552 gdb_test "ptype *&{4,5,6}\[1\]" "type = int"
553}
This page took 0.053978 seconds and 4 git commands to generate.