Detect broken ptrace in gdb_skip_float_test
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / funcargs.exp
index 0b5534a3542f03622502b29069b9f5222f59a00f..fe04b2f34a2a806373d484ddd6ab50444173b5f3 100644 (file)
@@ -1,5 +1,4 @@
-# Copyright 1992, 1994-2000, 2002-2004, 2007-2012 Free Software
-# Foundation, Inc.
+# Copyright 1992-2016 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
 # This file was written by Fred Fish. (fnf@cygnus.com)
 
 
-set testfile "funcargs"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
 
 set compile_flags {debug nowarnings quiet}
 if [support_complex_tests] {
     lappend compile_flags "additional_flags=-DTEST_COMPLEX"
 }
 
-if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $compile_flags] != "" } {
-     untested funcargs.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}] {
-    return -1;
+if [get_compiler_info] {
+    return -1
+}
+
+set skip_float_test [gdb_skip_float_test]
+
+if {[prepare_for_testing $testfile.exp $testfile $srcfile $compile_flags]} {
+    untested $testfile.exp
+    return -1
 }
 
 #
@@ -57,13 +56,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.
@@ -74,24 +67,24 @@ proc integral_args {} {
 
     # Continue; should stop at call0b and print actual arguments.
     if [gdb_test "cont" ".* call0b \\(s=1, i=2, l=3, c=97 'a'\\) .*" "continue to call0b"] {
-       gdb_suppress_tests;
+       gdb_suppress_tests
     }
 
     # Continue; should stop at call0c and print actual arguments.
     if [gdb_test "cont" ".* call0c \\(i=2, l=3, c=97 'a', s=1\\) .*" "continue to call0c"] {
-       gdb_suppress_tests;
+       gdb_suppress_tests
     }
 
     # Continue; should stop at call0d and print actual arguments.
     if [gdb_test "cont" ".* call0d \\(l=3, c=97 'a', s=1, i=2\\) .*" "continue to call0d";] {
-       gdb_suppress_tests;
+       gdb_suppress_tests
     }
 
     # Continue; should stop at call0e and print actual arguments.
     if [gdb_test "cont" ".* call0e \\(c1=97 'a', l=3, c2=97 'a', i=2, c3=97 'a', s=1, c4=97 'a', c5=97 'a'\\) .*" "continue to call0e" ] {
-       gdb_suppress_tests;
+       gdb_suppress_tests
     }
-    gdb_stop_suppressing_tests;
+    gdb_stop_suppressing_tests
 }
 
 #
@@ -105,22 +98,16 @@ proc unsigned_integral_args {} {
 
     delete_breakpoints
 
-    gdb_breakpoint call1a;
-    gdb_breakpoint call1b;
-    gdb_breakpoint call1c;
-    gdb_breakpoint call1d;
-    gdb_breakpoint call1e;
+    gdb_breakpoint call1a
+    gdb_breakpoint call1b
+    gdb_breakpoint call1c
+    gdb_breakpoint call1d
+    gdb_breakpoint call1e
 
     # 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.
@@ -131,24 +118,24 @@ proc unsigned_integral_args {} {
     
     # Continue; should stop at call1b and print actual arguments.
     if [gdb_test "cont" ".* call1b \\(us=6, ui=7, ul=8, uc=98 'b'\\) .*" "continue to call1b"] {
-       gdb_suppress_tests
+       gdb_suppress_tests
     }
 
     # Continue; should stop at call1c and print actual arguments.
     if [gdb_test "cont" ".* call1c \\(ui=7, ul=8, uc=98 'b', us=6\\) .*" "continue to call1c"] {
-       gdb_suppress_tests
+       gdb_suppress_tests
     }
 
     # Continue; should stop at call1d and print actual arguments.
     if [gdb_test "cont" ".* call1d \\(ul=8, uc=98 'b', us=6, ui=7\\) .*" "continue to call1d"] {
-       gdb_suppress_tests;
+       gdb_suppress_tests
     }
 
     # Continue; should stop at call1e and print actual arguments.
     if [gdb_test "cont" ".* call1e \\(uc1=98 'b', ul=8, uc2=98 'b', ui=7, uc3=98 'b', us=6, uc4=98 'b', uc5=98 'b'\\) .*" "continue to call1e"] {
-       gdb_suppress_tests;
+       gdb_suppress_tests
     }
-    gdb_stop_suppressing_tests;
+    gdb_stop_suppressing_tests
 }
 
 #
@@ -173,13 +160,16 @@ proc float_and_integral_args {} {
 
     # Run; should stop at call2a and print actual arguments.
 
-    if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" "mips-sgi-irix5*" }
+    if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
     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
@@ -193,40 +183,39 @@ proc float_and_integral_args {} {
     gdb_test "print d2" ".* = 5" "print d2 after run to call2a"
 
     setup_xfail "rs6000-*-*"
-    if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix*" }
     # Continue; should stop at call2b and print actual arguments.
     if [gdb_test "cont" ".* call2b \\(f1=4, s=1, d1=5, i=2, f2=4, l=3, d2=5, c=97 'a'\\) .*" "continue to call2b"] {
-       gdb_suppress_tests;
+       gdb_suppress_tests
     }
 
     # Continue; should stop at call2c and print actual arguments.
     if [gdb_test "cont" ".* call2c \\(s=1, d1=5, i=2, f2=4, l=3, d2=5, c=97 'a', f1=4\\) .*" "continue to call2c"] {
-       gdb_suppress_tests;
+       gdb_suppress_tests
     }
 
     # Continue; should stop at call2d and print actual arguments.
     if [gdb_test "cont" ".* call2d \\(d1=5, i=2, f2=4, l=3, d2=5, c=97 'a', f1=4, s=1\\) .*" "continue to call2d"] {
-       gdb_suppress_tests;
+       gdb_suppress_tests
     }
 
     # Continue; should stop at call2e and print actual arguments.
     if [gdb_test "cont" ".* call2e \\(i=2, f2=4, l=3, d2=5, c=97 'a', f1=4, s=1, d1=5\\) .*" "continue to call2e"] {
-       gdb_suppress_tests;
+       gdb_suppress_tests
     }
 
     # Continue; should stop at call2f and print actual arguments.
     if [gdb_test "cont" ".* call2f \\(f2=4, l=3, d2=5, c=97 'a', f1=4, s=1, d1=5, i=2\\) .*" "continue to call2f"] {
-       gdb_suppress_tests;
+       gdb_suppress_tests
     }
 
     # Continue; should stop at call2g and print actual arguments.
     if [gdb_test "cont" ".* call2g \\(l=3, d2=5, c=97 'a', f1=4, s=1, d1=5, i=2, f2=4\\) .*" "continue to call2g"] {
-       gdb_suppress_tests;
+       gdb_suppress_tests
     }
 
     # Continue; should stop at call2h and print actual arguments.
     if [gdb_test "cont" ".* call2h \\(d2=5, c=97 'a', f1=4, s=1, d1=5, i=2, f2=4, l=3\\) .*" "continue to call2h"] {
-       gdb_suppress_tests;
+       gdb_suppress_tests
     }
 
     # monitor only allows 8 breakpoints; w89k board allows 10, so
@@ -236,9 +225,9 @@ proc float_and_integral_args {} {
 
     # Continue; should stop at call2i and print actual arguments.
     if [gdb_test "cont" ".* call2i \\(c1=97 'a', f1=4, c2=97 'a', c3=97 'a', d1=5, c4=97 'a', c5=97 'a', c6=97 'a', f2=4, s=1, c7=97 'a', d2=5\\) .*" "continue to call2i"] {
-       gdb_suppress_tests;
+       gdb_suppress_tests
     }
-    gdb_stop_suppressing_tests;
+    gdb_stop_suppressing_tests
 }
 
 
@@ -260,12 +249,10 @@ 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 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"
     gdb_test "cont" ".* callce \\(dc1=3 \\+ 4 \\* I, ldc1=5 \\+ 6 \\* I, fc1=1 \\+ 2 \\* I\\) .*" "continue to callce"
     gdb_test "cont" ".* callcf \\(ldc1=5 \\+ 6 \\* I, fc1=1 \\+ 2 \\* I, dc1=3 \\+ 4 \\* I\\) .*" "continue to callcf"
@@ -285,10 +272,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"
 }
 
@@ -305,10 +290,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"
 }
 
@@ -331,11 +314,7 @@ proc pointer_args {} {
     # Try dereferencing the arguments.
 
     gdb_run_cmd
-    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" ; 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"
@@ -344,8 +323,8 @@ proc pointer_args {} {
 
     # Continue; should stop at call3b and print actual arguments.
     # Try dereferencing the arguments.
-    if [gdb_test "cont" ".* call3b \\(ucp=$hex \"b.*\", usp=$hex, uip=$hex, ulp=$hex\\) .*" "continue to call3b"] {
-       gdb_suppress_tests;
+    if [gdb_test "cont" ".* call3b \\(ucp=$hex <uc> \"b.*\", usp=$hex <us>, uip=$hex <ui>, ulp=$hex <ul>\\) .*" "continue to call3b"] {
+       gdb_suppress_tests
     }
 
     gdb_test "print *ucp" ".* = 98 'b'"
@@ -355,15 +334,15 @@ proc pointer_args {} {
 
     # Continue; should stop at call3c and print actual arguments.
     # Try dereferencing the arguments.
-    if [gdb_test "cont" ".* call3c \\(fp=$hex, dp=$hex\\) .*" "continue to call3c"] {
-       gdb_suppress_tests;
+    if [gdb_test "cont" ".* call3c \\(fp=$hex <f>, dp=$hex <d>\\) .*" "continue to call3c"] {
+       gdb_suppress_tests
     }
 
     gdb_test "print *fp" ".* = 4"
     gdb_test "print *dp" ".* = 5"
 
 #    pass "locate actual args, pointer types"
-    gdb_stop_suppressing_tests;
+    gdb_stop_suppressing_tests
 }
 
 #
@@ -387,19 +366,13 @@ proc structs_by_reference {} {
     # Try dereferencing the arguments.
 
     gdb_run_cmd
-    gdb_expect {
-        -re ".* call4a \\(stp=$hex\\) .*$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\}"
 
     # Continue; should stop at call4b and print actual arguments.
 
-    gdb_test "cont" ".* call4b \\(unp=$hex\\) .*" "continue to call4b"
+    gdb_test "cont" ".* call4b \\(unp=$hex <un>\\) .*" "continue to call4b"
 
     # Try dereferencing the arguments.
     if { $target_sizeof_long == $target_sizeof_int } {
@@ -419,7 +392,7 @@ proc structs_by_reference {} {
     }
 
     pass "locate actual args, structs/unions passed by reference"
-    gdb_stop_suppressing_tests;
+    gdb_stop_suppressing_tests
 }
 
 #
@@ -443,13 +416,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\}"
 
@@ -487,7 +454,7 @@ proc structs_by_value {} {
        fail "print un (unknown case)"
     }
 
-    gdb_stop_suppressing_tests;
+    gdb_stop_suppressing_tests
 }
 
 #
@@ -516,18 +483,10 @@ 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-*-*"
 
-    if {!$gcc_compiled} {
-       setup_xfail "mips-sgi-irix5*"
-    }
-
     gdb_test_multiple "backtrace 100" "backtrace from call6a" {
        -re " call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .* main \\(.*\\) .*$gdb_prompt $" {
            pass "backtrace from call6a"
@@ -547,7 +506,7 @@ proc discard_and_shuffle {} {
        "\[\r\n\]#1 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
        "\[\r\n\]#2 .* main \\(.*\\) at "
     } ] {
-       gdb_suppress_tests;
+       gdb_suppress_tests
     }
 
     # Continue; should stop at call6c and print actual arguments.
@@ -561,7 +520,7 @@ proc discard_and_shuffle {} {
        "\[\r\n\]#2 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
        "\[\r\n\]#3 .* main \\(.*\\) at "
     } ] {
-       gdb_suppress_tests;
+       gdb_suppress_tests
     }
     # Continue; should stop at call6d and print actual arguments.
     # Print backtrace.
@@ -575,7 +534,7 @@ proc discard_and_shuffle {} {
        "\[\r\n\]#3 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
        "\[\r\n\]#4 .* main \\(.*\\) at "
     } ] {
-       gdb_suppress_tests;
+       gdb_suppress_tests
     }
 
     # Continue; should stop at call6e and print actual arguments.
@@ -591,7 +550,7 @@ proc discard_and_shuffle {} {
        "\[\r\n\]#4 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
        "\[\r\n\]#5 .* main \\(.*\\) at "
     } ] {
-       gdb_suppress_tests;
+       gdb_suppress_tests
     }
 
     # Continue; should stop at call6f and print actual arguments.
@@ -608,7 +567,7 @@ proc discard_and_shuffle {} {
        "\[\r\n\]#5 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
        "\[\r\n\]#6 .* main \\(.*\\) at "
     } ] {
-       gdb_suppress_tests;
+       gdb_suppress_tests
     }
 
     # Continue; should stop at call6g and print actual arguments.
@@ -626,7 +585,7 @@ proc discard_and_shuffle {} {
        "\[\r\n\]#6 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
        "\[\r\n\]#7 .* main \\(.*\\) at "
     } ] {
-       gdb_suppress_tests;
+       gdb_suppress_tests
     }
 
     # Continue; should stop at call6h and print actual arguments.
@@ -645,7 +604,7 @@ proc discard_and_shuffle {} {
        "\[\r\n\]#7 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
        "\[\r\n\]#8 .* main \\(.*\\) at "
     } ] {
-       gdb_suppress_tests;
+       gdb_suppress_tests
     }
 
     # monitor only allows 8 breakpoints; w89k board allows 10, so
@@ -672,7 +631,7 @@ proc discard_and_shuffle {} {
        "\[\r\n\]#8 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
        "\[\r\n\]#9 .* main \\(.*\\) at "
     } ] {
-       gdb_suppress_tests;
+       gdb_suppress_tests
     }
 
     # Continue; should stop at call6j and print actual arguments.
