* gdb.base/funcargs.exp: Set print frame-arguments to "all".
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / call-ar-st.exp
index d7721c8df25beef1d80195203ffb570934d9a91c..a058f67a5dafa7676509077eb561cbfcb726a66f 100644 (file)
@@ -1,22 +1,18 @@
-#   Copyright 1998, 1999, 2000, 2001
+#   Copyright 1998, 1999, 2000, 2001, 2004, 2007, 2008, 2009
 #   Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+# the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
-
-# Please email any bugs, comments, and/or additions to this file to:
-# bug-gdb@prep.ai.mit.edu
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # This file was written by Elena Zannoni (ezannoni@cygnus.com)
 
@@ -38,7 +34,8 @@ if { [istarget "sparclet-*-*"] } {
 }
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-    gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+    untested "couldn't compile ${srcdir}/${subdir}/${srcfile}"
+    return -1
 }
 
 
@@ -49,13 +46,17 @@ if [get_compiler_info ${binfile}] {
     return -1;
 }
 
-# The a29k can't call functions, so don't even bother with this test.
+# Some targets can't call functions, so don't even bother with this
+# test.
 if [target_info exists gdb,cannot_call_functions] {
     setup_xfail "*-*-*" 2416
     fail "This target can not call functions"
     continue
 }
 
+set oldtimeout $timeout
+set timeout [expr "$timeout + 60"]
+
 # Set the current language to C.  This counts as a test.  If it
 # fails, then we skip the other tests.
 
@@ -85,8 +86,6 @@ proc set_lang_c {} {
     }
 }
 
-source ${binfile}.ci
-
 # Start with a fresh gdb.
 
 gdb_exit
@@ -103,9 +102,11 @@ if ![runto_main] then {
     continue
 }
 
+get_debug_format
+
 #go -until 1209
 gdb_test "tbreak 1209" \
-    "Breakpoint \[0-9\]+.*file.*$srcfile, line 1209.*" \
+    "Temporary breakpoint \[0-9\]+.*file.*$srcfile, line 1209.*" \
     "tbreakpoint line 1209"
 
 gdb_test continue \
@@ -121,19 +122,8 @@ if {![gdb_skip_float_test "print print_double_array(double_array)"] && \
        "\[ \t\r\n\]+array_d :"
        "\[ \t\r\n\]+========="
        "\[ \t\r\n\]+0.000000"
-       "\[ \t\r\n\]+23.456700  46.913400  70.370100  93.826800  117.283500  140.740200  164.196900  187.653600"
-       "\[ \t\r\n\]+211.110300  234.567000  258.023700  281.480400  304.937100  328.393800  351.850500  375.307200"
-       "\[ \t\r\n\]+398.763900  422.220600  445.677300  469.134000  492.590700  516.047400  539.504100  562.960800"
-       "\[ \t\r\n\]+586.417500  609.874200  633.330900  656.787600  680.244300  703.701000  727.157700  750.614400"
-       "\[ \t\r\n\]+774.071100  797.527800  820.984500  844.441200  867.897900  891.354600  914.811300  938.268000"
-       "\[ \t\r\n\]+961.724700  985.181400  1008.638100  1032.094800  1055.551500  1079.008200  1102.464900  1125.921600"
-       "\[ \t\r\n\]+1149.378300  1172.835000  1196.291700  1219.748400  1243.205100  1266.661800  1290.118500  1313.575200"
-       "\[ \t\r\n\]+1337.031900  1360.488600  1383.945300  1407.402000  1430.858700  1454.315400  1477.772100  1501.228800"
-       "\[ \t\r\n\]+1524.685500  1548.142200  1571.598900  1595.055600  1618.512300  1641.969000  1665.425700  1688.882400"
-       "\[ \t\r\n\]+1712.339100  1735.795800  1759.252500  1782.709200  1806.165900  1829.622600  1853.079300  1876.536000"
-       "\[ \t\r\n\]+1899.992700  1923.449400  1946.906100  1970.362800  1993.819500  2017.276200  2040.732900  2064.189600"
-       "\[ \t\r\n\]+2087.646300  2111.103000  2134.559700  2158.016400  2181.473100  2204.929800  2228.386500  2251.843200"
-       "\[ \t\r\n\]+2275.299900  2298.756600  2322.213300\[ \t\r\n\]+\[ \t\r\n\]+"
+       "\[ \t\r\n\]+23.456\[0-9\]*  46.913\[0-9\]*  70.370\[0-9\]*  93.826\[0-9\]*  117.283\[0-9\]*  140.740\[0-9\]*  164.196\[0-9\]*  187.653\[0-9\]"
+       "\[ \t\r\n\]+"
   }
 }
 
