X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Ftestsuite%2Fgdb.base%2Fsetvar.exp;h=3c5251f4b87f8f8c115196900b3805c92aec1870;hb=f0559fff600165f5cbdf546737217e1da3f737b8;hp=f321c9f51e2a1d811a7937ac5b4fcc467a4fb6a9;hpb=27e232885db363fb545fd2f450e72d929e59b8f6;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/testsuite/gdb.base/setvar.exp b/gdb/testsuite/gdb.base/setvar.exp index f321c9f51e..3c5251f4b8 100644 --- a/gdb/testsuite/gdb.base/setvar.exp +++ b/gdb/testsuite/gdb.base/setvar.exp @@ -1,64 +1,41 @@ -# Copyright (C) 1997 Free Software Foundation, Inc. +# This testcase is part of GDB, the GNU debugger. -# 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 - -# Copyright (C) 1988, 1990, 1991, 1992, 1994, 1995 -# Free Software Foundation, Inc. +# Copyright 1988, 1990-1997, 1999-2001, 2004, 2007-2012 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 +# the Free Software Foundation; either version 3 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. +# along with this program. If not, see . # Please email any bugs, comments, and/or additions to this file to: -# bug-gdb@prep.ai.mit.edu +# bug-gdb@gnu.org # This file was written by Rob Savoye. (rob@cygnus.com) -if $tracelevel then { - strace $tracelevel - } - # # test running programs # -set prms_id 0 -set bug_id 0 set testfile "setvar" set srcfile ${testfile}.c set binfile ${objdir}/${subdir}/${testfile} if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { - gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." + untested setvar.exp + return -1 } # Create and source the file that provides information about the compiler # used to compile the test case. -if [get_compiler_info ${binfile}] { +if [get_compiler_info] { return -1; } @@ -70,7 +47,7 @@ gdb_load $binfile # # set it up at a breakpoint so we canplay with the variable values # -send_gdb "set print sevenbit-strings\n" ; gdb_expect -re "$gdb_prompt $" +gdb_test_no_output "set print sevenbit-strings" if ![runto_main] then { perror "couldn't run to breakpoint" @@ -80,20 +57,16 @@ if ![runto_main] then { # Determine expected output for unsigned long variables, # the output varies with sizeof (unsigned long). -set ulong_minus_1 4294967295 -set ulong_minus_456 4294966840 -send_gdb "print sizeof (unsigned long)\n" -gdb_expect { - -re ".\[0-9\]* = 4.*$gdb_prompt $" {} +gdb_test_multiple "print sizeof (unsigned long)" "sizeof ulong" { + -re ".\[0-9\]* = 4.*$gdb_prompt $" { + set ulong_minus_1 4294967295 + set ulong_minus_456 4294966840 + } -re ".\[0-9\]* = 8.*$gdb_prompt $" { set ulong_minus_1 18446744073709551615 set ulong_minus_456 18446744073709551160 } - -re ".*$gdb_prompt $" { - fail "getting sizeof unsigned long" - } - default { fail "(timeout) getting sizeof unsigned long" } -} +} proc test_set { args } { global gdb_prompt @@ -104,7 +77,7 @@ proc test_set { args } { set count 1; # Set up the variables. - for {set x 0;} {$x < $length} {incr x;} { + for {set x 0} {$x < $length} {incr x} { if { "[lindex $args $x]" != "" } { set arg [lindex $args $x]; if { ($x == $final) || ([string first ".*" [lindex $args [expr $x + 1]]] >= 0) } { @@ -139,7 +112,7 @@ proc test_set { args } { test_set "set variable v_char=0" "print v_char" ".\[0-9\]* = 0 \'.000\'" "set variable char=0" test_set "set variable v_char=1" "print v_char" ".\[0-9\]* = 1 \'.001\'" "set variable char=1" -test_set "set variable v_char=27" "print v_char" ".\[0-9\]* = 27 \'.e\'" "set variable char=27 (Esc)" +test_set "set variable v_char=7" "print v_char" ".\[0-9\]* = 7 \'.a\'" "set variable char=7 (Bel)" test_set "set variable v_char=32" "print v_char" ".\[0-9\]* = 32 \' \'" "set variable char=32 (SPC)" test_set "set variable v_char=65" "print v_char" ".\[0-9\]* = 65 \'A\'" "set variable char=65 ('A')" test_set "set variable v_char=97" "print v_char" ".\[0-9\]* = 97 \'a\'" "set variable char=97 ('a')" @@ -148,19 +121,19 @@ test_set "set variable v_char=127" "print v_char" ".\[0-9\]* = 127 \'.177\'" # # test "set variable" for type "signed char" # -test_set "set variable v_char=0" "print v_signed_char" ".\[0-9\]* = 0 \'.000\'" "set variable signed char=0" +test_set "set variable v_char=0" "print v_signed_char" ".\[0-9\]* = 0 \'.000\'" "set variable signed char=0" test_set "set variable v_signed_char=1" "print v_signed_char" ".\[0-9\]* = 1 \'.001\'" "set variable signed char=1" -test_set "set variable v_signed_char=27" "print v_signed_char" ".\[0-9\]* = 27 \'.e\'" "set variable signed char=27 (Esc)" +test_set "set variable v_signed_char=7" "print v_signed_char" ".\[0-9\]* = 7 \'.a\'" "set variable signed char=7 (Bel)" test_set "set variable v_signed_char=32" "print v_signed_char" ".\[0-9\]* = 32 \' \'" "set variable signed char=32 (SPC)" test_set "set variable v_signed_char=65" "print v_signed_char" ".\[0-9\]* = 65 \'A\'" "set variable signed char=65 ('A')" test_set "set variable v_signed_char=97" "print v_signed_char" ".\[0-9\]* = 97 \'a\'" "set variable signed char=97 ('a')" test_set "set variable v_signed_char=126" "print v_signed_char" ".\[0-9\]* = 126 \'~\'" "set variable signed char=126 ('~')" test_set "set variable v_signed_char=127" "print v_signed_char" ".\[0-9\]* = 127 \'.177\'" "set variable signed char=127 (8-bit)" -gdb_test "set variable v_signed_char=-1" "" +gdb_test_no_output "set variable v_signed_char=-1" if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix4*" } gdb_test "print v_signed_char" ".\[0-9\]* = -1 \'.377\'" \ "set variable signed char=-1 (-1)" -gdb_test "set variable v_signed_char=0xFF" "" +gdb_test_no_output "set variable v_signed_char=0xFF" if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix4*" } gdb_test "print v_signed_char" ".\[0-9\]* = -1 \'.377\'" \ "set variable signed char=0xFF (0xFF)" @@ -169,7 +142,7 @@ gdb_test "print v_signed_char" ".\[0-9\]* = -1 \'.377\'" \ # test_set "set variable v_unsigned_char=0" "print v_unsigned_char" ".\[0-9\]* = 0 \'.000\'" "set variable unsigned char=0" test_set "set variable v_unsigned_char=1" "print v_unsigned_char" ".\[0-9\]* = 1 \'.001\'" "set variable unsigned char=1" -test_set "set variable v_unsigned_char=27" "print v_unsigned_char" ".\[0-9\]* = 27 \'.e\'" "set variable unsigned char=27 (Esc)" +test_set "set variable v_unsigned_char=7" "print v_unsigned_char" ".\[0-9\]* = 7 \'.a\'" "set variable unsigned char=7 (Bel)" test_set "set variable v_unsigned_char=32" "print v_unsigned_char" ".\[0-9\]* = 32 \' \'" "set variable unsigned char=32 (SPC)" test_set "set variable v_unsigned_char=65" "print v_unsigned_char" ".\[0-9\]* = 65 \'A\'" "set variable unsigned char=65 ('A')" test_set "set variable v_unsigned_char=97" "print v_unsigned_char" ".\[0-9\]* = 97 \'a\'" "set variable unsigned char=97 ('a')" @@ -257,47 +230,47 @@ test_set "set variable v_unsigned_char_array\[0\]='h'" "set variable v_unsigned_ # # test "set variable" for "short array[2]" # -test_set "set variable v_short_array\[0\]=123" "set variable v_short_array\[1\]=-456" "print v_short_array" ".*.\[0-9\]* =.*\{123,.*-456\}" "set variable short array" +test_set "set variable v_short_array\[0\]=123" "set variable v_short_array\[1\]=-456" "print v_short_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "set variable short array" # # test "set variable" for "signed short array[2]" # -test_set "set variable v_signed_short_array\[0\]=123" "set variable v_signed_short_array\[1\]=-456" "print v_signed_short_array" ".*.\[0-9\]* =.*\{123,.*-456\}" "set variable signed short array" +test_set "set variable v_signed_short_array\[0\]=123" "set variable v_signed_short_array\[1\]=-456" "print v_signed_short_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "set variable signed short array" # # test "set variable" for "unsigned short array[2]" # -test_set "set variable v_unsigned_short_array\[0\]=123" "set variable v_unsigned_short_array\[1\]=-456" "print v_unsigned_short_array" ".*.\[0-9\]* =.*\{123,.*65080\}" "set variable unsigned short array" +test_set "set variable v_unsigned_short_array\[0\]=123" "set variable v_unsigned_short_array\[1\]=-456" "print v_unsigned_short_array" ".*.\[0-9\]* =.*\\{123,.*65080\\}" "set variable unsigned short array" # # test "set variable" for "int array[2]" # -test_set "set variable v_int_array\[0\]=123" "set variable v_int_array\[1\]=-456" "print v_int_array" ".*.\[0-9\]* =.*\{123,.*-456\}" "set variable int array" +test_set "set variable v_int_array\[0\]=123" "set variable v_int_array\[1\]=-456" "print v_int_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "set variable int array" # # test "set variable" for "signed int array[2]" # -test_set "set variable v_signed_int_array\[0\]=123" "set variable v_signed_int_array\[1\]=-456" "print v_signed_int_array" ".*.\[0-9\]* =.*\{123,.*-456\}" "set variable signed int array" +test_set "set variable v_signed_int_array\[0\]=123" "set variable v_signed_int_array\[1\]=-456" "print v_signed_int_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "set variable signed int array" # # test "set variable" for "unsigned int array[2]" # -test_set "set variable v_unsigned_int_array\[0\]=123" "set variable v_unsigned_int_array\[1\]=-456" "print v_unsigned_int_array" ".*.\[0-9\]* =.*\{123,.*(4294966840|65080)\}" "set variable unsigned int array" +test_set "set variable v_unsigned_int_array\[0\]=123" "set variable v_unsigned_int_array\[1\]=-456" "print v_unsigned_int_array" ".*.\[0-9\]* =.*\\{123,.*(4294966840|65080)\\}" "set variable unsigned int array" # # test "set variable" for "long array[2]" # -test_set "set variable v_long_array\[0\]=123" "set variable v_long_array\[1\]=-456" "print v_long_array" ".*.\[0-9\]* =.*\{123,.*-456\}" "set variable long array" +test_set "set variable v_long_array\[0\]=123" "set variable v_long_array\[1\]=-456" "print v_long_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "set variable long array" # # test "set variable" for "signed long array[2]" # -test_set "set variable v_signed_long_array\[0\]=123" "set variable v_signed_long_array\[1\]=-456" "print v_signed_long_array" ".*.\[0-9\]* =.*\{123,.*-456\}" "set variable signed long array" +test_set "set variable v_signed_long_array\[0\]=123" "set variable v_signed_long_array\[1\]=-456" "print v_signed_long_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "set variable signed long array" # # test "set variable" for "unsigned long array[2]" # -test_set "set variable v_unsigned_long_array\[0\]=123" "set variable v_unsigned_long_array\[1\]=-456" "print v_unsigned_long_array" ".*.\[0-9\]* =.*\{123,.*$ulong_minus_456\}" "set variable unsigned long array" +test_set "set variable v_unsigned_long_array\[0\]=123" "set variable v_unsigned_long_array\[1\]=-456" "print v_unsigned_long_array" ".*.\[0-9\]* =.*\\{123,.*$ulong_minus_456\\}" "set variable unsigned long array" # # test "set variable" for "float array[2]" # -test_set "set variable v_float_array\[0\]=123.0" "set variable v_float_array\[1\]=-456.0" "print v_float_array" ".*.\[0-9\]* =.*\{123,.*-456\}" "set variable float array" +test_set "set variable v_float_array\[0\]=123.0" "set variable v_float_array\[1\]=-456.0" "print v_float_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "set variable float array" # # test "set variable" for "double array[2]" # -test_set "set variable v_double_array\[0\]=123.0" "set variable v_double_array\[1\]=-456.0" "print v_double_array" ".*.\[0-9\]* =.*\{123,.*-456\}" "set variable double array" +test_set "set variable v_double_array\[0\]=123.0" "set variable v_double_array\[1\]=-456.0" "print v_double_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "set variable double array" # # test "set variable" for type "char *" # @@ -313,62 +286,58 @@ test_set "set v_unsigned_char_pointer=v_unsigned_char_array" "set variable *(v_u # # test "set variable" for type "short *" # -test_set "set v_short_pointer=v_short_array" "set variable *(v_short_pointer)=123" "set variable *(v_short_pointer+1)=-456" "print v_short_array" ".*.\[0-9\]* =.*\{123,.*-456\}" "print *(v_short_pointer+1)" ".*.\[0-9\]* = -456" "set variable short pointer" +test_set "set v_short_pointer=v_short_array" "set variable *(v_short_pointer)=123" "set variable *(v_short_pointer+1)=-456" "print v_short_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "print *(v_short_pointer+1)" ".*.\[0-9\]* = -456" "set variable short pointer" # # test "set variable" for type "signed short *" # -gdb_test "set v_signed_short_pointer=v_signed_short_array" "" -gdb_test "set variable *(v_signed_short_pointer)=123" "" -gdb_test "set variable *(v_signed_short_pointer+1)=-456" "" -gdb_test "print v_signed_short_array" ".\[0-9\]* =.*\{123,.*-456\}" \ +gdb_test_no_output "set v_signed_short_pointer=v_signed_short_array" +gdb_test_no_output "set variable *(v_signed_short_pointer)=123" +gdb_test_no_output "set variable *(v_signed_short_pointer+1)=-456" +gdb_test "print v_signed_short_array" ".\[0-9\]* =.*\\{123,.*-456\\}" \ "set variable signed short pointer" gdb_test "print *(v_signed_short_pointer+1)" ".\[0-9\]*.*=.*-456" # # test "set variable" for type "unsigned short *" # -gdb_test "set v_unsigned_short_pointer=v_unsigned_short_array" "" -gdb_test "set variable *(v_unsigned_short_pointer)=123" "" -gdb_test "set variable *(v_unsigned_short_pointer+1)=-456" "" -# DTS 10060CLLbs - bad type info from cc -if {$hp_cc_compiler} {setup_xfail hppa*-*-*11* 10060CLLbs} -gdb_test "print v_unsigned_short_array" ".\[0-9\]* =.*\{123,.*65080\}" \ +gdb_test_no_output "set v_unsigned_short_pointer=v_unsigned_short_array" +gdb_test_no_output "set variable *(v_unsigned_short_pointer)=123" +gdb_test_no_output "set variable *(v_unsigned_short_pointer+1)=-456" +gdb_test "print v_unsigned_short_array" ".\[0-9\]* =.*\\{123,.*65080\\}" \ "set variable unsigned short pointer" -# DTS 10060CLLbs - bad type info from cc -if {$hp_cc_compiler} {setup_xfail hppa*-*-*11* 10060CLLbs} gdb_test "print *(v_unsigned_short_pointer+1)" ".\[0-9\]* = 65080" # # test "set variable" for type "int *" # -test_set "set v_int_pointer=v_int_array" "set variable *(v_int_pointer)=123" "set variable *(v_int_pointer+1)=-456" "print v_int_array" ".*.\[0-9\]* =.*\{123,.*-456\}" "print *(v_int_pointer+1)" ".*.\[0-9\]* = -456" "set variable int pointer" +test_set "set v_int_pointer=v_int_array" "set variable *(v_int_pointer)=123" "set variable *(v_int_pointer+1)=-456" "print v_int_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "print *(v_int_pointer+1)" ".*.\[0-9\]* = -456" "set variable int pointer" # # test "set variable" for type "signed int *" # -test_set "set v_signed_int_pointer=v_signed_int_array" "set variable *(v_signed_int_pointer)=123" "set variable *(v_signed_int_pointer+1)=-456" "print v_signed_int_array" ".*.\[0-9\]* =.*\{123,.*-456\}" "print *(v_signed_int_pointer+1)" ".*.\[0-9\]* = -456" "set variable signed int pointer" +test_set "set v_signed_int_pointer=v_signed_int_array" "set variable *(v_signed_int_pointer)=123" "set variable *(v_signed_int_pointer+1)=-456" "print v_signed_int_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "print *(v_signed_int_pointer+1)" ".*.\[0-9\]* = -456" "set variable signed int pointer" # # test "set variable" for type "unsigned int *" # -test_set "set v_unsigned_int_pointer=v_unsigned_int_array" "set variable *(v_unsigned_int_pointer)=123" "set variable *(v_unsigned_int_pointer+1)=-456" "print v_unsigned_int_array" ".*.\[0-9\]* =.*\{123,.*(4294966840|65080)\}" "set variable unsigned int pointer" +test_set "set v_unsigned_int_pointer=v_unsigned_int_array" "set variable *(v_unsigned_int_pointer)=123" "set variable *(v_unsigned_int_pointer+1)=-456" "print v_unsigned_int_array" ".*.\[0-9\]* =.*\\{123,.*(4294966840|65080)\\}" "set variable unsigned int pointer" test_set "" "print *(v_unsigned_int_pointer+1)" ".*.\[0-9\]* = (4294966840|65080)" "print variable unsigned int pointer+1" # # test "set variable" for type "long *" # -test_set "set v_long_pointer=v_long_array" "set variable *(v_long_pointer)=123" "set variable *(v_long_pointer+1)=-456" "print v_long_array" ".*.\[0-9\]* =.*\{123,.*-456\}" "print *(v_long_pointer+1)" ".*.\[0-9\]* = -456" "set variable long pointer" +test_set "set v_long_pointer=v_long_array" "set variable *(v_long_pointer)=123" "set variable *(v_long_pointer+1)=-456" "print v_long_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "print *(v_long_pointer+1)" ".*.\[0-9\]* = -456" "set variable long pointer" # # test "set variable" for type "signed long *" # -test_set "set v_signed_long_pointer=v_signed_long_array" "set variable *(v_signed_long_pointer)=123" "set variable *(v_signed_long_pointer+1)=-456" "print v_signed_long_array" ".*.\[0-9\]* =.*\{123,.*-456\}" "print *(v_signed_long_pointer+1)" ".*.\[0-9\]* = -456" "set variable signed long pointer" +test_set "set v_signed_long_pointer=v_signed_long_array" "set variable *(v_signed_long_pointer)=123" "set variable *(v_signed_long_pointer+1)=-456" "print v_signed_long_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "print *(v_signed_long_pointer+1)" ".*.\[0-9\]* = -456" "set variable signed long pointer" # # test "set variable" for type "unsigned long *" # -test_set "set v_unsigned_long_pointer=v_unsigned_long_array" "set variable *(v_unsigned_long_pointer)=123" "set variable *(v_unsigned_long_pointer+1)=-456" "print v_unsigned_long_array" ".*.\[0-9\]* =.*\{123,.*$ulong_minus_456\}" "print *(v_unsigned_long_pointer+1)" ".*.\[0-9\]* = $ulong_minus_456" "set variable unsigned long pointer" +test_set "set v_unsigned_long_pointer=v_unsigned_long_array" "set variable *(v_unsigned_long_pointer)=123" "set variable *(v_unsigned_long_pointer+1)=-456" "print v_unsigned_long_array" ".*.\[0-9\]* =.*\\{123,.*$ulong_minus_456\\}" "print *(v_unsigned_long_pointer+1)" ".*.\[0-9\]* = $ulong_minus_456" "set variable unsigned long pointer" # # test "set variable" for type "float *" # -test_set "set v_float_pointer=v_float_array" "set variable *(v_float_pointer)=123.0" "set variable *(v_float_pointer+1)=-456.0" "print v_float_array" ".*.\[0-9\]* =.*\{123,.*-456\}" "print *(v_float_pointer+1)" ".*.\[0-9\]* = -456" "set variable float pointer" +test_set "set v_float_pointer=v_float_array" "set variable *(v_float_pointer)=123.0" "set variable *(v_float_pointer+1)=-456.0" "print v_float_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "print *(v_float_pointer+1)" ".*.\[0-9\]* = -456" "set variable float pointer" # # test "set variable" for type "double *" # -test_set "set v_double_pointer=v_double_array" "set variable *(v_double_pointer)=123.0" "set variable *(v_double_pointer+1)=-456.0" "print v_double_array" ".*.\[0-9\]* =.*\{123,.*-456\}" "print *(v_double_pointer+1)" ".*.\[0-9\]* = -456" "set variable double pointer" +test_set "set v_double_pointer=v_double_array" "set variable *(v_double_pointer)=123.0" "set variable *(v_double_pointer+1)=-456.0" "print v_double_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "print *(v_double_pointer+1)" ".*.\[0-9\]* = -456" "set variable double pointer" # # test "set variable" for struct members # @@ -395,24 +364,35 @@ v_long_member = 3,.*v_float_member = 4,.*v_double_member = 5.*\}" \ # We need to up this because this can be really slow on some boards. # (malloc() is called as part of the test). -set timeout 60; +set prev_timeout $timeout +set timeout 60 # Change the values test_set "set variable v_struct1 = {32, 33, 34, 35, 36, 37}" \ "print v_struct1" \ - ".*.\[0-9\]* = \{.*v_char_member = 32 \' \',.*v_short_member = 33,\ + ".*.\[0-9\]* = \\{.*v_char_member = 32 \' \',.*v_short_member = 33,\ .*v_int_member = 34,.*\ -v_long_member = 35,.*v_float_member = 36,.*v_double_member = 37.*\}" \ +v_long_member = 35,.*v_float_member = 36,.*v_double_member = 37.*\\}" \ "set print structure #2" # Change them back test_set "set variable v_struct1 = {'h', 1, 2, 3, 4.0, 5.0}" \ "print v_struct1" \ - ".*.\[0-9\]* = \{.*v_char_member = 104 \'h\',.*v_short_member = 1,\ + ".*.\[0-9\]* = \\{.*v_char_member = 104 \'h\',.*v_short_member = 1,\ .*v_int_member = 2,.*\ -v_long_member = 3,.*v_float_member = 4,.*v_double_member = 5.*\}" \ +v_long_member = 3,.*v_float_member = 4,.*v_double_member = 5.*\\}" \ "set print structure #3" +# +# test "set variable" for nested struct +# +test_set "set variable v_struct3 = {1, {'h', 1, 2, 3, 4.0, 5.0}, 37}" \ + "print v_struct3" \ + ".*.\[0-9\]* = \\{.*v_long_member = 1,.*t = \\{.*v_char_member = 104 \'h\',.*v_short_member = 1,.*v_int_member = 2,.*v_long_member = 3,.*v_float_member = 4,.*v_double_member = 5.*\\},.*v_char_member = 37 \'%\'\\}" \ + "set print structure #4" + +set timeout $prev_timeout + # Test printing of enumeration bitfields. # GNU C supports them, some other compilers don't.