diff options
author | Michael Snyder <msnyder@vmware.com> | 2010-05-26 18:12:13 +0000 |
---|---|---|
committer | Michael Snyder <msnyder@vmware.com> | 2010-05-26 18:12:13 +0000 |
commit | ec9f121215974e7a364537052f7720d50d162dc4 (patch) | |
tree | 86258406c060f85522d17d1d0256694875c9bc64 /gdb | |
parent | 6acb16a2933eda8acd00095c425e32cf5ef171cb (diff) | |
download | binutils-ec9f121215974e7a364537052f7720d50d162dc4.zip binutils-ec9f121215974e7a364537052f7720d50d162dc4.tar.gz binutils-ec9f121215974e7a364537052f7720d50d162dc4.tar.bz2 |
2010-05-26 Michael Snyder <msnyder@msnyder-server.eng.vmware.com>
* gdb.reverse/consecutive-reverse.exp: Replace send_gdb with gdb_test.
* gdb.reverse/consecutive-precsave.exp: Replace send_gdb with gdb_test.
* gdb.mi/mi-basics.exp:
* gdb.mi/mi-nonstop-exit.exp: Replace send_gdb with gdb_test.
* gdb.mi/mi-nonstop.exp: Replace send_gdb with gdb_test.
* gdb.mi/mi-ns-stale-regcache.exp: Replace send_gdb with gdb_test.
* gdb.mi/mi-nsintrall.exp: Replace send_gdb with gdb_test.
* gdb.mi/mi-nsmoribund.exp: Replace send_gdb with gdb_test.
* gdb.mi/mi-nsthrexec.exp: Replace send_gdb with gdb_test.
* gdb.mi/mi-return.exp: Replace send_gdb with gdb_test.
* gdb.mi/mi-var-display.exp: Replace send_gdb with gdb_test.
* gdb.mi/mi2-basics.exp: Replace send_gdb with gdb_test.
* gdb.mi/mi2-console.exp: Replace send_gdb with gdb_test.
* gdb.mi/mi2-return.exp: Replace send_gdb with gdb_test.
* gdb.mi/mi2-var-display.exp: Replace send_gdb with gdb_test.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/testsuite/ChangeLog | 60 | ||||
-rw-r--r-- | gdb/testsuite/gdb.mi/mi-basics.exp | 56 | ||||
-rw-r--r-- | gdb/testsuite/gdb.mi/mi-nonstop-exit.exp | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.mi/mi-nonstop.exp | 17 | ||||
-rw-r--r-- | gdb/testsuite/gdb.mi/mi-ns-stale-regcache.exp | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.mi/mi-nsintrall.exp | 17 | ||||
-rw-r--r-- | gdb/testsuite/gdb.mi/mi-nsmoribund.exp | 33 | ||||
-rw-r--r-- | gdb/testsuite/gdb.mi/mi-nsthrexec.exp | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.mi/mi-return.exp | 8 | ||||
-rw-r--r-- | gdb/testsuite/gdb.mi/mi-var-display.exp | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.mi/mi2-basics.exp | 56 | ||||
-rw-r--r-- | gdb/testsuite/gdb.mi/mi2-console.exp | 6 | ||||
-rw-r--r-- | gdb/testsuite/gdb.mi/mi2-return.exp | 8 | ||||
-rw-r--r-- | gdb/testsuite/gdb.mi/mi2-var-display.exp | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.reverse/consecutive-precsave.exp | 26 | ||||
-rw-r--r-- | gdb/testsuite/gdb.reverse/consecutive-reverse.exp | 26 |
16 files changed, 116 insertions, 222 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 823e513..b7808e8 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,4 +1,23 @@ -2010-05-25 Michael Snyder <msnyder@vmware.com> +2010-05-26 Michael Snyder <msnyder@msnyder-server.eng.vmware.com> + + * gdb.reverse/consecutive-reverse.exp: Replace send_gdb with gdb_test. + * gdb.reverse/consecutive-precsave.exp: Replace send_gdb with gdb_test. + + * gdb.mi/mi-basics.exp: + * gdb.mi/mi-nonstop-exit.exp: Replace send_gdb with gdb_test. + * gdb.mi/mi-nonstop.exp: Replace send_gdb with gdb_test. + * gdb.mi/mi-ns-stale-regcache.exp: Replace send_gdb with gdb_test. + * gdb.mi/mi-nsintrall.exp: Replace send_gdb with gdb_test. + * gdb.mi/mi-nsmoribund.exp: Replace send_gdb with gdb_test. + * gdb.mi/mi-nsthrexec.exp: Replace send_gdb with gdb_test. + * gdb.mi/mi-return.exp: Replace send_gdb with gdb_test. + * gdb.mi/mi-var-display.exp: Replace send_gdb with gdb_test. + * gdb.mi/mi2-basics.exp: Replace send_gdb with gdb_test. + * gdb.mi/mi2-console.exp: Replace send_gdb with gdb_test. + * gdb.mi/mi2-return.exp: Replace send_gdb with gdb_test. + * gdb.mi/mi2-var-display.exp: Replace send_gdb with gdb_test. + +2010-05-26 Michael Snyder <msnyder@vmware.com> * gdb.ada/formatted_ref.exp: Replace send_gdb with gdb_test. @@ -52,28 +71,6 @@ 2010-05-25 Michael Snyder <msnyder@vmware.com> - * gdb.ada/formatted_ref.exp: Replace send_gdb with gdb_test. - - * gdb.asm/asm-source.exp: Replace send_gdb with gdb_test. - - * gdb.cp/annota2.exp: Replace send_gdb with gdb_test. - * gdb.cp/annota3.exp: Replace send_gdb with gdb_test. - * gdb.cp/anon-union.exp: Replace send_gdb with gdb_test. - * gdb.cp/cplusfuncs.exp: Replace send_gdb with gdb_test. - * gdb.cp/demangle.exp: Replace send_gdb with gdb_test. - * gdb.cp/formatted-ref.exp: Replace send_gdb with gdb_test. - * gdb.cp/local.exp: Replace send_gdb with gdb_test. - * gdb.cp/method.exp: Replace send_gdb with gdb_test. - * gdb.cp/misc.exp: Replace send_gdb with gdb_test. - * gdb.cp/namespace.exp: Replace send_gdb with gdb_test. - * gdb.cp/ovldbreak.exp: Replace send_gdb with gdb_test. - * gdb.cp/pr-1023.exp: Replace send_gdb with gdb_test. - * gdb.cp/ref-types.exp: Replace send_gdb with gdb_test. - * gdb.cp/templates.exp: Replace send_gdb with gdb_test. - * gdb.cp/userdef.exp: Replace send_gdb with gdb_test. - -2010-05-25 Michael Snyder <msnyder@vmware.com> - * gdb.base/a2-run.exp: Replace send_gdb with gdb_test. * gdb.base/all-bin.exp: Replace send_gdb with gdb_test. * gdb.base/annota1.exp: Replace send_gdb with gdb_test. @@ -83,7 +80,6 @@ * gdb.base/bitfields.exp: Replace send_gdb with gdb_test. * gdb.base/bitfields2.exp: Replace send_gdb with gdb_test. * gdb.base/bitops.exp: Replace send_gdb with gdb_test. - * gdb.base/break.exp: Replace send_gdb with gdb_test. * gdb.base/call-ar-st.exp: Replace send_gdb with gdb_test. * gdb.base/callfuncs.exp: Replace send_gdb with gdb_test. * gdb.base/call-rt-st.exp: Replace send_gdb with gdb_test. @@ -122,22 +118,6 @@ * gdb.base/nodebug.exp: Replace send_gdb with gdb_test. * gdb.base/pointers.exp: Replace send_gdb with gdb_test. * gdb.base/ptype.exp: Replace send_gdb with gdb_test. - * gdb.base/relational.exp: Replace send_gdb with gdb_test. - * gdb.base/relocate.exp: Replace send_gdb with gdb_test. - * gdb.base/return.exp: Replace send_gdb with gdb_test. - * gdb.base/return2.exp: Replace send_gdb with gdb_test. - * gdb.base/sepdebug.exp: Replace send_gdb with gdb_test. - * gdb.base/setvar.exp: Replace send_gdb with gdb_test. - * gdb.base/shlib-call.exp: Replace send_gdb with gdb_test. - * gdb.base/shreloc.exp: Replace send_gdb with gdb_test. - * gdb.base/sigall.exp: Replace send_gdb with gdb_test. - * gdb.base/sigbpt.exp: Replace send_gdb with gdb_test. - * gdb.base/signull.exp: Replace send_gdb with gdb_test. - * gdb.base/so-impl-ld.exp:Replace send_gdb with gdb_test. - * gdb.base/varargs.exp: Replace send_gdb with gdb_test. - * gdb.base/volatile.exp: Replace send_gdb with gdb_test. - * gdb.base/watch_thread_num.exp: Replace send_gdb with gdb_test. - * gdb.base/watchpoint.exp: Replace send_gdb with gdb_test. * gdb.base/whatis.exp: Replace send_gdb with gdb_test. 2010-05-25 Doug Evans <dje@google.com> diff --git a/gdb/testsuite/gdb.mi/mi-basics.exp b/gdb/testsuite/gdb.mi/mi-basics.exp index dcf4dd4..db68d3b 100644 --- a/gdb/testsuite/gdb.mi/mi-basics.exp +++ b/gdb/testsuite/gdb.mi/mi-basics.exp @@ -60,23 +60,19 @@ proc test_mi_interpreter_selection {} { # All this test expects is to get the prompt back # with no syntax error message - send_gdb "-gdb-version\n" - gdb_expect { - -re "GNU gdb .*\r\n$mi_gdb_prompt$" \ - { pass "acceptance of MI operations" - return 1} - -re ".*\r\n$mi_gdb_prompt$" \ - { fail "acceptance of MI operations" - note "Skipping all other MI tests." } - -re "Undefined command.*$gdb_prompt $" \ - { fail "acceptance of MI operations" - note "Skipping all other MI tests." } - -re ".*$gdb_prompt $" \ - { fail "acceptance of MI operations" - note "Skipping all other MI tests." } - timeout { fail "acceptance of MI operations (timeout)" - note "Skipping all other MI tests." } + gdb_test_multiple "-gdb-version" "acceptance of MI operations" { + -re "GNU gdb .*\r\n$mi_gdb_prompt$" { + pass "acceptance of MI operations" + return 1 + } + -re ".*\r\n$mi_gdb_prompt$" { + fail "acceptance of MI operations" + } + -re "Undefined command.*$gdb_prompt $" { + fail "acceptance of MI operations" + } } + note "Skipping all other MI tests." return 0 } @@ -90,14 +86,17 @@ proc test_exec_and_symbol_mi_operatons {} { # Can't use mi_gdb_test as if this doesn't work, # we must give up on the whole test file - send_gdb "-file-exec-and-symbols ${binfile}\n" - gdb_expect { - -re "\[\r\n\]*\\\^done\r\n$mi_gdb_prompt$" \ - { pass "file-exec-and-symbols operation" } - timeout { fail "file-exec-and-symbols operation (timeout)" - note "Skipping all other MI tests." - return 0} - } + gdb_test_multiple "-file-exec-and-symbols ${binfile}" \ + "-file-exec-and-symbols ${binfile}" { + -re "\[\r\n\]*\\\^done\r\n$mi_gdb_prompt$" { + pass "file-exec-and-symbols operation" + } + timeout { + fail "file-exec-and-symbols operation (timeout)" + note "Skipping all other MI tests." + return 0 + } + } # The following is not used by mi-support.exp, but we test here so # we get done with loading a program basics. @@ -208,14 +207,13 @@ proc test_path_specification {} { # -environment-path -r dir # -environment-path -r - send_gdb "-environment-path\n" - gdb_expect 20 { + gdb_test_multiple "-environment-path" "-environment-path" { -re "\\\^done,path=\"\(.*\)\"\r\n$mi_gdb_prompt" { - set orig_path $expect_out(1,string); + set orig_path $expect_out(1,string); } timeout { - perror "-environment-path (timeout)" ; - return + perror "-environment-path (timeout)" ; + return } } diff --git a/gdb/testsuite/gdb.mi/mi-nonstop-exit.exp b/gdb/testsuite/gdb.mi/mi-nonstop-exit.exp index 6acdcb9..3b67825 100644 --- a/gdb/testsuite/gdb.mi/mi-nonstop-exit.exp +++ b/gdb/testsuite/gdb.mi/mi-nonstop-exit.exp @@ -37,14 +37,13 @@ mi_gdb_reinitialize_dir $srcdir/$subdir mi_gdb_load $binfile set supported 0 -send_gdb "-gdb-show non-stop\n" -gdb_expect { +gdb_test_multiple "-gdb-show non-stop" "" { -re ".*\\^done,value=\"off\",supported=\"(\[^\"\]+)\"\r\n$mi_gdb_prompt$" { if { $expect_out(1,string) == "1" } { set supported 1 } } - -re ".$mi_gdb_prompt$" { + -re ".*$mi_gdb_prompt$" { } } diff --git a/gdb/testsuite/gdb.mi/mi-nonstop.exp b/gdb/testsuite/gdb.mi/mi-nonstop.exp index 278fe2a..a23d70d 100644 --- a/gdb/testsuite/gdb.mi/mi-nonstop.exp +++ b/gdb/testsuite/gdb.mi/mi-nonstop.exp @@ -47,14 +47,13 @@ mi_gdb_reinitialize_dir $srcdir/$subdir mi_gdb_load $binfile set supported 0 -send_gdb "-gdb-show non-stop\n" -gdb_expect { +gdb_test_multiple "-gdb-show non-stop" "" { -re ".*\\^done,value=\"off\",supported=\"(\[^\"\]+)\"\r\n$mi_gdb_prompt$" { if { $expect_out(1,string) == "1" } { set supported 1 } } - -re ".$mi_gdb_prompt$" { + -re ".*$mi_gdb_prompt$" { } } @@ -94,14 +93,10 @@ mi_varobj_update * {I_W1 I_W0} "update varobj, 1" mi_check_varobj_value I_W0 1 "check varobj, w0, 1" mi_check_varobj_value I_W1 1 "check varobj, w1, 1" -send_gdb "-exec-interrupt --thread 1\n" -gdb_expect { +gdb_test_multiple "-exec-interrupt --thread 1" "interrupted" { -re "\\^done\r\n$mi_gdb_prompt\\*stopped\[^\r\n\]+\r\n$" { pass "interrupted" } - timeout { - fail "interrupted (timeout)" - } } # The interrupt command sends SIGINT to the target, and therefore the # thread might not be stopped immediately when we return from the target. @@ -109,14 +104,10 @@ gdb_expect { sleep 1 mi_check_thread_states {"stopped" "stopped" "stopped"} "thread state, stop 4" -send_gdb "-exec-continue --all\n" -gdb_expect { +gdb_test_multiple "-exec-continue --all" "resume all" { -re ".*\\*running,thread-id=\"3\"\r\n\\*running,thread-id=\"2\"\r\n\\*running,thread-id=\"1\"\r\n$mi_gdb_prompt" { pass "resume all" } - timeout { - fail "resume all (timeout)" - } } mi_expect_stop "breakpoint-hit" "break_at_me" "\[^\n\]*" "non-stop.c" "\[0-9\]*" {"" "disp=\"keep\""} "w0,i2 stop" diff --git a/gdb/testsuite/gdb.mi/mi-ns-stale-regcache.exp b/gdb/testsuite/gdb.mi/mi-ns-stale-regcache.exp index a98e702..24bc73e 100644 --- a/gdb/testsuite/gdb.mi/mi-ns-stale-regcache.exp +++ b/gdb/testsuite/gdb.mi/mi-ns-stale-regcache.exp @@ -51,14 +51,13 @@ mi_gdb_reinitialize_dir $srcdir/$subdir mi_gdb_load $binfile set supported 0 -send_gdb "-gdb-show non-stop\n" -gdb_expect { +gdb_test_multiple "-gdb-show non-stop" "" { -re ".*\\^done,value=\"off\",supported=\"(\[^\"\]+)\"\r\n$mi_gdb_prompt$" { if { $expect_out(1,string) == "1" } { set supported 1 } } - -re ".$mi_gdb_prompt$" { + -re ".*$mi_gdb_prompt$" { } } diff --git a/gdb/testsuite/gdb.mi/mi-nsintrall.exp b/gdb/testsuite/gdb.mi/mi-nsintrall.exp index 9ba197a..cd277b2 100644 --- a/gdb/testsuite/gdb.mi/mi-nsintrall.exp +++ b/gdb/testsuite/gdb.mi/mi-nsintrall.exp @@ -37,14 +37,13 @@ mi_gdb_reinitialize_dir $srcdir/$subdir mi_gdb_load $binfile set supported 0 -send_gdb "-gdb-show non-stop\n" -gdb_expect { +gdb_test_multiple "-gdb-show non-stop\n" "" { -re ".*\\^done,value=\"off\",supported=\"(\[^\"\]+)\"\r\n$mi_gdb_prompt$" { if { $expect_out(1,string) == "1" } { set supported 1 } } - -re ".$mi_gdb_prompt$" { + -re ".*$mi_gdb_prompt$" { } } @@ -78,14 +77,10 @@ for {set i 6} {$i > 0} {incr i -1} { set running_re "$running_re\\*running,thread-id=\"$i\"\r\n" } -send_gdb "-exec-continue --all\n" -gdb_expect { +gdb_test_multiple "-exec-continue --all" "resume all, no breakpoint" { -re ".*$running_re$mi_gdb_prompt" { pass "resume all, no breakpoint" } - timeout { - fail "resume all, no breakpoint (timeout)" - } } mi_check_thread_states \ {"running" "running" "running" "running" "running" "running"} \ @@ -101,14 +96,10 @@ mi_check_thread_states \ "thread state, all interrupted" # resume all threads, and check that no thread is spuriously left interrupted -send_gdb "-exec-continue --all\n" -gdb_expect { +gdb_test_multiple "-exec-continue --all" "resume all after interrupting" { -re ".*$running_re$mi_gdb_prompt" { pass "resume all after interrupting" } - timeout { - fail "resume all after interrupting (timeout)" - } } sleep 1 diff --git a/gdb/testsuite/gdb.mi/mi-nsmoribund.exp b/gdb/testsuite/gdb.mi/mi-nsmoribund.exp index 9078dd2..3e5bc1b 100644 --- a/gdb/testsuite/gdb.mi/mi-nsmoribund.exp +++ b/gdb/testsuite/gdb.mi/mi-nsmoribund.exp @@ -37,14 +37,13 @@ mi_gdb_reinitialize_dir $srcdir/$subdir mi_gdb_load $binfile set supported 0 -send_gdb "-gdb-show non-stop\n" -gdb_expect { +gdb_test_multiple "-gdb-show non-stop" "" { -re ".*\\^done,value=\"off\",supported=\"(\[^\"\]+)\"\r\n$mi_gdb_prompt$" { if { $expect_out(1,string) == "1" } { set supported 1 } } - -re ".$mi_gdb_prompt$" { + -re ".*$mi_gdb_prompt$" { } } @@ -99,14 +98,10 @@ for {set i $nthreads} {$i > 0} {incr i -1} { set running_re "$running_re\\*running,thread-id=\"$decimal\"\r\n" } -send_gdb "-exec-continue --all\n" -gdb_expect { +gdb_test_multiple "-exec-continue --all" "resume all, thread specific breakpoint" { -re ".*$running_re$mi_gdb_prompt" { pass "resume all, thread specific breakpoint" } - timeout { - fail "resume all, thread specific breakpoint (timeout)" - } } mi_expect_stop "breakpoint-hit" "thread_function" "\[^\n\]*" "$srcfile" \ @@ -128,20 +123,14 @@ mi_check_thread_states \ # a target bug if it can step over breakpoints itself), a spurious # SIGTRAP/SIGSEGV can come at any time after deleting the breakpoint. -send_gdb "102-break-delete\n" -send_gdb "print done = 1\n" -send_gdb "103-exec-continue --all\n" - -gdb_expect { - -re "\\*stopped,reason=\"exited-normally\"" { - pass "resume all, program exited normally" - } - -re "\\*stopped" { - fail "unexpected stop" - } - timeout { - fail "resume all, waiting for program exit (timeout)" +gdb_test_multiple "102-break-delete\nprint done = 1\n103-exec-continue --all" \ + "resume all, program exited normally" { + -re "\\*stopped,reason=\"exited-normally\"" { + pass "resume all, program exited normally" + } + -re "\\*stopped" { + fail "unexpected stop" + } } -} mi_gdb_exit diff --git a/gdb/testsuite/gdb.mi/mi-nsthrexec.exp b/gdb/testsuite/gdb.mi/mi-nsthrexec.exp index 9b61040..585e30f 100644 --- a/gdb/testsuite/gdb.mi/mi-nsthrexec.exp +++ b/gdb/testsuite/gdb.mi/mi-nsthrexec.exp @@ -47,14 +47,13 @@ mi_gdb_reinitialize_dir $srcdir/$subdir mi_gdb_load $binfile set supported 0 -send_gdb "-gdb-show non-stop\n" -gdb_expect { +gdb_test_multiple "-gdb-show non-stop" "" { -re ".*\\^done,value=\"off\",supported=\"(\[^\"\]+)\"\r\n$mi_gdb_prompt$" { if { $expect_out(1,string) == "1" } { set supported 1 } } - -re ".$mi_gdb_prompt$" { + -re ".*$mi_gdb_prompt$" { } } diff --git a/gdb/testsuite/gdb.mi/mi-return.exp b/gdb/testsuite/gdb.mi/mi-return.exp index 938fb1f..d8bd1ae 100644 --- a/gdb/testsuite/gdb.mi/mi-return.exp +++ b/gdb/testsuite/gdb.mi/mi-return.exp @@ -53,11 +53,9 @@ proc test_return_simple {} { set line_callee3_call [expr $line_callee3_head + 2] set line_callee3_close_brace [expr $line_callee3_head + 3] - send_gdb "111-exec-return\n" - gdb_expect { - -re "111\\^done,frame=\{level=\"0\",addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"($line_callee3_call|$line_callee3_close_brace)\"\}\r\n$mi_gdb_prompt$" {pass "return from callee4 now"} - -re ".*\r\n$mi_gdb_prompt$" { fail "return from callee4 now" } - timeout { fail "return from callee4 now (timeout)" + gdb_test_multiple "111-exec-return" "return from callee4 now" { + -re "111\\^done,frame=\{level=\"0\",addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"($line_callee3_call|$line_callee3_close_brace)\"\}\r\n$mi_gdb_prompt$" { + pass "return from callee4 now" } } } diff --git a/gdb/testsuite/gdb.mi/mi-var-display.exp b/gdb/testsuite/gdb.mi/mi-var-display.exp index 875e5d2..ff8fe69 100644 --- a/gdb/testsuite/gdb.mi/mi-var-display.exp +++ b/gdb/testsuite/gdb.mi/mi-var-display.exp @@ -606,14 +606,11 @@ mi_gdb_test "-var-list-children anone" \ # Record fp -send_gdb "p/x \$fp\n" -gdb_expect { +gdb_test_multiple "p/x \$fp" "print FP register" { -re ".*($hex).*\\^done\r\n$mi_gdb_prompt$" { pass "print FP register" set fp $expect_out(1,string) } -# -re ".*" { fail "print FP register"} - timeout { fail "print FP register (timeout)"} } mi_continue_to "incr_a" diff --git a/gdb/testsuite/gdb.mi/mi2-basics.exp b/gdb/testsuite/gdb.mi/mi2-basics.exp index 67a384c..d2dac25 100644 --- a/gdb/testsuite/gdb.mi/mi2-basics.exp +++ b/gdb/testsuite/gdb.mi/mi2-basics.exp @@ -60,23 +60,19 @@ proc test_mi_interpreter_selection {} { # All this test expects is to get the prompt back # with no syntax error message - send_gdb "-gdb-version\n" - gdb_expect { - -re "GNU gdb .*\r\n$mi_gdb_prompt$" \ - { pass "acceptance of MI operations" - return 1} - -re ".*\r\n$mi_gdb_prompt$" \ - { fail "acceptance of MI operations" - note "Skipping all other MI tests." } - -re "Undefined command.*$gdb_prompt $" \ - { fail "acceptance of MI operations" - note "Skipping all other MI tests." } - -re ".*$gdb_prompt $" \ - { fail "acceptance of MI operations" - note "Skipping all other MI tests." } - timeout { fail "acceptance of MI operations (timeout)" - note "Skipping all other MI tests." } + gdb_test_multiple "-gdb-version" "acceptance of MI operations" { + -re "GNU gdb .*\r\n$mi_gdb_prompt$" { + pass "acceptance of MI operations" + return 1 + } + -re ".*\r\n$mi_gdb_prompt$" { + fail "acceptance of MI operations" + } + -re "Undefined command.*$gdb_prompt $" { + fail "acceptance of MI operations" + } } + note "Skipping all other MI tests." return 0 } @@ -90,14 +86,17 @@ proc test_exec_and_symbol_mi_operatons {} { # Can't use mi_gdb_test as if this doesn't work, # we must give up on the whole test file - send_gdb "-file-exec-and-symbols ${binfile}\n" - gdb_expect { - -re "\[\r\n\]*\\\^done\r\n$mi_gdb_prompt$" \ - { pass "file-exec-and-symbols operation" } - timeout { fail "file-exec-and-symbols operation (timeout)" - note "Skipping all other MI tests." - return 0} - } + gdb_test_multiple "-file-exec-and-symbols ${binfile}" \ + "file-exec-and-symbols operation" { + -re "\[\r\n\]*\\\^done\r\n$mi_gdb_prompt$" { + pass "file-exec-and-symbols operation" + } + timeout { + fail "file-exec-and-symbols operation (timeout)" + note "Skipping all other MI tests." + return 0 + } + } # The following is not used by mi-support.exp, but we test here so # we get done with loading a program basics. @@ -210,14 +209,13 @@ proc test_path_specification {} { # -environment-path -r dir # -environment-path -r - send_gdb "-environment-path\n" - gdb_expect 20 { + gdb_test_multiple "-environment-path" "-environment-path" { -re "\\\^done,path=\"\(.*\)\"\r\n$mi_gdb_prompt" { - set orig_path $expect_out(1,string); + set orig_path $expect_out(1,string); } timeout { - perror "-environment-path (timeout)" ; - return + perror "-environment-path (timeout)" ; + return } } diff --git a/gdb/testsuite/gdb.mi/mi2-console.exp b/gdb/testsuite/gdb.mi/mi2-console.exp index ed2a0e9..5ef57c1 100644 --- a/gdb/testsuite/gdb.mi/mi2-console.exp +++ b/gdb/testsuite/gdb.mi/mi2-console.exp @@ -48,14 +48,10 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb mi_run_to_main # Next over the hello() call which will produce lots of output -send_gdb "220-exec-next\n" -gdb_expect { +gdb_test_multiple "220-exec-next" "Started step over hello" { -re "220\\^running\r\n(\\*running,thread-id=\"all\"\r\n)?$mi_gdb_prompt" { pass "Started step over hello" } - timeout { - fail "Started step over hello (timeout)" - } } if { ![target_info exists gdb,noinferiorio] } { diff --git a/gdb/testsuite/gdb.mi/mi2-return.exp b/gdb/testsuite/gdb.mi/mi2-return.exp index 3d5eb4e..7c33c6c 100644 --- a/gdb/testsuite/gdb.mi/mi2-return.exp +++ b/gdb/testsuite/gdb.mi/mi2-return.exp @@ -53,11 +53,9 @@ proc test_return_simple {} { set line_callee3_call [expr $line_callee3_head + 2] set line_callee3_close_brace [expr $line_callee3_head + 3] - send_gdb "111-exec-return\n" - gdb_expect { - -re "111\\^done,frame=\{level=\"0\",addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"($line_callee3_call|$line_callee3_close_brace)\"\}\r\n$mi_gdb_prompt$" {pass "return from callee4 now"} - -re ".*\r\n$mi_gdb_prompt$" { fail "return from callee4 now" } - timeout { fail "return from callee4 now (timeout)" + gdb_test_multiple "111-exec-return" "return from callee4 now" { + -re "111\\^done,frame=\{level=\"0\",addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"($line_callee3_call|$line_callee3_close_brace)\"\}\r\n$mi_gdb_prompt$" { + pass "return from callee4 now" } } } diff --git a/gdb/testsuite/gdb.mi/mi2-var-display.exp b/gdb/testsuite/gdb.mi/mi2-var-display.exp index f24674e..31f7484 100644 --- a/gdb/testsuite/gdb.mi/mi2-var-display.exp +++ b/gdb/testsuite/gdb.mi/mi2-var-display.exp @@ -605,14 +605,11 @@ mi_gdb_test "-var-list-children anone" \ # Record fp -send_gdb "p/x \$fp\n" -gdb_expect { +gdb_test_multiple "p/x \$fp" "print FP register" { -re ".*($hex).*\\^done\r\n$mi_gdb_prompt$" { pass "print FP register" set fp $expect_out(1,string) } -# -re ".*" { fail "print FP register"} - timeout { fail "print FP register (timeout)"} } mi_continue_to "incr_a" diff --git a/gdb/testsuite/gdb.reverse/consecutive-precsave.exp b/gdb/testsuite/gdb.reverse/consecutive-precsave.exp index e6302ac..a709aa1 100644 --- a/gdb/testsuite/gdb.reverse/consecutive-precsave.exp +++ b/gdb/testsuite/gdb.reverse/consecutive-precsave.exp @@ -62,8 +62,7 @@ set foo1_addr 0 set foo2_addr 0 set stop_addr 0 -send_gdb "x /2i \$pc\n" -gdb_expect { +gdb_test_multiple "x /2i \$pc" "get breakpoint address for foo" { global hex global foo1_addr global foo2_addr @@ -74,14 +73,6 @@ gdb_expect { set foo2_addr $expect_out(2,string) pass "get breakpoint address for foo" } - -re ".*$gdb_prompt $" { - fail "get breakpoint address for foo" - return 0; - } - timeout { - fail "get breakpoint address for foo (timeout)" - return 0; - } } gdb_test "break \*$foo2_addr" "Breakpoint $decimal at $foo2_addr: file .*" \ @@ -121,17 +112,8 @@ gdb_test_multiple "step" "$test_msg" { } } -re "Breakpoint $decimal, foo.*$gdb_prompt $" { - send_gdb "print \$pc == $foo1_addr\n" - gdb_expect { - -re "$decimal = 1\[\r\n\]+$gdb_prompt $" { - pass "$test_msg" - } - -re "$decimal = 0\[\r\n\]+$gdb_prompt $" { - fail "$test_msg (wrong address)" - } - } - } - -re ".*$gdb_prompt $" { - fail "$test_msg" + gdb_test "print \$pc == $foo1_addr" \ + "$decimal = 1" \ + "$test_msg" } } diff --git a/gdb/testsuite/gdb.reverse/consecutive-reverse.exp b/gdb/testsuite/gdb.reverse/consecutive-reverse.exp index 64114ea..65aaf76 100644 --- a/gdb/testsuite/gdb.reverse/consecutive-reverse.exp +++ b/gdb/testsuite/gdb.reverse/consecutive-reverse.exp @@ -43,8 +43,7 @@ set foo1_addr 0 set foo2_addr 0 set stop_addr 0 -send_gdb "x /2i \$pc\n" -gdb_expect { +gdb_test_multiple "x /2i \$pc" "get breakpoint address for foo" { global hex global foo1_addr global foo2_addr @@ -55,14 +54,6 @@ gdb_expect { set foo2_addr $expect_out(2,string) pass "get breakpoint address for foo" } - -re ".*$gdb_prompt $" { - fail "get breakpoint address for foo" - return 0; - } - timeout { - fail "get breakpoint address for foo (timeout)" - return 0; - } } gdb_test "break \*$foo2_addr" "Breakpoint $decimal at $foo2_addr: file .*" \ @@ -102,17 +93,8 @@ gdb_test_multiple "step" "$test_msg" { } } -re "Breakpoint $decimal, foo.*$gdb_prompt $" { - send_gdb "print \$pc == $foo1_addr\n" - gdb_expect { - -re "$decimal = 1\[\r\n\]+$gdb_prompt $" { - pass "$test_msg" - } - -re "$decimal = 0\[\r\n\]+$gdb_prompt $" { - fail "$test_msg (wrong address)" - } - } - } - -re ".*$gdb_prompt $" { - fail "$test_msg" + gdb_test "print \$pc == $foo1_addr" \ + "$decimal = 1" \ + "$test_msg" } } |