@@ -156,7 +146,7 @@ if ![gdb_skip_stdio_test "print_char_array(char_array)"] {
 
 #go -until 1216
 gdb_test "tbreak 1216" \
-"Breakpoint.*file.*$srcfile, line 1216.*" \
+"Temporary breakpoint.*file.*$srcfile, line 1216.*" \
 "tbreakpoint line 1216"
 
 if ![gdb_skip_stdio_test "continue to 1216"] {
@@ -190,7 +180,7 @@ if ![gdb_skip_stdio_test "continue to 1216"] {
 #set timeout $oldtimeout
 #go -until 1220
 gdb_test "tbreak 1220" \
-       "Breakpoint.* file .*$srcfile, line 1220.*" \
+       "Temporary breakpoint.* file .*$srcfile, line 1220.*" \
        "tbreakpoint line 1220"
 
 if {![gdb_skip_float_test "continuing to breakpoint 1220"] && \
@@ -201,19 +191,8 @@ if {![gdb_skip_float_test "continuing to breakpoint 1220"] && \
        "\[ \t\r\n\]+array_d :"
        "\[ \t\r\n\]+========="
        "\[ \t\r\n\]+0.000000"
-       "\[ \t\r\n\]+23.456700  46.913400  70.370100  93.826800  117.283500  140.740200  164.196900  187.653600"
-       "\[ \t\r\n\]+211.110300  234.567000  258.023700  281.480400  304.937100  328.393800  351.850500  375.307200"
-       "\[ \t\r\n\]+398.763900  422.220600  445.677300  469.134000  492.590700  516.047400  539.504100  562.960800"
-       "\[ \t\r\n\]+586.417500  609.874200  633.330900  656.787600  680.244300  703.701000  727.157700  750.614400"
-       "\[ \t\r\n\]+774.071100  797.527800  820.984500  844.441200  867.897900  891.354600  914.811300  938.268000"
-       "\[ \t\r\n\]+961.724700  985.181400  1008.638100  1032.094800  1055.551500  1079.008200  1102.464900  1125.921600"
-       "\[ \t\r\n\]+1149.378300  1172.835000  1196.291700  1219.748400  1243.205100  1266.661800  1290.118500  1313.575200"
-       "\[ \t\r\n\]+1337.031900  1360.488600  1383.945300  1407.402000  1430.858700  1454.315400  1477.772100  1501.228800"
-       "\[ \t\r\n\]+1524.685500  1548.142200  1571.598900  1595.055600  1618.512300  1641.969000  1665.425700  1688.882400"
-       "\[ \t\r\n\]+1712.339100  1735.795800  1759.252500  1782.709200  1806.165900  1829.622600  1853.079300  1876.536000"
-       "\[ \t\r\n\]+1899.992700  1923.449400  1946.906100  1970.362800  1993.819500  2017.276200  2040.732900  2064.189600"
-       "\[ \t\r\n\]+2087.646300  2111.103000  2134.559700  2158.016400  2181.473100  2204.929800  2228.386500  2251.843200"
-       "\[ \t\r\n\]+2275.299900  2298.756600  2322.213300\[ \t\r\n\]+\[ \t\r\n\]+"
+       "\[ \t\r\n\]+23.456\[0-9\]*  46.913\[0-9\]*  70.370\[0-9\]*  93.826\[0-9\]*  117.283\[0-9\]*  140.740\[0-9\]*  164.196\[0-9\]*  187.653\[0-9\]*"
+       "\[ \t\r\n\]+"
        ".*array_f :"
        ".*student id :\[\t \]+.*YELLOW"
        ".*array_i :"
@@ -258,25 +237,14 @@ if {![gdb_skip_float_test "print print_double_array(array_d)"] && \
        "array_d :"
        "\[ \t\r\n\]+========="
        "\[ \t\r\n\]+\[ \t\r\n\]+0.000000"
-       "\[ \t\r\n\]+23.456700  46.913400  70.370100  93.826800  117.283500  140.740200  164.196900  187.653600"
-       "\[ \t\r\n\]+211.110300  234.567000  258.023700  281.480400  304.937100  328.393800  351.850500  375.307200"
-       "\[ \t\r\n\]+398.763900  422.220600  445.677300  469.134000  492.590700  516.047400  539.504100  562.960800"
-       "\[ \t\r\n\]+586.417500  609.874200  633.330900  656.787600  680.244300  703.701000  727.157700  750.614400"
-       "\[ \t\r\n\]+774.071100  797.527800  820.984500  844.441200  867.897900  891.354600  914.811300  938.268000"
-       "\[ \t\r\n\]+961.724700  985.181400  1008.638100  1032.094800  1055.551500  1079.008200  1102.464900  1125.921600"
-       "\[ \t\r\n\]+1149.378300  1172.835000  1196.291700  1219.748400  1243.205100  1266.661800  1290.118500  1313.575200"
-       "\[ \t\r\n\]+1337.031900  1360.488600  1383.945300  1407.402000  1430.858700  1454.315400  1477.772100  1501.228800"
-       "\[ \t\r\n\]+1524.685500  1548.142200  1571.598900  1595.055600  1618.512300  1641.969000  1665.425700  1688.882400"
-       "\[ \t\r\n\]+1712.339100  1735.795800  1759.252500  1782.709200  1806.165900  1829.622600  1853.079300  1876.536000"
-       "\[ \t\r\n\]+1899.992700  1923.449400  1946.906100  1970.362800  1993.819500  2017.276200  2040.732900  2064.189600"
-       "\[ \t\r\n\]+2087.646300  2111.103000  2134.559700  2158.016400  2181.473100  2204.929800  2228.386500  2251.843200"
-       "\[ \t\r\n\]+2275.299900  2298.756600  2322.213300\[ \t\r\n\]+\[ \t\r\n\]+"
+       "\[ \t\r\n\]+23.456\[0-9\]*  46.913\[0-9\]*  70.370\[0-9\]*  93.826\[0-9\]*  117.283\[0-9\]*  140.740\[0-9\]*  164.196\[0-9\]*  187.653\[0-9\]*"
+       "\[ \t\r\n\]+"
     }
 }
 
 #go -until 1236
 gdb_test "tbreak 1236" \
-"Breakpoint.* file .*$srcfile, line 1236.*" \
+"Temporary breakpoint.* file .*$srcfile, line 1236.*" \
 "tbreakpoint line 1236"
 
 if {![gdb_skip_float_test "continuing to 1236"] && \
@@ -288,19 +256,8 @@ if {![gdb_skip_float_test "continuing to 1236"] && \
        "\[ \t\r\n\]+array_d :"
        "\[ \t\r\n\]+========="
        "\[ \t\r\n\]+0.000000"
-       "\[ \t\r\n\]+23.456700  46.913400  70.370100  93.826800  117.283500  140.740200  164.196900  187.653600"
-       "\[ \t\r\n\]+211.110300  234.567000  258.023700  281.480400  304.937100  328.393800  351.850500  375.307200"
-       "\[ \t\r\n\]+398.763900  422.220600  445.677300  469.134000  492.590700  516.047400  539.504100  562.960800"
-       "\[ \t\r\n\]+586.417500  609.874200  633.330900  656.787600  680.244300  703.701000  727.157700  750.614400"
-       "\[ \t\r\n\]+774.071100  797.527800  820.984500  844.441200  867.897900  891.354600  914.811300  938.268000"
-       "\[ \t\r\n\]+961.724700  985.181400  1008.638100  1032.094800  1055.551500  1079.008200  1102.464900  1125.921600"
-       "\[ \t\r\n\]+1149.378300  1172.835000  1196.291700  1219.748400  1243.205100  1266.661800  1290.118500  1313.575200"
-       "\[ \t\r\n\]+1337.031900  1360.488600  1383.945300  1407.402000  1430.858700  1454.315400  1477.772100  1501.228800"
-       "\[ \t\r\n\]+1524.685500  1548.142200  1571.598900  1595.055600  1618.512300  1641.969000  1665.425700  1688.882400"
-       "\[ \t\r\n\]+1712.339100  1735.795800  1759.252500  1782.709200  1806.165900  1829.622600  1853.079300  1876.536000"
-       "\[ \t\r\n\]+1899.992700  1923.449400  1946.906100  1970.362800  1993.819500  2017.276200  2040.732900  2064.189600"
-       "\[ \t\r\n\]+2087.646300  2111.103000  2134.559700  2158.016400  2181.473100  2204.929800  2228.386500  2251.843200"
-       "\[ \t\r\n\]+2275.299900  2298.756600  2322.213300.*HELLO WORLD.*main \\(\\) at .*call-ar-st.c:1236.*printf\\(.BYE BYE FOR NOW.n.\\)."
+       "\[ \t\r\n\]+23.456\[0-9\]*  46.913\[0-9\]*  70.370\[0-9\]*  93.826\[0-9\]*  117.283\[0-9\]*  140.740\[0-9\]*  164.196\[0-9\]*  187.653\[0-9\]*"
+       "\[ \t\r\n\]+.*HELLO WORLD.*main \\(\\) at .*call-ar-st.c:1236.*printf\\(.BYE BYE FOR NOW.n.\\)."
     }
 } else {
     gdb_test "continue" "" ""
@@ -351,7 +308,7 @@ if ![gdb_skip_stdio_test "print print_array_rep(...)"] {
 
 #go -until 1241
 gdb_test "tbreak 1241" \
-    "Breakpoint..* file .*$srcfile, line 1241.*" \
+    "Temporary breakpoint..* file .*$srcfile, line 1241.*" \
     "tbreakpoint line 1241"
 
 send_gdb  "continue\n"
@@ -375,6 +332,7 @@ gdb_expect {
 gdb_test "break sum_array_print" \
        ".*Breakpoint ${decimal}: file .*call-ar-st.c, line.*" \
        "set breakpoint in sum_array_print"
+gdb_test "set print frame-arguments all" ""
 gdb_test "continue" \
        ".*Breakpoint ${decimal}, sum_array_print \\(seed=10, linked_list1=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .4, 6, 8, 10, 12, 14, 16, 18, 20, 22., head = 0., linked_list2=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .8, 10, 12, 14, 16, 18, 20, 22, 24, 26., head = 0., linked_list3=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .10, 12, 14, 16, 18, 20, 22, 24, 26, 28., head = 0., linked_list4=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .20, 22, 24, 26, 28, 30, 32, 34, 36, 38., head = 0.\\) at .*call-ar-st.c:1105\[ \t\n\r\]+1105.*printf\\(.Sum of 4 arrays, by element \\(add in seed as well\\).*\\);.*" \
        "check args of sum_array_print"
@@ -395,7 +353,7 @@ gdb_test "continue" \
 
 #go -until 1281
 gdb_test "tbreak 1281" \
-    "Breakpoint.* file .*call-ar-st.c, line 1281.*" \
+    "Temporary breakpoint.* file .*call-ar-st.c, line 1281.*" \
     "tbreakpoint line 1281"
 
 if ![gdb_skip_stdio_test "continuing to 1281"] {
@@ -473,17 +431,17 @@ if {![gdb_skip_float_test "print print_ten_doubles(...)"] && \
     ![gdb_skip_stdio_test "print print_ten_doubles(...)"]} {
     send_gdb "print print_ten_doubles(123.456, 123.456, -0.12, -1.23, 343434.8, 89.098, 3.14, -5678.12345, -0.11111111, 216.97065)\n"
     gdb_expect_list "print print_ten_doubles" ".*$gdb_prompt $" {
-       "\[\t\r\n \]+Two Doubles : 123.456000.*123.456000"
-       "\[\t\r\n \]+Two Doubles : -0.120000.*-1.230000"
-       "\[\t\r\n \]+Two Doubles : 343434.800000.*89.098000"
-       "\[\t\r\n \]+Two Doubles : 3.140000.*-5678.123450"
-       "\[\t\r\n \]+Two Doubles : -0.111111.*216.970650"
+       "\[\t\r\n \]+Two Doubles : 123.45\[0-9\]*.*123.45\[0-9\]*"
+       "\[\t\r\n \]+Two Doubles : -0.1200\[0-9\]*.*-1.2300\[0-9\]*"
+       "\[\t\r\n \]+Two Doubles : 343434.\[0-9\]*.*89.09\[0-9\]*"
+       "\[\t\r\n \]+Two Doubles : 3.1400\[0-9\]*.*-5678.123\[0-9\]*"
+       "\[\t\r\n \]+Two Doubles : -0.1111\[0-9\]*.*216.97\[0-9\]*"
     }
 }
 
 #go -until 1286
 gdb_test "tbreak 1286" \
-    "Breakpoint .* file .*call-ar-st.c, line 1286.*" \
+    "Temporary breakpoint .* file .*call-ar-st.c, line 1286.*" \
     "tbreakpoint line 1286"
 
 gdb_test continue "Continuing\\..*main \\(.*\\) at.*call-ar-st.c:1286\[\t\r\n \]+1286.*print_long_arg_list \\( a, b, c, d, e, f, .struct1, .struct2, .struct3, .struct4,.*" "continue to 1286"
@@ -511,7 +469,7 @@ if { [istarget "hppa*-*-hpux*"] } {
     # We can't just assume that a "step" will get us into
     # print_long_arg_list here,either.
     gdb_test "tbreak print_long_arg_list" \
-       "Breakpoint .* file .*call-ar-st.c, line .*" \
+       "Temporary breakpoint .* file .*call-ar-st.c, line .*" \
        "tbreak in print_long_arg_list after stepping into memcpy"
     # The short match case below handles cases where a buffer
     # overflows or something, and expect can't deal with the full
@@ -542,11 +500,14 @@ set ws "\[\n\r\t \]+"
 
 if {![gdb_skip_float_test "print_small_structs from print_long_arg_list"] && \
     ![gdb_skip_stdio_test "print_small_structs from print_long_arg_list"] } {
-    # On Solaris, some of the args are passed by ref, others by value,
-    # and GDB gets confused and says "Invalid cast" because it thinks
-    # it has to cast the structure into a pointer to structure.  A real
-    # GDB bug, probably for all Sparc configs, but obscure. -sts 1999-08-17.
-    setup_xfail "sparc*-*-solaris*"
+
+    # On 32-bit SPARC, some of the args are passed by ref, others by
+    # value, and GDB gets confused and says "Invalid cast" because it
+    # thinks it has to cast the structure into a pointer to structure.
+    if { [test_debug_format "stabs"] } then {
+       setup_kfail "gdb/1539" "sparc-*-*"
+    }
+
     send_gdb "print print_small_structs(struct1, struct2, struct3, struct4, flags, flags_combo, three_char, five_char, int_char_combo, d1, d2, d3, f1, f2, f3)\n"
     gdb_expect_list "print print_small_structs from print_long_arg_list" ".*$gdb_prompt $" {
        "\[\t\r\n \]+alpha"
@@ -588,7 +549,7 @@ if {![gdb_skip_float_test "print_small_structs from print_long_arg_list"] && \
 
 #go -until 1300
 gdb_test "tbreak 1300" \
-    "Breakpoint.* file .*call-ar-st.c, line 1300.*" \
+    "Temporary breakpoint.* file .*call-ar-st.c, line 1300.*" \
     "tbreakpoint line 1300"
 
 if ![gdb_skip_stdio_test "continuing to 1300"] {
@@ -627,7 +588,7 @@ if ![gdb_skip_stdio_test "continuing to 1300"] {
 
 #go -until 1305
 gdb_test "tbreak 1305" \
-    "Breakpoint.* file .*call-ar-st.c, line 1305.*" \
+    "Temporary breakpoint.* file .*call-ar-st.c, line 1305.*" \
     "tbreakpoint line 1305"
 
 gdb_test continue "Continuing\\..*main \\(\\) at .*call-ar-st.c:1305\[\r\n\t \]+1305.*init_int_char_combo\\(int_char_combo, 13, .!.\\);" \
@@ -687,7 +648,7 @@ if {![gdb_skip_float_test "print print_long_arg_list"] && \
 
 #go -until 1311
 gdb_test "tbreak 1311" \
-    "Breakpoint.* file .*call-ar-st.c, line 1311.*" \
+    "Temporary breakpoint.* file .*call-ar-st.c, line 1311.*" \
     "tbreakpoint line 1311"
 
 gdb_test continue "Continuing\\..*main \\(\\) at .*call-ar-st.c:1311\[ \t\n\r\]+1311.*compute_with_small_structs\\(35\\);" \
@@ -740,5 +701,6 @@ if ![gdb_skip_stdio_test "print print_one_large_struct(...)"] {
     }
 }
 
+set timeout $oldtimeout
 return
 
This page took 0.029342 seconds and 4 git commands to generate.