summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/funcargs.exp
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2014-09-12 22:16:31 +0100
committerPedro Alves <palves@redhat.com>2014-09-12 22:16:31 +0100
commitfa43b1d7ca8d9699a253b1f227e91c406a043a0b (patch)
treecde814e330d7e2657020cf31199edbddc47934fe /gdb/testsuite/gdb.base/funcargs.exp
parentf37f681c2bb884e74cd33340617a6d1a408d1a75 (diff)
downloadbinutils-gdb-fa43b1d7ca8d9699a253b1f227e91c406a043a0b.tar.gz
after gdb_run_cmd, gdb_expect -> gdb_test_multiple/gdb_test
See: https://sourceware.org/ml/gdb-patches/2014-09/msg00404.html We have a number of places that do gdb_run_cmd followed by gdb_expect, when it would be better to use gdb_test_multiple or gdb_test. This converts all that "grep gdb_run_cmd -A 2 | grep gdb_expect" found. Tested on x86_64 Fedora 20, native and gdbserver. gdb/testsuite/ 2014-09-12 Pedro Alves <palves@redhat.com> * gdb.arch/gdb1558.exp: Replace uses of gdb_expect after gdb_run_cmd with gdb_test_multiple or gdb_test throughout. * gdb.arch/i386-size-overlap.exp: Likewise. * gdb.arch/i386-size.exp: Likewise. * gdb.arch/i386-unwind.exp: Likewise. * gdb.base/a2-run.exp: Likewise. * gdb.base/break.exp: Likewise. * gdb.base/charset.exp: Likewise. * gdb.base/chng-syms.exp: Likewise. * gdb.base/commands.exp: Likewise. * gdb.base/dbx.exp: Likewise. * gdb.base/find.exp: Likewise. * gdb.base/funcargs.exp: Likewise. * gdb.base/jit-simple.exp: Likewise. * gdb.base/reread.exp: Likewise. * gdb.base/sepdebug.exp: Likewise. * gdb.base/step-bt.exp: Likewise. * gdb.cp/mb-inline.exp: Likewise. * gdb.cp/mb-templates.exp: Likewise. * gdb.objc/basicclass.exp: Likewise. * gdb.threads/killed.exp: Likewise.
Diffstat (limited to 'gdb/testsuite/gdb.base/funcargs.exp')
-rw-r--r--gdb/testsuite/gdb.base/funcargs.exp89
1 files changed, 22 insertions, 67 deletions
diff --git a/gdb/testsuite/gdb.base/funcargs.exp b/gdb/testsuite/gdb.base/funcargs.exp
index b6de3d22510..5cbd789df0d 100644
--- a/gdb/testsuite/gdb.base/funcargs.exp
+++ b/gdb/testsuite/gdb.base/funcargs.exp
@@ -54,13 +54,7 @@ proc integral_args {} {
# Run; should stop at call0a and print actual arguments.
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
gdb_run_cmd
- gdb_expect {
- -re ".* call0a \\(c=97 'a', s=1, i=2, l=3\\) .*$gdb_prompt $" {
- pass "run to call0a"
- }
- -re "$gdb_prompt $" { fail "run to call0a" ; gdb_suppress_tests }
- timeout { fail "(timeout) run to call0a" ; gdb_suppress_tests }
- }
+ gdb_test "" " call0a \\(c=97 'a', s=1, i=2, l=3\\) .*" "run to call0a"
# Print each arg as a double check to see if we can print
# them here as well as with backtrace.
@@ -111,13 +105,7 @@ proc unsigned_integral_args {} {
# Run; should stop at call1a and print actual arguments.
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
gdb_run_cmd
- gdb_expect {
- -re ".* call1a \\(uc=98 'b', us=6, ui=7, ul=8\\) .*$gdb_prompt $" {
- pass "run to call1a"
- }
- -re "$gdb_prompt $" { fail "run to call1a" ; gdb_suppress_tests; }
- timeout { fail "(timeout) run to call1a" ; gdb_suppress_tests; }
- }
+ gdb_test "" " call1a \\(uc=98 'b', us=6, ui=7, ul=8\\) .*" "run to call1a"
# Print each arg as a double check to see if we can print
# them here as well as with backtrace.
@@ -172,11 +160,14 @@ proc float_and_integral_args {} {
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" "mips-sgi-irix5*" }
gdb_run_cmd
- 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 ".* call2a \\(c=97 'a', f1=.*, s=1, d1=5, i=2, f2=4, l=3, d2=5\\) .*$gdb_prompt $" { xfail "run to call2a" }
- -re "$gdb_prompt $" { fail "run to call2a" ; gdb_suppress_tests; }
- timeout { fail "(timeout) run to call2a" ; gdb_suppress_tests; }
+ set test "run to call2a"
+ gdb_test_multiple "" $test {
+ -re ".* call2a \\(c=97 'a', f1=4, s=1, d1=5, i=2, f2=4, l=3, d2=5\\) .*$gdb_prompt $" {
+ pass $test
+ }
+ -re ".* call2a \\(c=97 'a', f1=.*, s=1, d1=5, i=2, f2=4, l=3, d2=5\\) .*$gdb_prompt $" {
+ xfail $test
+ }
}
# Print each arg as a double check to see if we can print
@@ -257,10 +248,8 @@ proc complex_args {} {
# Run; should stop at call1a and print actual arguments.
gdb_run_cmd
- gdb_expect {
- -re ".* callca \\(f1=1 \\+ 2 \\* I, f2=1 \\+ 2 \\* I, f3=1 \\+ 2 \\* I\\) .*$gdb_prompt $" { pass "run to call2a" }
- timeout { fail "(timeout) run to callca" ; gdb_suppress_tests; }
- }
+ gdb_test "" " callca \\(f1=1 \\+ 2 \\* I, f2=1 \\+ 2 \\* I, f3=1 \\+ 2 \\* I\\) .*" "run to call2a"
+
gdb_test "cont" ".* callcb \\(d1=3 \\+ 4 \\* I, d2=3 \\+ 4 \\* I, d3=3 \\+ 4 \\* I\\) .*" "continue to callcb"
gdb_test "cont" ".* callcc \\(ld1=5 \\+ 6 \\* I, ld2=5 \\+ 6 \\* I, ld3=5 \\+ 6 \\* I\\) .*" "continue to callcc"
gdb_test "cont" ".* callcd \\(fc1=1 \\+ 2 \\* I, dc1=3 \\+ 4 \\* I, ldc1=5 \\+ 6 \\* I\\) .*" "continue to callcd"
@@ -282,10 +271,8 @@ proc complex_integral_args {} {
# Run; should stop at call1a and print actual arguments.
gdb_run_cmd
- gdb_expect {
- -re ".* callc1a \\(c=97 'a', s=1, i=2, ui=7, l=3, fc1=1 \\+ 2 \\* I, dc1=3 \\+ 4 \\* I, ldc1=5 \\+ 6 \\* I\\) .*$gdb_prompt $" { pass "run to callc1a" }
- timeout { fail "(timeout) run to callc1a" ; gdb_suppress_tests; }
- }
+ gdb_test "" " callc1a \\(c=97 'a', s=1, i=2, ui=7, l=3, fc1=1 \\+ 2 \\* I, dc1=3 \\+ 4 \\* I, ldc1=5 \\+ 6 \\* I\\) .*" "run to callc1a"
+
gdb_test "cont" ".* callc1b \\(ldc1=5 \\+ 6 \\* I\\, c=97 'a', s=1, i=2, fc1=1 \\+ 2 \\* I, ui=7, l=3, dc1=3 \\+ 4 \\* I\\) .*" "continue to callc1b"
}
@@ -302,10 +289,8 @@ proc complex_float_integral_args {} {
# Run; should stop at call1a and print actual arguments.
gdb_run_cmd
- gdb_expect {
- -re ".* callc2a \\(c=97 'a', s=1, i=2, ui=7, l=3, f=4, d=5, fc1=1 \\+ 2 \\* I, dc1=3 \\+ 4 \\* I, ldc1=5 \\+ 6 \\* I\\) .*$gdb_prompt $" { pass "run to callc2a" }
- timeout { fail "(timeout) run to callc1a" ; gdb_suppress_tests; }
- }
+ gdb_test "" " callc2a \\(c=97 'a', s=1, i=2, ui=7, l=3, f=4, d=5, fc1=1 \\+ 2 \\* I, dc1=3 \\+ 4 \\* I, ldc1=5 \\+ 6 \\* I\\) .*" "run to callc2a"
+
gdb_test "cont" ".* callc2b \\(fc1=1 \\+ 2 \\* I, c=97 'a', s=1, i=2, ui=7, ldc1=5 \\+ 6 \\* I\\, l=3, f=4, d=5, dc1=3 \\+ 4 \\* I\\) .*" "continue to callc2b"
}
@@ -328,11 +313,7 @@ proc pointer_args {} {
# Try dereferencing the arguments.
gdb_run_cmd
- gdb_expect {
- -re ".* call3a \\(cp=$hex <c> \"a.*\", sp=$hex <s>, ip=$hex <i>, lp=$hex <l>\\) .*$gdb_prompt $" { pass "run to call3a" }
- -re "$gdb_prompt $" { fail "run to call3a" ; gdb_suppress_tests; }
- timeout { fail "(timeout) run to call3a" ; gdb_suppress_tests; }
- }
+ gdb_test "" " call3a \\(cp=$hex <c> \"a.*\", sp=$hex <s>, ip=$hex <i>, lp=$hex <l>\\) .*" "run to call3a"
gdb_test "print *cp" ".* = 97 'a'"
gdb_test "print *sp" ".* = 1"
@@ -384,13 +365,7 @@ proc structs_by_reference {} {
# Try dereferencing the arguments.
gdb_run_cmd
- gdb_expect {
- -re ".* call4a \\(stp=$hex <st>\\) .*$gdb_prompt $" {
- pass "run to call4a"
- }
- -re "$gdb_prompt $" { fail "run to call4a" ; gdb_suppress_tests; }
- timeout { fail "(timeout) run to call4a" ; gdb_suppress_tests; }
- }
+ gdb_test "" " call4a \\(stp=$hex <st>\\) .*" "run to call4a"
gdb_test "print *stp" ".* = \{s1 = 101, s2 = 102\}"
@@ -440,13 +415,7 @@ proc structs_by_value {} {
# Try dereferencing the arguments.
gdb_run_cmd
- gdb_expect {
- -re ".* call5a \\(st=\{s1 = 101, s2 = 102\}\\) .*$gdb_prompt $" {
- pass "run to call5a"
- }
- -re "$gdb_prompt $" { fail "run to call5a" ; gdb_suppress_tests; }
- timeout { fail "(timeout) run to call5a" ; gdb_suppress_tests; }
- }
+ gdb_test "" " call5a \\(st=\{s1 = 101, s2 = 102\}\\) .*" "run to call5a"
gdb_test "print st" ".* = \{s1 = 101, s2 = 102\}"
@@ -513,11 +482,7 @@ proc discard_and_shuffle {} {
# Print backtrace.
gdb_run_cmd
- gdb_expect {
- -re ".*Breakpoint $decimal, call6a .*$gdb_prompt $" { pass "run to call6a" }
- -re "$gdb_prompt $" { fail "run to call6a" ; gdb_suppress_tests; }
- timeout { fail "(timeout) run to call6a" ; gdb_suppress_tests; }
- }
+ gdb_test "" "Breakpoint $decimal, call6a .*" "run to call6a"
setup_xfail "rs6000-*-*"
@@ -743,13 +708,7 @@ proc shuffle_round_robin {} {
# Print backtrace.
gdb_run_cmd
- gdb_expect {
- -re ".*Breakpoint $decimal, call7a .*$gdb_prompt $" {
- pass "run to call7a"
- }
- -re "$gdb_prompt $" { fail "run to call7a" ; gdb_suppress_tests; }
- timeout { fail "(timeout) run to call7a" ; gdb_suppress_tests; }
- }
+ gdb_test "" "Breakpoint $decimal, call7a .*" "run to call7a"
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" "mips-sgi-irix5*" }
gdb_test_multiple "backtrace 100" "backtrace from call7a" {
@@ -939,11 +898,7 @@ proc recursive_structs_by_value {} {
# Run; should stop at hitbottom and print actual arguments.
# Print backtrace.
gdb_run_cmd
- gdb_expect {
- -re ".*Breakpoint $decimal, hitbottom .*$gdb_prompt $" { pass "run to hitbottom" }
- -re "$gdb_prompt $" { fail "run to hitbottom" ; gdb_suppress_tests; }
- timeout { fail "(timeout) run to hitbottom" ; gdb_suppress_tests; }
- }
+ gdb_test "" "Breakpoint $decimal, hitbottom .*" "run to hitbottom"
if ![istarget sparclet-*-*] {
gdb_test_sequence "backtrace 100" "recursive passing of structs by value" {