@@ -693,7 +652,7 @@ proc discard_and_shuffle {} {
        "\[\r\n\]#9 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
        "\[\r\n\]#10 .* main \\(.*\\) at "
     } ] {
-       gdb_suppress_tests;
+       gdb_suppress_tests
     }
 
     # Continue; should stop at call6k and print actual arguments.
@@ -714,9 +673,9 @@ proc discard_and_shuffle {} {
        "\[\r\n\]#10 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
        "\[\r\n\]#11 .* main \\(.*\\) at "
     } ] {
-       gdb_suppress_tests;
+       gdb_suppress_tests
     }
-    gdb_stop_suppressing_tests;
+    gdb_stop_suppressing_tests
 }
 
 
@@ -746,15 +705,9 @@ 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*" }
+    if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
     gdb_test_multiple "backtrace 100" "backtrace from call7a" {
        -re " call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) .* main \\(.*\\) .*$gdb_prompt $" {
            pass "backtrace from call7a"
@@ -907,7 +860,6 @@ proc shuffle_round_robin {} {
 
     gdb_continue call7k
 
-    if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix*" }
     gdb_test_sequence "backtrace 100" "backtrace from call7k" {
        "\[\r\n\]#0 .* call7k \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) "
        "\[\r\n\]#1 .* call7j \\(ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8\\) "
@@ -922,7 +874,7 @@ proc shuffle_round_robin {} {
        "\[\r\n\]#10 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) "
        "\[\r\n\]#11 .* main \\(.*\\) at "
     }
-    gdb_stop_suppressing_tests;
+    gdb_stop_suppressing_tests
 }
 
 #
@@ -942,42 +894,19 @@ 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; }
-    }
-
-    if ![istarget sparclet-*-*] {
-       gdb_test_sequence "backtrace 100" "recursive passing of structs by value" {
-           "\[\r\n\]#0 .* hitbottom \\(\\) "
-           "\[\r\n\]#1 .* recurse \\(a=\{s = 0, i = 0, l = 0\}, depth=0\\) "
-           "\[\r\n\]#2 .* recurse \\(a=\{s = 1, i = 1, l = 1\}, depth=1\\) "
-           "\[\r\n\]#3 .* recurse \\(a=\{s = 2, i = 2, l = 2\}, depth=2\\) "
-           "\[\r\n\]#4 .* recurse \\(a=\{s = 3, i = 3, l = 3\}, depth=3\\) "
-           "\[\r\n\]#5 .* recurse \\(a=\{s = 4, i = 4, l = 4\}, depth=4\\) "
-           "\[\r\n\]#6 .* test_struct_args \\(\\) "
-           "\[\r\n\]#7 .* main \\(.*\\) at "
-       }
-    } else {
-       fail "recursive passing of structs by value (sparclet)"
-    }
-    gdb_stop_suppressing_tests;
-}
-
-proc funcargs_reload { } {
-    global objdir
-    global subdir
-    global binfile
-    global srcdir
-
-    if [istarget "mips-idt-*"] {
-       # Restart because IDT/SIM runs out of file descriptors.
-       gdb_exit
-       gdb_start
-       gdb_reinitialize_dir $srcdir/$subdir
-       gdb_load ${binfile}
+    gdb_test "" "Breakpoint $decimal, hitbottom .*" "run to hitbottom"
+
+    gdb_test_sequence "backtrace 100" "recursive passing of structs by value" {
+       "\[\r\n\]#0 .* hitbottom \\(\\) "
+       "\[\r\n\]#1 .* recurse \\(a=\{s = 0, i = 0, l = 0\}, depth=0\\) "
+       "\[\r\n\]#2 .* recurse \\(a=\{s = 1, i = 1, l = 1\}, depth=1\\) "
+       "\[\r\n\]#3 .* recurse \\(a=\{s = 2, i = 2, l = 2\}, depth=2\\) "
+       "\[\r\n\]#4 .* recurse \\(a=\{s = 3, i = 3, l = 3\}, depth=3\\) "
+       "\[\r\n\]#5 .* recurse \\(a=\{s = 4, i = 4, l = 4\}, depth=4\\) "
+       "\[\r\n\]#6 .* test_struct_args \\(\\) "
+       "\[\r\n\]#7 .* main \\(.*\\) at "
     }
+    gdb_stop_suppressing_tests
 }
 
 #
@@ -1013,7 +942,7 @@ proc localvars_after_alloca { } {
     gdb_test "print l" " = 3" "print l in localvars_after_alloca"
 
     gdb_test "backtrace 8" "#0.*localvars_after_alloca \\(c=97 'a', s=1, i=2, l=3\\).*#1.*main.*" "backtrace after alloca"
-    gdb_stop_suppressing_tests;
+    gdb_stop_suppressing_tests
 }
 
 proc call_after_alloca { } {
@@ -1036,7 +965,7 @@ proc call_after_alloca { } {
 
     if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
     gdb_test "backtrace 8" "#0.*call_after_alloca_subr \\(c=97 'a', s=1, i=2, l=3, uc=98 'b', us=11, ui=12, ul=13\\).*#1.*call_after_alloca \\(c=97 'a', s=1, i=2, l=3\\).*#2.*main.*" "backtrace from call_after_alloca_subr"
-    gdb_stop_suppressing_tests;
+    gdb_stop_suppressing_tests
 }
 
 #
@@ -1087,9 +1016,9 @@ proc localvars_in_indirect_call { } {
 
     gdb_test_multiple "finish" "finish from indirectly called function" {
        -re "\\(\\*pointer_to_call0a\\) \\(c, s, i, l\\);.*First.*$gdb_prompt $" {
-           #On hppa2.0w-hp-hpux11.00, gdb finishes at one line earlier than 
-           #hppa1.1-hp-hpux11.00. Therefore, an extra "step" is necessary 
-           #to continue the test.
+           # If the branch instruction is not the last instruction in the
+           # function call line, we'll stop at that line, and need an extra
+           # "step" to continue the test.
            send_gdb "step\n"
            exp_continue
        }
@@ -1098,18 +1027,18 @@ proc localvars_in_indirect_call { } {
        }
        -re ".*$gdb_prompt $" {
            fail "finish from indirectly called function"
-           gdb_suppress_tests;
+           gdb_suppress_tests
        }
        default { 
            fail "finish from indirectly called function"
-           gdb_suppress_tests
+           gdb_suppress_tests
        }
     }
 
     if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
     gdb_test "step" "call0a \\(c=97 'a', s=1, i=2, l=3\\).*" \
        "stepping into indirectly called function"
-    gdb_stop_suppressing_tests;
+    gdb_stop_suppressing_tests
 }
 
 #
@@ -1172,16 +1101,9 @@ proc test_stepping_over_trampolines { } {
            gdb_suppress_tests
        }
     }
-    gdb_stop_suppressing_tests;
+    gdb_stop_suppressing_tests
 }
 
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
 set prev_timeout $timeout
 if [istarget "mips*tx39-*"] {
     set timeout 300
@@ -1234,46 +1156,31 @@ gdb_test_multiple "show endian" "getting target endian" {
 gdb_test_no_output "set print frame-arguments all"
 
 integral_args
-funcargs_reload
 unsigned_integral_args
-funcargs_reload
-if {![target_info exists gdb,skip_float_tests]} {
+if {!$skip_float_test} {
   float_and_integral_args
 }
 
 # Test _Complex type here if supported.
 if [support_complex_tests] {
-    funcargs_reload
     complex_args
 
-    funcargs_reload
     complex_integral_args
 
-    if {![target_info exists gdb,skip_float_tests]} {
-       funcargs_reload
+    if {!$skip_float_test} {
        complex_float_integral_args
     }
 }
 
-funcargs_reload
 pointer_args
-funcargs_reload
 structs_by_reference
-funcargs_reload
 structs_by_value
-funcargs_reload
 discard_and_shuffle
-funcargs_reload
 shuffle_round_robin
-funcargs_reload
 recursive_structs_by_value
-funcargs_reload
 localvars_after_alloca
-funcargs_reload
 call_after_alloca
-funcargs_reload
 localvars_in_indirect_call
-funcargs_reload
 test_stepping_over_trampolines
 
 set timeout $prev_timeout
This page took 0.036538 seconds and 4 git commands to generate.