diff options
author | Bob Manson <manson@cygnus> | 1997-02-24 05:43:35 +0000 |
---|---|---|
committer | Bob Manson <manson@cygnus> | 1997-02-24 05:43:35 +0000 |
commit | 40ac16240a6232f31d8b29278a610cee3b6a35cf (patch) | |
tree | 63a7bdfdddbf860e72dde81594e22d9597444524 /gdb/testsuite/gdb.base | |
parent | 2f671f8415a5e7a780a7fb50586891b3342c4577 (diff) | |
download | gdb-40ac16240a6232f31d8b29278a610cee3b6a35cf.zip gdb-40ac16240a6232f31d8b29278a610cee3b6a35cf.tar.gz gdb-40ac16240a6232f31d8b29278a610cee3b6a35cf.tar.bz2 |
* config/vr4300.exp: New file.
* gdb.*/*.exp: Call gdb_expect instead of expect.
* lib/gdb.exp(gdb_expect): New function.
Diffstat (limited to 'gdb/testsuite/gdb.base')
-rw-r--r-- | gdb/testsuite/gdb.base/a1-selftest.exp | 21 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/bitfields.exp | 34 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/break.exp | 25 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/callfuncs.exp | 6 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/commands.exp | 18 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/crossload.exp | 6 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/funcargs.exp | 128 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/list.exp | 41 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/scope.exp | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/structs.exp | 13 |
10 files changed, 146 insertions, 148 deletions
diff --git a/gdb/testsuite/gdb.base/a1-selftest.exp b/gdb/testsuite/gdb.base/a1-selftest.exp index 128e302..c7f395d 100644 --- a/gdb/testsuite/gdb.base/a1-selftest.exp +++ b/gdb/testsuite/gdb.base/a1-selftest.exp @@ -53,7 +53,7 @@ proc do_steps_and_nexts {} { for {set count 0} {$count < 20} {incr count} { send "list\n" - expect { + gdb_expect { -re ".*symarg = NULL.*$gdb_prompt $" { set description "step over symarg initialization" set command "step" @@ -144,7 +144,7 @@ proc do_steps_and_nexts {} { } } send "$command\n" - expect { + gdb_expect { -re ".*No such file or directory.\r\n$gdb_prompt $" { fail "$description (no source available)" } @@ -167,6 +167,7 @@ proc test_with_self { executable } { global det_file global decimal global timeout + global gdb_spawn_id # load yourself into the debugger # This can take a relatively long time, particularly for testing where @@ -220,7 +221,7 @@ proc test_with_self { executable } { set description "run until breakpoint at main" send "run -nw\n" - expect { + gdb_expect { -re "Starting program.*Breakpoint \[0-9\]+,.*main .argc.*argv.* at .*main.c:.*$gdb_prompt $" { pass "$description" } @@ -249,7 +250,7 @@ proc test_with_self { executable } { # do we have a version number ? send "print version\n" - expect { + gdb_expect { -re ".\[0-9\]+ = +0x.*\[0-9.\]+.*$gdb_prompt $" { pass "printed version" } @@ -272,7 +273,7 @@ proc test_with_self { executable } { setup_xfail "alpha-*-*" "hppa*-*-*" "mips-*-*" set description "step into xmalloc call" send "step\n" - expect { + gdb_expect { -re "xmalloc.*size=.*at.*utils.c.*$gdb_prompt $" { pass "$description" } @@ -292,7 +293,7 @@ proc test_with_self { executable } { # start the "xgdb" process send "continue\n" - expect { + gdb_expect { -re "GNU gdb \[0-9\.\]*.* Copyright \[0-9\]* Free Software Foundation, Inc.* GDB is free software, covered by the GNU General Public License, and you are.* @@ -312,7 +313,7 @@ GDB.*Copyright \[0-9\]+ Free Software Foundation, Inc..*$gdb_prompt $"\ # set xgdb prompt so we can tell which is which send "set prompt (xgdb) \n" - expect { + gdb_expect { -re "\[(\]xgdb\[)\].*\[(\]xgdb\[)\] $" { pass "Set xgdb prompt" } -re ".*$gdb_prompt $" { fail "Set xgdb prompt" } default { fail "(timeout) Set xgdb prompt" } @@ -321,7 +322,7 @@ GDB.*Copyright \[0-9\]+ Free Software Foundation, Inc..*$gdb_prompt $"\ # kill the xgdb process set description "send ^C to child process" send "\003" - expect { + gdb_expect { -re "Program received signal SIGINT.*$gdb_prompt $" { pass "$description" } @@ -335,7 +336,7 @@ GDB.*Copyright \[0-9\]+ Free Software Foundation, Inc..*$gdb_prompt $"\ set description "send SIGINT signal to child process" send "signal SIGINT\n" - expect { + gdb_expect { -re "Continuing with signal SIGINT.*$gdb_prompt $" { pass "$description" } @@ -355,7 +356,7 @@ GDB.*Copyright \[0-9\]+ Free Software Foundation, Inc..*$gdb_prompt $"\ setup_xfail "i*86-pc-linuxaout-gnu" "hppa*-*-hpux*" set description "backtrace through signal handler" send "backtrace\n" - expect { + gdb_expect { -re "#0.*read.*in main \\(.*\\) at .*main\\.c.*$gdb_prompt $" { pass "$description" } diff --git a/gdb/testsuite/gdb.base/bitfields.exp b/gdb/testsuite/gdb.base/bitfields.exp index 158c668..eb550fe 100644 --- a/gdb/testsuite/gdb.base/bitfields.exp +++ b/gdb/testsuite/gdb.base/bitfields.exp @@ -43,7 +43,7 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb proc bitfield_uniqueness {} { global decimal global hex - global prompt + global gdb_prompt global srcfile if [gdb_test "break break1" "Break.* at $hex: file .*$srcfile, line $decimal\\."] { @@ -51,8 +51,8 @@ proc bitfield_uniqueness {} { } gdb_run_cmd - expect { - -re "Break.*break1 \\(\\) at .*$srcfile:$decimal.*$prompt $" { + gdb_expect { + -re "Break.*break1 \\(\\) at .*$srcfile:$decimal.*$gdb_prompt $" { pass "running to break1" } timeout { fail "(timeout) running to break1"; return } @@ -131,7 +131,7 @@ proc bitfield_uniqueness {} { proc bitfield_containment {} { global decimal global hex - global prompt + global gdb_prompt global srcfile delete_breakpoints @@ -141,8 +141,8 @@ proc bitfield_containment {} { } gdb_run_cmd - expect { - -re "Break.*break2 \\(\\) at .*$srcfile:$decimal.*$prompt $" { + gdb_expect { + -re "Break.*break2 \\(\\) at .*$srcfile:$decimal.*$gdb_prompt $" { pass "running to break2" } timeout { fail "(timeout) running to break2"; return } @@ -171,7 +171,7 @@ proc bitfield_containment {} { proc bitfield_unsignedness {} { global decimal global hex - global prompt + global gdb_prompt global srcfile delete_breakpoints @@ -181,8 +181,8 @@ proc bitfield_unsignedness {} { } gdb_run_cmd - expect { - -re "Break.*break3 \\(\\) at .*$srcfile:$decimal.*$prompt $" { + gdb_expect { + -re "Break.*break3 \\(\\) at .*$srcfile:$decimal.*$gdb_prompt $" { pass "running to break3" } timeout { fail "(timeout) running to break3"; return } @@ -203,7 +203,7 @@ proc bitfield_unsignedness {} { proc bitfield_signedness {} { global decimal global hex - global prompt + global gdb_prompt global srcfile delete_breakpoints @@ -213,8 +213,8 @@ proc bitfield_signedness {} { } gdb_run_cmd - expect { - -re "Break.*break4 \\(\\) at .*$srcfile:$decimal.*$prompt $" { + gdb_expect { + -re "Break.*break4 \\(\\) at .*$srcfile:$decimal.*$gdb_prompt $" { pass "running to break4" } timeout { fail "(timeout) running to break4"; return } @@ -231,15 +231,15 @@ proc bitfield_signedness {} { # Determine if the target has signed bitfields so we can xfail the # the signed bitfield tests if it doesn't. send_gdb "print i\n" - expect { - -re ".* = -256.*$prompt $" { + gdb_expect { + -re ".* = -256.*$gdb_prompt $" { pass "determining signed-ness of bitfields" } - -re ".* = 256.*$prompt $" { + -re ".* = 256.*$gdb_prompt $" { pass "determining signed-ness of bitfields" setup_xfail "*-*-*" } - -re ".*$prompt $" { + -re ".*$gdb_prompt $" { fail "determining signed-ness of bitfields" return } @@ -263,7 +263,7 @@ gdb_start gdb_reinitialize_dir $srcdir/$subdir gdb_load ${binfile} -send_gdb "set print sevenbit-strings\n" ; expect -re "$prompt $" +send_gdb "set print sevenbit-strings\n" ; gdb_expect -re "$gdb_prompt $" bitfield_uniqueness if [istarget "mips-idt-*"] then { # Restart because IDT/SIM runs out of file descriptors. diff --git a/gdb/testsuite/gdb.base/break.exp b/gdb/testsuite/gdb.base/break.exp index 099fd27..d9c0826 100644 --- a/gdb/testsuite/gdb.base/break.exp +++ b/gdb/testsuite/gdb.base/break.exp @@ -57,10 +57,10 @@ if [target_info exists gdb_stub] { # for general use elsewhere. send_gdb "delete breakpoints\n" -expect { - -i $gdb_spawn_id -re "Delete all breakpoints.*$" { +gdb_expect { + -re "Delete all breakpoints.*$" { send_gdb "y\n" - expect { + gdb_expect { -re "$gdb_prompt $" { setup_xfail "i*86-*-sysv4*" "sparc-sun-sunos4*" "alpha-dec-osf*" "mips-dec-ultrix*" fail "Delete all breakpoints when none (unexpected prompt)" @@ -68,7 +68,7 @@ expect { timeout { fail "Delete all breakpoints when none (timeout after unexpected prompt)" } } } - -i $gdb_spawn_id -re ".*$gdb_prompt $" { pass "Delete all breakpoints when none" } + -re ".*$gdb_prompt $" { pass "Delete all breakpoints when none" } timeout { fail "Delete all breakpoints when none (timeout)" } } @@ -146,7 +146,7 @@ if ![target_info exists use_gdb_stub] { } else { send_gdb "run\n" } - expect { + gdb_expect { -re "The program .* has been started already.*y or n. $" { send_gdb "y\n" exp_continue @@ -204,7 +204,7 @@ gdb_test "tbreak $srcfile:factorial" "Breakpoint.*at.* file .*$srcfile, line.*" # test break at line number # send_gdb "tbreak 64\n" -expect { +gdb_expect { -re "Breakpoint.*at.* file .*$srcfile, line 64.*$gdb_prompt $" { pass "Temporary breakpoint line number" } -re ".*$gdb_prompt $" { pass "Temporary breakpoint line number" } timeout { fail "breakpoint line number (timeout)" } @@ -216,7 +216,7 @@ gdb_test "tbreak 60" "Breakpoint.*at.* file .*$srcfile, line 60.*" "Temporary br # test break at line number in file # send_gdb "tbreak $srcfile:70\n" -expect { +gdb_expect { -re "Breakpoint.*at.* file .*$srcfile, line 70.*$gdb_prompt $" { pass "Temporary breakpoint line number in file" } -re ".*$gdb_prompt $" { pass "Temporary breakpoint line number in file" } timeout { fail "Temporary breakpoint line number in file (timeout)" } @@ -245,7 +245,6 @@ proc test_clear_command {} { proc test_next_with_recursion {} { global gdb_prompt global decimal - global noresults global binfile if [istarget "d10v-*-*"] { @@ -272,7 +271,7 @@ proc test_next_with_recursion {} { } else { gdb_run_cmd } - expect { + gdb_expect { -re "Break.* factorial .value=6. .*$gdb_prompt $" {} timeout { fail "run to factorial(6) (timeout)" ; return } } @@ -280,7 +279,7 @@ proc test_next_with_recursion {} { # Continue until we call factorial recursively with 5. send_gdb "continue\n" - expect { + gdb_expect { -re "Continuing.*Break.* factorial .value=5. .*$gdb_prompt $" {} timeout { fail "continue to factorial(5) (timeout)" ; return } } @@ -296,7 +295,7 @@ proc test_next_with_recursion {} { # we will be performing with 4. send_gdb "next\n" - expect { + gdb_expect { -re ".* factorial .value - 1.;.*$gdb_prompt $" {} timeout { fail "next to recursive call (timeout)" ; return } } @@ -322,7 +321,7 @@ proc test_next_with_recursion {} { "backtrace from factorial(5.1)"] if { $result != 0 } { return } - if { $noresults == 1 } { return } + if [target_info exists gdb,noresults] { return } if [target_info exists use_gdb_stub] { gdb_breakpoint "exit" gdb_test "continue" "Continuing..*Breakpoint .*exit .code=0.*" "continue until exit in recursive next test" @@ -344,5 +343,5 @@ if [istarget "*-*-vxworks*"] { set timeout 10 verbose "Timeout is now $timeout seconds" 2 send_gdb "set args main\n" - expect -re ".*$gdb_prompt $" {} + gdb_expect -re ".*$gdb_prompt $" {} } diff --git a/gdb/testsuite/gdb.base/callfuncs.exp b/gdb/testsuite/gdb.base/callfuncs.exp index 71286e4..ec5ea62 100644 --- a/gdb/testsuite/gdb.base/callfuncs.exp +++ b/gdb/testsuite/gdb.base/callfuncs.exp @@ -63,13 +63,13 @@ proc set_lang_c {} { global gdb_prompt send_gdb "set language c\n" - expect { + gdb_expect { -re ".*$gdb_prompt $" {} timeout { fail "set language c (timeout)" ; return 0 } } send_gdb "show language\n" - expect { + gdb_expect { -re ".* source language is \"c\".*$gdb_prompt $" { pass "set language to \"c\"" return 1 @@ -95,6 +95,8 @@ proc set_lang_c {} { proc do_function_calls {} { global prototypes global gcc_compiled + # We need to up this because this can be really slow on some boards. + set timeout 60; gdb_test "p t_char_values(0,0)" " = 0" gdb_test "p t_char_values('a','b')" " = 1" diff --git a/gdb/testsuite/gdb.base/commands.exp b/gdb/testsuite/gdb.base/commands.exp index 5932d24..5094f5f 100644 --- a/gdb/testsuite/gdb.base/commands.exp +++ b/gdb/testsuite/gdb.base/commands.exp @@ -42,7 +42,7 @@ gdb_reinitialize_dir $srcdir/$subdir gdb_load ${binfile} proc gdbvar_simple_if_test {} { - global prompt + global gdb_prompt gdb_test "set \$foo = 0" "" "set foo in gdbvar_simple_if_test" # All this test should do is print 0xdeadbeef once. @@ -52,7 +52,7 @@ proc gdbvar_simple_if_test {} { } proc gdbvar_simple_while_test {} { - global prompt + global gdb_prompt gdb_test "set \$foo = 5" "" "set foo in gdbvar_simple_while_test" # This test should print 0xfeedface five times. @@ -60,7 +60,7 @@ proc gdbvar_simple_while_test {} { } proc gdbvar_complex_if_while_test {} { - global prompt + global gdb_prompt gdb_test "set \$foo = 4" "" "set foo in gdbvar complex_if_while_test" # This test should alternate between 0xdeadbeef and 0xfeedface two times. @@ -68,7 +68,7 @@ proc gdbvar_complex_if_while_test {} { } proc progvar_simple_if_test {} { - global prompt + global gdb_prompt if [target_info exists gdb,noargs] { verbose "Skipping progvar_simple_if_test because of noargs." @@ -84,7 +84,7 @@ proc progvar_simple_if_test {} { } proc progvar_simple_while_test {} { - global prompt + global gdb_prompt if [target_info exists gdb,noargs] { verbose "Skipping progvar_simple_while_test because of noargs." @@ -98,7 +98,7 @@ proc progvar_simple_while_test {} { } proc progvar_complex_if_while_test {} { - global prompt + global gdb_prompt if [target_info exists gdb,noargs] { verbose "Skipping progvar_simple_if_while_test because of noargs." @@ -123,7 +123,7 @@ proc if_while_breakpoint_command_test {} { gdb_test "break factorial" "Breakpoint.*at.*" send_gdb "commands\n" - expect { + gdb_expect { -re "End with" { pass "commands in if_while_breakpoint_command_test" } @@ -184,12 +184,12 @@ proc breakpoint_command_test {} { # Test a simple user defined command (with arguments) proc user_defined_command_test {} { - global prompt + global gdb_prompt gdb_test "set \$foo = 4" "" "set foo in user_defined_command_test" send_gdb "define mycommand\n" - expect { + gdb_expect { -re "End with" { pass "define mycommand in user_defined_command_test" } diff --git a/gdb/testsuite/gdb.base/crossload.exp b/gdb/testsuite/gdb.base/crossload.exp index 020e238..c605c85 100644 --- a/gdb/testsuite/gdb.base/crossload.exp +++ b/gdb/testsuite/gdb.base/crossload.exp @@ -75,7 +75,7 @@ proc bfddefault {} { gdb_unload set file_loaded 0 send_gdb "file $objdir/$subdir/$binfile\n" - expect { + gdb_expect { -re "A program is being debugged already. Kill it.*y or n." { send_gdb "y\n" exp_continue @@ -136,7 +136,7 @@ proc bfdexplicit {} { } send_gdb "file $objdir/$subdir/$binfile\n" - expect { + gdb_expect { -re "A program is being debugged already. Kill it.*y or n." { send_gdb "y\n" exp_continue @@ -167,7 +167,7 @@ proc test_ptype_functions {} { global bfdformat global det_file send_gdb "ptype main\n" - expect { + gdb_expect { -re "type = int \[)(\]+\r\n$gdb_prompt $" {} timeout { fail "(timeout) $binfile ($bfdformat) function main" ; return } } diff --git a/gdb/testsuite/gdb.base/funcargs.exp b/gdb/testsuite/gdb.base/funcargs.exp index b9acdc6..fcfab5d 100644 --- a/gdb/testsuite/gdb.base/funcargs.exp +++ b/gdb/testsuite/gdb.base/funcargs.exp @@ -45,7 +45,7 @@ if [get_compiler_info ${binfile}] { # proc integral_args {} { - global prompt + global gdb_prompt global det_file global gcc_compiled global gdb_spawn_id @@ -64,12 +64,12 @@ proc integral_args {} { setup_xfail "a29k-*-udi" if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" } gdb_run_cmd - expect { - -i $gdb_spawn_id -re ".* call0a \\(c=97 'a', s=1, i=2, l=3\\) .*$prompt $" { + gdb_expect { + -re ".* call0a \\(c=97 'a', s=1, i=2, l=3\\) .*$gdb_prompt $" { pass "run to call0a" } - -i $gdb_spawn_id -re "$prompt $" { fail "run to call0a" ; return } - -i $gdb_spawn_id timeout { fail "(timeout) run to call0a" ; return } + -re "$gdb_prompt $" { fail "run to call0a" ; return } + timeout { fail "(timeout) run to call0a" ; return } } # Print each arg as a double check to see if we can print @@ -105,7 +105,7 @@ proc integral_args {} { # proc unsigned_integral_args {} { - global prompt + global gdb_prompt global det_file global gcc_compiled global gdb_spawn_id @@ -124,12 +124,12 @@ proc unsigned_integral_args {} { setup_xfail "a29k-*-udi" if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" } gdb_run_cmd - expect { - -i $gdb_spawn_id -re ".* call1a \\(uc=98 'b', us=6, ui=7, ul=8\\) .*$prompt $" { + gdb_expect { + -re ".* call1a \\(uc=98 'b', us=6, ui=7, ul=8\\) .*$gdb_prompt $" { pass "run to call1a" } - -i $gdb_spawn_id -re "$prompt $" { fail "run to call1a" ; return } - -i $gdb_spawn_id timeout { fail "(timeout) run to call1a" ; return } + -re "$gdb_prompt $" { fail "run to call1a" ; return } + timeout { fail "(timeout) run to call1a" ; return } } # Print each arg as a double check to see if we can print @@ -165,7 +165,7 @@ proc unsigned_integral_args {} { # proc float_and_integral_args {} { - global prompt + global gdb_prompt global det_file global gcc_compiled global gdb_spawn_id @@ -189,10 +189,10 @@ proc float_and_integral_args {} { setup_xfail "a29k-*-udi" if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" "mips-sgi-irix5*" } gdb_run_cmd - expect { - -i $gdb_spawn_id -re ".* call2a \\(c=97 'a', f1=4, s=1, d1=5, i=2, f2=4, l=3, d2=5\\) .*$prompt $" { pass "run to call2a" } - -i $gdb_spawn_id -re "$prompt $" { fail "run to call2a" ; return } - -i $gdb_spawn_id timeout { fail "(timeout) run to call2a" ; return } + gdb_expect { + -re ".* call2a \\(c=97 'a', f1=4, s=1, d1=5, i=2, f2=4, l=3, d2=5\\) .*$gdb_prompt $" { pass "run to call2a" } + -re "$gdb_prompt $" { fail "run to call2a" ; return } + timeout { fail "(timeout) run to call2a" ; return } } # Print each arg as a double check to see if we can print @@ -258,7 +258,7 @@ proc float_and_integral_args {} { # proc pointer_args {} { - global prompt + global gdb_prompt global hex global det_file global gdb_spawn_id @@ -276,10 +276,10 @@ proc pointer_args {} { # code is broken. setup_xfail "a29k-*-udi" gdb_run_cmd - expect { - -i $gdb_spawn_id -re ".* call3a \\(cp=$hex \"a\", sp=$hex, ip=$hex, lp=$hex\\) .*$prompt $" { pass "run to call3a" } - -i $gdb_spawn_id -re "$prompt $" { fail "run to call3a" ; return } - -i $gdb_spawn_id timeout { fail "(timeout) run to call3a" ; return } + gdb_expect { + -re ".* call3a \\(cp=$hex \"a\", sp=$hex, ip=$hex, lp=$hex\\) .*$gdb_prompt $" { pass "run to call3a" } + -re "$gdb_prompt $" { fail "run to call3a" ; return } + timeout { fail "(timeout) run to call3a" ; return } } gdb_test "print *cp" ".* = 97 'a'" @@ -315,7 +315,7 @@ proc pointer_args {} { # proc structs_by_reference {} { - global prompt + global gdb_prompt global hex global det_file global gdb_spawn_id @@ -332,12 +332,12 @@ proc structs_by_reference {} { # code is broken. setup_xfail "a29k-*-udi" gdb_run_cmd - expect { - -i $gdb_spawn_id -re ".* call4a \\(stp=$hex\\) .*$prompt $" { + gdb_expect { + -re ".* call4a \\(stp=$hex\\) .*$gdb_prompt $" { pass "run to call4a" } - -i $gdb_spawn_id -re "$prompt $" { fail "run to call4a" ; return } - -i $gdb_spawn_id timeout { fail "(timeout) run to call4a" ; return } + -re "$gdb_prompt $" { fail "run to call4a" ; return } + timeout { fail "(timeout) run to call4a" ; return } } gdb_test "print *stp" ".* = \{s1 = 101, s2 = 102\}" @@ -359,7 +359,7 @@ proc structs_by_reference {} { # proc structs_by_value {} { - global prompt + global gdb_prompt global hex global det_file global gdb_spawn_id @@ -376,12 +376,12 @@ proc structs_by_value {} { # code is broken. setup_xfail "a29k-*-udi" gdb_run_cmd - expect { - -i $gdb_spawn_id -re ".* call5a \\(st=\{s1 = 101, s2 = 102\}\\) .*$prompt $" { + gdb_expect { + -re ".* call5a \\(st=\{s1 = 101, s2 = 102\}\\) .*$gdb_prompt $" { pass "run to call5a" } - -i $gdb_spawn_id -re "$prompt $" { fail "run to call5a" ; return } - -i $gdb_spawn_id timeout { fail "(timeout) run to call5a" ; return } + -re "$gdb_prompt $" { fail "run to call5a" ; return } + timeout { fail "(timeout) run to call5a" ; return } } gdb_test "print st" ".* = \{s1 = 101, s2 = 102\}" @@ -403,7 +403,7 @@ proc structs_by_value {} { # proc discard_and_shuffle {} { - global prompt + global gdb_prompt global hex global decimal global det_file @@ -428,10 +428,10 @@ proc discard_and_shuffle {} { # code is broken. setup_xfail "a29k-*-udi" gdb_run_cmd - expect { - -i $gdb_spawn_id -re ".*Breakpoint $decimal, call6a .*$prompt $" { pass "run to call6a" } - -i $gdb_spawn_id -re "$prompt $" { fail "run to call6a" ; return } - -i $gdb_spawn_id timeout { fail "(timeout) run to call6a" ; return } + gdb_expect { + -re ".*Breakpoint $decimal, call6a .*$gdb_prompt $" { pass "run to call6a" } + -re "$gdb_prompt $" { fail "run to call6a" ; return } + timeout { fail "(timeout) run to call6a" ; return } } setup_xfail "rs6000-*-*" @@ -548,7 +548,7 @@ proc discard_and_shuffle {} { # proc shuffle_round_robin {} { - global prompt + global gdb_prompt global hex global decimal global det_file @@ -573,12 +573,12 @@ proc shuffle_round_robin {} { # code is broken. setup_xfail "a29k-*-udi" gdb_run_cmd - expect { - -i $gdb_spawn_id -re ".*Breakpoint $decimal, call7a .*$prompt $" { + gdb_expect { + -re ".*Breakpoint $decimal, call7a .*$gdb_prompt $" { pass "run to call7a" } - -i $gdb_spawn_id -re "$prompt $" { fail "run to call7a" ; return } - -i $gdb_spawn_id timeout { fail "(timeout) run to call7a" ; return } + -re "$gdb_prompt $" { fail "run to call7a" ; return } + timeout { fail "(timeout) run to call7a" ; return } } setup_xfail "i960-*-*" 1813 @@ -665,7 +665,7 @@ proc shuffle_round_robin {} { # proc recursive_structs_by_value {} { - global prompt + global gdb_prompt global hex global decimal global det_file @@ -678,10 +678,10 @@ proc recursive_structs_by_value {} { # Run; should stop at hitbottom and print actual arguments. # Print backtrace. gdb_run_cmd - expect { - -i $gdb_spawn_id -re ".*Breakpoint $decimal, hitbottom .*$prompt $" { pass "run to hitbottom" } - -i $gdb_spawn_id -re "$prompt $" { fail "run to hitbottom" ; return } - -i $gdb_spawn_id timeout { fail "(timeout) run to hitbottom" ; return } + gdb_expect { + -re ".*Breakpoint $decimal, hitbottom .*$gdb_prompt $" { pass "run to hitbottom" } + -re "$gdb_prompt $" { fail "run to hitbottom" ; return } + timeout { fail "(timeout) run to hitbottom" ; return } } if ![istarget sparclet-*-*] { @@ -713,7 +713,7 @@ proc funcargs_reload { } { # Test for accessing local stack variables in functions which call alloca # proc localvars_after_alloca { } { - global prompt + global gdb_prompt global hex global decimal global gcc_compiled @@ -745,7 +745,7 @@ proc localvars_after_alloca { } { } proc call_after_alloca { } { - global prompt + global gdb_prompt global hex global decimal global gcc_compiled @@ -772,7 +772,7 @@ proc call_after_alloca { } { # these use a funky `dyncall' mechanism which GDB needs to know about. # proc localvars_in_indirect_call { } { - global prompt + global gdb_prompt global hex global decimal global gcc_compiled @@ -814,19 +814,19 @@ proc localvars_in_indirect_call { } { # send_gdb "finish\n" - expect { - -i $gdb_spawn_id -re "\\(\\*pointer_to_call0a\\) \\(c, s, i, l\\);.*First.*$prompt $" { + gdb_expect { + -re "\\(\\*pointer_to_call0a\\) \\(c, s, i, l\\);.*First.*$gdb_prompt $" { send_gdb "step\n" exp_continue } - -i $gdb_spawn_id -re "\\(\\*pointer_to_call0a\\) \\(c, s, i, l\\);.*Second.*$prompt $" { + -re "\\(\\*pointer_to_call0a\\) \\(c, s, i, l\\);.*Second.*$gdb_prompt $" { pass "finish from indirectly called function" } - -i $gdb_spawn_id -re ".*$prompt $" { + -re ".*$gdb_prompt $" { fail "finish from indirectly called function" return } - -i $gdb_spawn_id default { fail "finish from indirectly called function" ; return } + default { fail "finish from indirectly called function" ; return } } if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" } @@ -841,7 +841,7 @@ proc localvars_in_indirect_call { } { # to handle trampolines. # proc test_stepping_over_trampolines { } { - global prompt + global gdb_prompt global hex global decimal global gdb_spawn_id @@ -851,18 +851,18 @@ proc test_stepping_over_trampolines { } { # Cater for gdb stopping in midline, see comment for finish above. send_gdb "finish\n" - expect { - -i $gdb_spawn_id -re "marker_call_with_trampolines ..;.*$prompt $" { + gdb_expect { + -re "marker_call_with_trampolines ..;.*$gdb_prompt $" { send_gdb "step\n" exp_continue } - -i $gdb_spawn_id -re "pointer_to_call_with_trampolines.*$prompt $" { + -re "pointer_to_call_with_trampolines.*$gdb_prompt $" { pass "finish from marker_call_with_trampolines" } - -i $gdb_spawn_id -re ".*$prompt $" { + -re ".*$gdb_prompt $" { fail "finish from marker_call_with_trampolines" } - -i $gdb_spawn_id default { fail "finish from marker_call_with_trampolines" ; return 0 } + default { fail "finish from marker_call_with_trampolines" ; return 0 } } # Try to step into the target function. @@ -878,19 +878,19 @@ proc test_stepping_over_trampolines { } { # or immediately transfer control back to main if optimizations # are performed. send_gdb "step\n" - expect { - -i $gdb_spawn_id -re "main .* at.*$prompt $" { + gdb_expect { + -re "main .* at.*$gdb_prompt $" { pass "stepping back to main from function called with trampolines" ; return 1 } - -i $gdb_spawn_id -re "\}.*End of call_with_trampolines.*$prompt $" { + -re "\}.*End of call_with_trampolines.*$gdb_prompt $" { send_gdb "step\n" exp_continue } - -i $gdb_spawn_id -re ".*$prompt $" { + -re ".*$gdb_prompt $" { fail "stepping back to main from function called with trampolines" } - -i $gdb_spawn_id default { fail "stepping back to main from function called with trampolines" ; return 0 } + default { fail "stepping back to main from function called with trampolines" ; return 0 } } } diff --git a/gdb/testsuite/gdb.base/list.exp b/gdb/testsuite/gdb.base/list.exp index f718c99..e44ee29 100644 --- a/gdb/testsuite/gdb.base/list.exp +++ b/gdb/testsuite/gdb.base/list.exp @@ -29,6 +29,9 @@ set bug_id 0 set testfile "list" set binfile ${objdir}/${subdir}/${testfile} +# There are some rather large lines in some of these source files. +set match_max 10000; + # Need to download the header to the host. remote_download host ${srcdir}/${subdir}/list0.h list0.h @@ -167,7 +170,7 @@ proc test_list_filename_and_number {} { set testcnt 0 send_gdb "list list0.c:1\n" - expect { + gdb_expect { -re "1\[ \t\]+#include \"list0.h\".*5\[ \t\]+int x;\r\n$gdb_prompt $" { incr testcnt } @@ -175,7 +178,7 @@ proc test_list_filename_and_number {} { timeout { fail "list list0.c:1 (timeout)" ; return } } send_gdb "list list0.c:10\n" - expect { + gdb_expect { -re "5\[ \t\]+int x;.*14\[ \t\]+foo .x\[+)\]+;\r\n$gdb_prompt $" { incr testcnt } @@ -183,7 +186,7 @@ proc test_list_filename_and_number {} { timeout { fail "list list.c:10 (timeout)" ; return } } send_gdb "list list1.c:1\n" - expect { + gdb_expect { -re "1\[ \t\]+void.*5\[ \t\]+printf \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt } @@ -191,7 +194,7 @@ proc test_list_filename_and_number {} { timeout { fail "list list1.c:1 (timeout)" ; return } } send_gdb "list list1.c:12\n" - expect { + gdb_expect { -re "7\[ \t\]+long_line \[(\]+.*\[)\]+;.*14\[ \t\]+\}\r\n.*$gdb_prompt $" { incr testcnt } @@ -232,28 +235,28 @@ proc test_list_forward {} { set testcnt 0 send_gdb "list list0.c:10\n" - expect { + gdb_expect { -re "5\[ \t\]+int x;.*14\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt } -re ".*$gdb_prompt $" { fail "list list0.c:10" ; return } timeout { fail "list list0.c:10 (timeout)" ; return } } send_gdb "list\n" - expect { + gdb_expect { -re "15\[ \t\]+foo \[(\]+.*\[)\]+;.*24\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt } -re ".*$gdb_prompt $" { fail "list 15-24" ; return } timeout { fail "list 15-24 (timeout)" ; return } } send_gdb "list\n" - expect { + gdb_expect { -re "25\[ \t\]+foo \[(\]+.*\[)\]+;.*34\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt } -re ".*$gdb_prompt $" { fail "list 25-34" ; return } timeout { fail "list 25-34 (timeout)" ; return } } send_gdb "list\n" - expect { + gdb_expect { -re "35\[ \t\]+foo \[(\]+.*\[)\]+;.*42\[ \t\]+\}\r\n$gdb_prompt $" { incr testcnt } -re ".*$gdb_prompt $" { fail "list 35-42" ; return } timeout { fail "list 35-42 (timeout)" ; return } @@ -268,28 +271,28 @@ proc test_list_backwards {} { set testcnt 0 send_gdb "list list0.c:33\n" - expect { + gdb_expect { -re "28\[ \t\]+foo \[(\]+.*\[)\]+;.*37\[ \t\]+\r\n$gdb_prompt $" { incr testcnt } -re ".*$gdb_prompt $" { fail "list list0.c:33" ; return } timeout { fail "list list0.c:33 (timeout)" ; return } } send_gdb "list -\n" - expect { + gdb_expect { -re "18\[ \t\]+foo \[(\]+.*\[)\]+;.*27\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt } -re ".*$gdb_prompt $" { fail "list 18-27" ; return } timeout { fail "list 18-27 (timeout)" ; return } } send_gdb "list -\n" - expect { + gdb_expect { -re "8\[ \t\]+breakpoint\[(\]\[)\];.*17\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt } -re ".*$gdb_prompt $" { fail "list 8-17" ; return } timeout { fail "list 8-17 (timeout)" ; return } } send_gdb "list -\n" - expect { + gdb_expect { -re "1\[ \t\]+#include .*7\[ \t\]+set_debug_traps\[(\]\[)\]+;\r\n$gdb_prompt $" { incr testcnt } -re ".*$gdb_prompt $" { fail "list 1-7" ; return } timeout { fail "list 1-7 (timeout)" ; return } @@ -334,7 +337,7 @@ proc test_list_filename_and_function {} { # SunPRO cc is the second case below, it's also correct. setup_xfail "a29k-*-udi" send_gdb "list list0.c:main\n" - expect { + gdb_expect { -re "1\[ \t\]+#include .*8\[ \t\]+breakpoint\[(\]\[)\]+;\r\n$gdb_prompt $" { incr testcnt } @@ -351,7 +354,7 @@ proc test_list_filename_and_function {} { # AIX is legitimately removing it. setup_xfail "rs6000-*-aix*" send_gdb "list list0.c:unused\n" - expect { + gdb_expect { -re "36\[ \t\]+\}.*42\[ \t\]+\}\r\n$gdb_prompt $" { incr testcnt } @@ -372,7 +375,7 @@ proc test_list_filename_and_function {} { # FIXME Fails for COFF as well, I think. setup_xfail "a29k-*-udi" send_gdb "list list0.h:foo\n" - expect { + gdb_expect { -re "2\[ \t\]+including file. This.*11\[ \t\]+bar \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt } @@ -392,7 +395,7 @@ proc test_list_filename_and_function {} { # Ultrix gdb is the second case. # a29k-amd-udi is the third case. send_gdb "list list1.c:bar\n" - expect { + gdb_expect { -re "1\[ \t\]+void.*8\[ \t\]+\}\r\n$gdb_prompt $" { incr testcnt } @@ -412,7 +415,7 @@ proc test_list_filename_and_function {} { # AIX is legitimately removing it. setup_xfail "rs6000-*-aix*" send_gdb "list list1.c:unused\n" - expect { + gdb_expect { -re "7\[ \t\]+long_line \[(\]\[)\];.*14\[ \t\]+\}\r\n.*$gdb_prompt $" { incr testcnt } @@ -477,10 +480,10 @@ gdb_start gdb_reinitialize_dir $srcdir/$subdir gdb_load ${binfile} -if [target_info exists use_gdb_stubs] { +if [target_info exists gdb_stub] { send_gdb "step\n" # if use stubs step out of the breakpoint() function. - expect { + gdb_expect { -re "main.* at .*$gdb_prompt $" {} -re ".*in .*start.*$gdb_prompt $" {} timeout { fail "single step at breakpoint() (timeout)" ; return 0 } diff --git a/gdb/testsuite/gdb.base/scope.exp b/gdb/testsuite/gdb.base/scope.exp index 9a0cd7c..9a8292b 100644 --- a/gdb/testsuite/gdb.base/scope.exp +++ b/gdb/testsuite/gdb.base/scope.exp @@ -547,7 +547,7 @@ gdb_test "print 'scope0.c'::filelocal_ro" "= 201" # is responsible for clearing bss and that hasnt' happened yet. setup_xfail "hppa*-*-*pro*" send_gdb "print 'scope0.c'::filelocal_bss\n" -expect { +gdb_expect { -re " = 0\r\n$gdb_prompt $" { pass "print 'scope0.c'::filelocal_bss before run" } diff --git a/gdb/testsuite/gdb.base/structs.exp b/gdb/testsuite/gdb.base/structs.exp index 76e4b05..3424278 100644 --- a/gdb/testsuite/gdb.base/structs.exp +++ b/gdb/testsuite/gdb.base/structs.exp @@ -100,28 +100,21 @@ proc do_function_calls {} { # Now print the L* variables and examine their values. gdb_test "p L1" " = {a = 49 '1'}" - setup_xfail "mn10200*-*-*" gdb_test "p L2" " = {a = 97 'a', b = 98 'b'}" - setup_xfail "mn10200*-*-*" gdb_test "p L3" " = {a = 65 'A', b = 66 'B', c = 67 'C'}" - setup_xfail "mn10200*-*-*" gdb_test "p L4" " = {a = 49 '1', b = 50 '2', c = 51 '3', d = 52 '4'}" if {$gcc_compiled} then { setup_xfail "hppa*-*-*" } - setup_xfail "mn10200*-*-*" gdb_test "p L5" " = {a = 97 'a', b = 98 'b', c = 99 'c', d = 100 'd', e = 101 'e'}" if {$gcc_compiled} then { setup_xfail "hppa*-*-*" } - setup_xfail "mn10200*-*-*" gdb_test "p L6" " = {a = 65 'A', b = 66 'B', c = 67 'C', d = 68 'D', e = 69 'E', f = 70 'F'}" if {$gcc_compiled} then { setup_xfail "hppa*-*-*" } - setup_xfail "mn10200*-*-*" gdb_test "p L7" " = {a = 49 '1', b = 50 '2', c = 51 '3', d = 52 '4', e = 53 '5', f = 54 '6', g = 55 '7'}" - setup_xfail "mn10200*-*-*" gdb_test "p L8" " = {a = 49 '1', b = 50 '2', c = 51 '3', d = 52 '4', e = 53 '5', f = 54 '6', g = 55 '7', h = 56 '8'}" gdb_test "p L9" " = {a = 97 'a', b = 98 'b', c = 99 'c', d = 100 'd', e = 101 'e', f = 102 'f', g = 103 'g', h = 104 'h', i = 105 'i'}" gdb_test "p L10" " = {a = 65 'A', b = 66 'B', c = 67 'C', d = 68 'D', e = 69 'E', f = 70 'F', g = 71 'G', h = 72 'H', i = 73 'I', j = 74 'J'}" @@ -136,9 +129,9 @@ gdb_start gdb_reinitialize_dir $srcdir/$subdir gdb_load ${binfile} -send_gdb "set print sevenbit-strings\n" ; expect -re "$gdb_prompt $" -send_gdb "set print address off\n" ; expect -re "$gdb_prompt $" -send_gdb "set width 0\n" ; expect -re "$gdb_prompt $" +send_gdb "set print sevenbit-strings\n" ; gdb_expect -re "$gdb_prompt $" +send_gdb "set print address off\n" ; gdb_expect -re "$gdb_prompt $" +send_gdb "set width 0\n" ; gdb_expect -re "$gdb_prompt $" if [target_info exists gdb,cannot_call_functions] { setup_xfail "*-*-*" 2416 |