1 # Copyright (C) 1992, 1994, 1995, 1997 Free Software Foundation, Inc.
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 # Please email any bugs, comments, and/or additions to this file to:
18 # bug-gdb@prep.ai.mit.edu
20 # This file was written by Fred Fish. (fnf@cygnus.com)
29 set testfile "funcargs"
30 set srcfile ${testfile}.c
31 set binfile ${objdir}/${subdir}/${testfile}
32 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
33 gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
36 # Create and source the file that provides information about the compiler
37 # used to compile the test case.
38 if [get_compiler_info ${binfile}] {
43 # Locate actual args; integral types.
46 proc integral_args {} {
59 # Run; should stop at call0a and print actual arguments.
60 # The a29k fails all of these tests, perhaps because the prologue
62 setup_xfail "a29k-*-udi"
63 if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
66 -re ".* call0a \\(c=97 'a', s=1, i=2, l=3\\) .*$gdb_prompt $" {
69 -re "$gdb_prompt $" { fail "run to call0a" ; gdb_suppress_tests }
70 timeout { fail "(timeout) run to call0a" ; gdb_suppress_tests }
73 # Print each arg as a double check to see if we can print
74 # them here as well as with backtrace.
75 gdb_test "print c" ".* = 97 'a'" "print c after run to call0a"
76 gdb_test "print s" ".* = 1" "print s after run to call0a"
77 gdb_test "print i" ".* = 2" "print i after run to call0a"
78 gdb_test "print l " ".* = 3" "print l after run to call0a"
80 # Continue; should stop at call0b and print actual arguments.
81 if [gdb_test "cont" ".* call0b \\(s=1, i=2, l=3, c=97 'a'\\) .*" "continue to call0b"] {
85 # Continue; should stop at call0c and print actual arguments.
86 if [gdb_test "cont" ".* call0c \\(i=2, l=3, c=97 'a', s=1\\) .*" "continue to call0c"] {
90 # Continue; should stop at call0d and print actual arguments.
91 if [gdb_test "cont" ".* call0d \\(l=3, c=97 'a', s=1, i=2\\) .*" "continue to call0d";] {
95 # Continue; should stop at call0e and print actual arguments.
96 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" ] {
99 gdb_stop_suppressing_tests;
103 # Locate actual args; unsigned integral types.
106 proc unsigned_integral_args {} {
113 gdb_breakpoint call1a;
114 gdb_breakpoint call1b;
115 gdb_breakpoint call1c;
116 gdb_breakpoint call1d;
117 gdb_breakpoint call1e;
119 # Run; should stop at call1a and print actual arguments.
120 # The a29k fails all of these tests, perhaps because the prologue
122 setup_xfail "a29k-*-udi"
123 if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
126 -re ".* call1a \\(uc=98 'b', us=6, ui=7, ul=8\\) .*$gdb_prompt $" {
129 -re "$gdb_prompt $" { fail "run to call1a" ; gdb_suppress_tests; }
130 timeout { fail "(timeout) run to call1a" ; gdb_suppress_tests; }
133 # Print each arg as a double check to see if we can print
134 # them here as well as with backtrace.
135 gdb_test "print uc" ".* = 98 'b'"
136 gdb_test "print us" ".* = 6"
137 gdb_test "print ui" ".* = 7"
138 gdb_test "print ul" ".* = 8"
140 # Continue; should stop at call1b and print actual arguments.
141 if [gdb_test "cont" ".* call1b \\(us=6, ui=7, ul=8, uc=98 'b'\\) .*" "continue to call1b"] {
145 # Continue; should stop at call1c and print actual arguments.
146 if [gdb_test "cont" ".* call1c \\(ui=7, ul=8, uc=98 'b', us=6\\) .*" "continue to call1c"] {
150 # Continue; should stop at call1d and print actual arguments.
151 if [gdb_test "cont" ".* call1d \\(ul=8, uc=98 'b', us=6, ui=7\\) .*" "continue to call1d"] {
155 # Continue; should stop at call1e and print actual arguments.
156 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"] {
159 gdb_stop_suppressing_tests;
163 # Locate actual args; integrals mixed with floating point.
166 proc float_and_integral_args {} {
170 global hp_cc_compiler
174 gdb_breakpoint call2a
175 gdb_breakpoint call2b
176 gdb_breakpoint call2c
177 gdb_breakpoint call2d
178 gdb_breakpoint call2e
179 gdb_breakpoint call2f
180 gdb_breakpoint call2g
181 gdb_breakpoint call2h
183 # Run; should stop at call2a and print actual arguments.
185 setup_xfail "i960-*-*" 1813
186 # The a29k fails all of these tests, perhaps because the prologue
188 setup_xfail "a29k-*-udi"
189 if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" "mips-sgi-irix5*" }
190 # The debug info. for "f" is not correct. It's a known bug.
191 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
194 -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" }
195 -re ".* call2a \\(c=97 'a', f1=.*, s=1, d1=5, i=2, f2=4, l=3, d2=5\\) .*$gdb_prompt $" { xfail "run to call2a" }
196 -re "$gdb_prompt $" { fail "run to call2a" ; gdb_suppress_tests; }
197 timeout { fail "(timeout) run to call2a" ; gdb_suppress_tests; }
200 # Print each arg as a double check to see if we can print
201 gdb_test "print c" ".* = 97 'a'" "print c after run to call2a"
202 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
203 gdb_test "print f1" ".* = 4" "print f1 after run to call2a"
204 gdb_test "print s" ".* = 1" "print s after run to call2a"
205 gdb_test "print d1" ".* = 5" "print d1 after run to call2a"
206 gdb_test "print i" ".* = 2" "print i after run to call2a"
207 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
208 gdb_test "print f2" ".* = 4" "print f2 after run to call2a"
209 gdb_test "print l" ".* = 3" "print l after run to call2a"
210 gdb_test "print d2" ".* = 5" "print d2 after run to call2a"
212 setup_xfail "rs6000-*-*"
213 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
214 if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix*" }
215 # Continue; should stop at call2b and print actual arguments.
216 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"] {
220 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
221 # Continue; should stop at call2c and print actual arguments.
222 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"] {
226 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
227 # Continue; should stop at call2d and print actual arguments.
228 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"] {
232 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
233 # Continue; should stop at call2e and print actual arguments.
234 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"] {
238 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
239 # Continue; should stop at call2f and print actual arguments.
240 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"] {
244 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
245 # Continue; should stop at call2g and print actual arguments.
246 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"] {
250 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
251 # Continue; should stop at call2h and print actual arguments.
252 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"] {
256 # monitor only allows 8 breakpoints; w89k board allows 10, so
257 # break them up into two groups.
259 gdb_breakpoint call2i
261 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
262 # Continue; should stop at call2i and print actual arguments.
263 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"] {
266 gdb_stop_suppressing_tests;
270 # Locate actual args; dereference pointers to ints and floats.
273 proc pointer_args {} {
280 gdb_breakpoint call3a
281 gdb_breakpoint call3b
282 gdb_breakpoint call3c
284 # Run; should stop at call3a and print actual arguments.
285 # Try dereferencing the arguments.
287 # The a29k fails all of these tests, perhaps because the prologue
289 setup_xfail "a29k-*-udi"
292 -re ".* call3a \\(cp=$hex \"a\", sp=$hex, ip=$hex, lp=$hex\\) .*$gdb_prompt $" { pass "run to call3a" }
293 -re "$gdb_prompt $" { fail "run to call3a" ; gdb_suppress_tests; }
294 timeout { fail "(timeout) run to call3a" ; gdb_suppress_tests; }
297 gdb_test "print *cp" ".* = 97 'a'"
298 gdb_test "print *sp" ".* = 1"
299 gdb_test "print *ip" ".* = 2"
300 gdb_test "print *lp" ".* = 3"
302 # Continue; should stop at call3b and print actual arguments.
303 # Try dereferencing the arguments.
304 if [gdb_test "cont" ".* call3b \\(ucp=$hex \"b\", usp=$hex, uip=$hex, ulp=$hex\\) .*" "continue to call3b"] {
308 gdb_test "print *ucp" ".* = 98 'b'"
309 gdb_test "print *usp" ".* = 6"
310 gdb_test "print *uip" ".* = 7"
311 gdb_test "print *ulp" ".* = 8"
313 # Continue; should stop at call3c and print actual arguments.
314 # Try dereferencing the arguments.
315 if [gdb_test "cont" ".* call3c \\(fp=$hex, dp=$hex\\) .*" "continue to call3c"] {
319 gdb_test "print *fp" ".* = 4"
320 gdb_test "print *dp" ".* = 5"
322 # pass "locate actual args, pointer types"
323 gdb_stop_suppressing_tests;
327 # Locate actual args; structures and unions passed by reference.
330 proc structs_by_reference {} {
334 global target_sizeof_int
335 global target_sizeof_long
336 global target_bigendian_p
340 gdb_breakpoint call4a
341 gdb_breakpoint call4b
343 # Run; should stop at call4a and print actual arguments.
344 # Try dereferencing the arguments.
346 # The a29k fails all of these tests, perhaps because the prologue
348 setup_xfail "a29k-*-udi"
351 -re ".* call4a \\(stp=$hex\\) .*$gdb_prompt $" {
354 -re "$gdb_prompt $" { fail "run to call4a" ; gdb_suppress_tests; }
355 timeout { fail "(timeout) run to call4a" ; gdb_suppress_tests; }
358 gdb_test "print *stp" ".* = \{s1 = 101, s2 = 102\}"
360 # Continue; should stop at call4b and print actual arguments.
362 gdb_test "cont" ".* call4b \\(unp=$hex\\) .*" "continue to call4b"
364 # Try dereferencing the arguments.
365 if { $target_sizeof_long == $target_sizeof_int } {
366 gdb_test "print *unp" ".* = \{u1 = 1, u2 = 1\}" \
367 "print *unp (sizeof long == sizeof int)"
368 } elseif { ! $target_bigendian_p } {
369 gdb_test "print *unp" ".* = \{u1 = 1, u2 = 1\}" \
370 "print *unp (little-endian, sizeof long != sizeof int)"
371 } elseif { $target_sizeof_long == 8 && $target_sizeof_int == 4 } {
372 gdb_test "print *unp" ".* = \{u1 = 1, u2 = 4294967296\}" \
373 "print *unp (big-endian, sizeof long == 8, sizeof int = 4)"
374 } elseif { $target_sizeof_long == 4 && $target_sizeof_int == 2 } {
375 gdb_test "print *unp" ".* = \{u1 = 1, u2 = 65536\}" \
376 "print *unp (big-endian, sizeof long == 4, sizeof int = 2)"
378 fail "print *unp (unknown case)"
381 pass "locate actual args, structs/unions passed by reference"
382 gdb_stop_suppressing_tests;
386 # Locate actual args; structures and unions passed by value.
389 proc structs_by_value {} {
393 global target_sizeof_int
394 global target_sizeof_long
395 global target_bigendian_p
399 gdb_breakpoint call5a
400 gdb_breakpoint call5b
402 # Run; should stop at call5a and print actual arguments.
403 # Try dereferencing the arguments.
405 # The a29k fails all of these tests, perhaps because the prologue
407 setup_xfail "a29k-*-udi"
410 -re ".* call5a \\(st=\{s1 = 101, s2 = 102\}\\) .*$gdb_prompt $" {
413 -re "$gdb_prompt $" { fail "run to call5a" ; gdb_suppress_tests; }
414 timeout { fail "(timeout) run to call5a" ; gdb_suppress_tests; }
417 gdb_test "print st" ".* = \{s1 = 101, s2 = 102\}"
419 # Continue; should stop at call5b and print actual arguments.
420 if { $target_sizeof_long == $target_sizeof_int } {
421 gdb_test "cont" ".* call5b \\(un=\{u1 = 2, u2 = 2\}\\) .*" \
422 "continue to call5b (sizeof long == sizeof int)"
423 } elseif { ! $target_bigendian_p } {
424 gdb_test "cont" ".* call5b \\(un=\{u1 = 2, u2 = 2\}\\) .*" \
425 "continue to call5b (little-endian, sizeof long != sizeof int)"
426 } elseif { $target_sizeof_long == 8 && $target_sizeof_int == 4 } {
427 gdb_test "cont" ".* call5b \\(un=\{u1 = 2, u2 = 8589934592\}\\) .*" \
428 "continue to call5b (big-endian, sizeof long == 8, sizeof int = 4)"
429 } elseif { $target_sizeof_long == 4 && $target_sizeof_int == 2 } {
430 gdb_test "cont" ".* call5b \\(un=\{u1 = 2, u2 = 131072\}\\) .*" \
431 "continue to call5b (big-endian, sizeof long == 4, sizeof int = 2)"
433 fail "continue to call5b (unknown case)"
436 # Try dereferencing the arguments.
437 if { $target_sizeof_long == $target_sizeof_int } {
438 gdb_test "print un" ".* = \{u1 = 2, u2 = 2\}" \
439 "print un (sizeof long == sizeof int)"
440 } elseif { ! $target_bigendian_p } {
441 gdb_test "print un" ".* = \{u1 = 2, u2 = 2\}" \
442 "print un (little-endian, sizeof long != sizeof int)"
443 } elseif { $target_sizeof_long == 8 && $target_sizeof_int == 4 } {
444 gdb_test "print un" ".* = \{u1 = 2, u2 = 8589934592\}" \
445 "print un (big-endian, sizeof long == 8, sizeof int = 4)"
446 } elseif { $target_sizeof_long == 4 && $target_sizeof_int == 2 } {
447 gdb_test "print un" ".* = \{u1 = 2, u2 = 131072\}" \
448 "print un (big-endian, sizeof long == 4, sizeof int = 2)"
450 fail "print un (unknown case)"
453 gdb_stop_suppressing_tests;
457 # Locate actual args; discard, shuffle, and call
460 proc discard_and_shuffle {} {
466 global hp_cc_compiler
470 gdb_breakpoint call6a
471 gdb_breakpoint call6b
472 gdb_breakpoint call6c
473 gdb_breakpoint call6d
474 gdb_breakpoint call6e
475 gdb_breakpoint call6f
476 gdb_breakpoint call6g
477 gdb_breakpoint call6h
479 # Run; should stop at call6a and print actual arguments.
482 # The a29k fails all of these tests, perhaps because the prologue
484 setup_xfail "a29k-*-udi"
487 -re ".*Breakpoint $decimal, call6a .*$gdb_prompt $" { pass "run to call6a" }
488 -re "$gdb_prompt $" { fail "run to call6a" ; gdb_suppress_tests; }
489 timeout { fail "(timeout) run to call6a" ; gdb_suppress_tests; }
492 setup_xfail "rs6000-*-*"
494 if {!$gcc_compiled} {
495 setup_xfail "mips-sgi-irix5*"
498 # The debug info. for "f" is not correct. It's a known bug.
499 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
500 send_gdb "backtrace 100\n"
502 -re "backtrace 100\[\r\n\]+
503 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\r
504 .* main \\(.*\\) .*\r
506 pass "backtrace from call6a"
508 -re "backtrace 100\[\r\n\]+
509 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=.*, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\r
510 .* main \\(.*\\) .*\r
512 xfail "backtrace from call6a"
514 -re "$gdb_prompt $" {
515 fail "backtrace from call6a"
519 fail "(timeout) backtrace from call6a"
524 # Continue; should stop at call6b and print actual arguments.
529 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
530 send_gdb "backtrace 100\n"
531 if [gdb_expect_list "backtrace from call6b" ".*$gdb_prompt $" {
532 ".*\[\r\n\]#0 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
533 ".*\[\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\\) "
534 ".*\[\r\n\]#2 .* main \\(.*\\) "
539 # Continue; should stop at call6c and print actual arguments.
544 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
545 send_gdb "backtrace 100\n"
546 if [gdb_expect_list "backtrace from call6c" ".*$gdb_prompt $" {
547 ".*\[\r\n\]#0 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
548 ".*\[\r\n\]#1 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
549 ".*\[\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\\) "
550 ".*\[\r\n\]#3 .* main \\(.*\\) "
554 # Continue; should stop at call6d and print actual arguments.
559 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
560 send_gdb "backtrace 100\n"
561 if [gdb_expect_list "backtrace from call6d" ".*$gdb_prompt $" {
562 ".*\[\r\n\]#0 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
563 ".*\[\r\n\]#1 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
564 ".*\[\r\n\]#2 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
565 ".*\[\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\\) "
566 ".*\[\r\n\]#4 .* main \\(.*\\) "
571 # Continue; should stop at call6e and print actual arguments.
576 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
577 send_gdb "backtrace 100\n"
578 if [gdb_expect_list "backtrace from call6e" ".*$gdb_prompt $" {
579 ".*\[\r\n\]#0 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
580 ".*\[\r\n\]#1 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
581 ".*\[\r\n\]#2 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
582 ".*\[\r\n\]#3 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
583 ".*\[\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\\) "
584 ".*\[\r\n\]#5 .* main \\(.*\\) "
589 # Continue; should stop at call6f and print actual arguments.
594 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
595 send_gdb "backtrace 100\n"
596 if [gdb_expect_list "backtrace from call6f" ".*$gdb_prompt $" {
597 ".*\[\r\n\]#0 .* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
598 ".*\[\r\n\]#1 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
599 ".*\[\r\n\]#2 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
600 ".*\[\r\n\]#3 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
601 ".*\[\r\n\]#4 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
602 ".*\[\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\\) "
603 ".*\[\r\n\]#6 .* main \\(.*\\) "
608 # Continue; should stop at call6g and print actual arguments.
613 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
614 send_gdb "backtrace 100\n"
615 if [gdb_expect_list "backtrace from call6g" ".*$gdb_prompt $" {
616 ".*\[\r\n\]#0 .* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\) "
617 ".*\[\r\n\]#1 .* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
618 ".*\[\r\n\]#2 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
619 ".*\[\r\n\]#3 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
620 ".*\[\r\n\]#4 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
621 ".*\[\r\n\]#5 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
622 ".*\[\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\\) "
623 ".*\[\r\n\]#7 .* main \\(.*\\) "
628 # Continue; should stop at call6h and print actual arguments.
633 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
634 send_gdb "backtrace 100\n"
635 if [gdb_expect_list "backtrace from call6h" ".*$gdb_prompt $" {
636 ".*\[\r\n\]#0 .* call6h \\(us=6, ui=7, ul=8\\) "
637 ".*\[\r\n\]#1 .* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\) "
638 ".*\[\r\n\]#2 .* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
639 ".*\[\r\n\]#3 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
640 ".*\[\r\n\]#4 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
641 ".*\[\r\n\]#5 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
642 ".*\[\r\n\]#6 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
643 ".*\[\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\\) "
644 ".*\[\r\n\]#8 .* main \\(.*\\) "
649 # monitor only allows 8 breakpoints; w89k board allows 10, so
650 # break them up into two groups.
652 gdb_breakpoint call6i
653 gdb_breakpoint call6j
654 gdb_breakpoint call6k
656 # Continue; should stop at call6i and print actual arguments.
661 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
662 send_gdb "backtrace 100\n"
663 if [gdb_expect_list "backtrace from call6i" ".*$gdb_prompt $" {
664 ".*\[\r\n\]#0 .* call6i \\(ui=7, ul=8\\) "
665 ".*\[\r\n\]#1 .* call6h \\(us=6, ui=7, ul=8\\) "
666 ".*\[\r\n\]#2 .* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\) "
667 ".*\[\r\n\]#3 .* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
668 ".*\[\r\n\]#4 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
669 ".*\[\r\n\]#5 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
670 ".*\[\r\n\]#6 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
671 ".*\[\r\n\]#7 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
672 ".*\[\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\\) "
673 ".*\[\r\n\]#9 .* main \\(.*\\) "
678 # Continue; should stop at call6j and print actual arguments.
683 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
684 send_gdb "backtrace 100\n"
685 if [gdb_expect_list "backtrace from call6j" ".*$gdb_prompt $" {
686 ".*\[\r\n\]#0 .* call6j \\(ul=8\\) "
687 ".*\[\r\n\]#1 .* call6i \\(ui=7, ul=8\\) "
688 ".*\[\r\n\]#2 .* call6h \\(us=6, ui=7, ul=8\\) "
689 ".*\[\r\n\]#3 .* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\) "
690 ".*\[\r\n\]#4 .* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
691 ".*\[\r\n\]#5 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
692 ".*\[\r\n\]#6 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
693 ".*\[\r\n\]#7 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
694 ".*\[\r\n\]#8 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
695 ".*\[\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\\) "
696 ".*\[\r\n\]#10 .* main \\(.*\\) "
701 # Continue; should stop at call6k and print actual arguments.
703 # This fails on i960-*-vxworks because gdb gets confused by
704 # breakpoints on adjacent instructions.
705 setup_xfail "i960-*-vxworks" 1786
708 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
709 send_gdb "backtrace 100\n"
710 if [gdb_expect_list "backtrace from call6k" ".*$gdb_prompt $" {
711 ".*\[\r\n\]#0 .* call6k \\(\\) "
712 ".*\[\r\n\]#1 .* call6j \\(ul=8\\) "
713 ".*\[\r\n\]#2 .* call6i \\(ui=7, ul=8\\) "
714 ".*\[\r\n\]#3 .* call6h \\(us=6, ui=7, ul=8\\) "
715 ".*\[\r\n\]#4 .* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\) "
716 ".*\[\r\n\]#5 .* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
717 ".*\[\r\n\]#6 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
718 ".*\[\r\n\]#7 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
719 ".*\[\r\n\]#8 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
720 ".*\[\r\n\]#9 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
721 ".*\[\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\\) "
722 ".*\[\r\n\]#11 .* main \\(.*\\) "
726 gdb_stop_suppressing_tests;
731 # Locate actual args; shuffle round robin and call
734 proc shuffle_round_robin {} {
740 global hp_cc_compiler
744 gdb_breakpoint call7a
745 gdb_breakpoint call7b
746 gdb_breakpoint call7c
747 gdb_breakpoint call7d
748 gdb_breakpoint call7e
749 gdb_breakpoint call7f
750 gdb_breakpoint call7g
751 gdb_breakpoint call7h
753 # Run; should stop at call7a and print actual arguments.
756 # The a29k fails all of these tests, perhaps because the prologue
758 setup_xfail "a29k-*-udi"
761 -re ".*Breakpoint $decimal, call7a .*$gdb_prompt $" {
764 -re "$gdb_prompt $" { fail "run to call7a" ; gdb_suppress_tests; }
765 timeout { fail "(timeout) run to call7a" ; gdb_suppress_tests; }
768 setup_xfail "i960-*-*" 1813
769 if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" "mips-sgi-irix5*" }
770 # The debug info. for "f" is not correct. It's a known bug.
771 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
772 send_gdb "backtrace 100\n"
774 -re "backtrace 100\[\r\n\]+
775 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) .*\r
776 .* main \\(.*\\) .*\r
778 pass "backtrace from call7a"
780 -re "backtrace 100\[\r\n\]+
781 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=.*, uc=98 'b', d=5, us=6, ul=8, ui=7\\) .*\r
782 .* main \\(.*\\) .*\r
784 xfail "backtrace from call7a"
786 -re "$gdb_prompt $" { fail "backtrace from call7a" ; return }
787 timeout { fail "(timeout) backtrace from call7a" ; return }
790 # Continue; should stop at call7b and print actual arguments.
795 if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
797 send_gdb "backtrace 100\n"
798 gdb_expect_list "backtrace from call7b" ".*$gdb_prompt $" {
799 ".*\[\r\n\]#0 .* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
800 ".*\[\r\n\]#1 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) "
801 ".*\[\r\n\]#2 .* main \\(.*\\) "
804 # Continue; should stop at call7c and print actual arguments.
809 send_gdb "backtrace 100\n"
810 gdb_expect_list "backtrace from call7c" ".*$gdb_prompt $" {
811 ".*\[\r\n\]#0 .* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) "
812 ".*\[\r\n\]#1 .* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
813 ".*\[\r\n\]#2 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) "
814 ".*\[\r\n\]#3 .* main \\(.*\\) "
817 # Continue; should stop at call7d and print actual arguments.
822 send_gdb "backtrace 100\n"
823 gdb_expect_list "backtrace from call7d" ".*$gdb_prompt $" {
824 ".*\[\r\n\]#0 .* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) "
825 ".*\[\r\n\]#1 .* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) "
826 ".*\[\r\n\]#2 .* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
827 ".*\[\r\n\]#3 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) "
828 ".*\[\r\n\]#4 .* main \\(.*\\) "
833 send_gdb "backtrace 100\n"
834 gdb_expect_list "backtrace from call7e" ".*$gdb_prompt $" {
835 ".*\[\r\n\]#0 .* call7e \\(f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\) "
836 ".*\[\r\n\]#1 .* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) "
837 ".*\[\r\n\]#2 .* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) "
838 ".*\[\r\n\]#3 .* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
839 ".*\[\r\n\]#4 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) "
840 ".*\[\r\n\]#5 .* main \\(.*\\) "
843 # Continue; should stop at call7f and print actual arguments.
848 send_gdb "backtrace 100\n"
849 gdb_expect_list "backtrace from call7f" ".*$gdb_prompt $" {
850 ".*\[\r\n\]#0 .* call7f \\(uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4\\) "
851 ".*\[\r\n\]#1 .* call7e \\(f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\) "
852 ".*\[\r\n\]#2 .* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) "
853 ".*\[\r\n\]#3 .* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) "
854 ".*\[\r\n\]#4 .* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
855 ".*\[\r\n\]#5 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) "
856 ".*\[\r\n\]#6 .* main \\(.*\\) "
859 # Continue; should stop at call7g and print actual arguments.
864 send_gdb "backtrace 100\n"
865 gdb_expect_list "backtrace from call7g" ".*$gdb_prompt $" {
866 ".*\[\r\n\]#0 .* call7g \\(d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b'\\) "
867 ".*\[\r\n\]#1 .* call7f \\(uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4\\) "
868 ".*\[\r\n\]#2 .* call7e \\(f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\) "
869 ".*\[\r\n\]#3 .* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) "
870 ".*\[\r\n\]#4 .* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) "
871 ".*\[\r\n\]#5 .* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
872 ".*\[\r\n\]#6 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) "
873 ".*\[\r\n\]#7 .* main \\(.*\\) "
878 send_gdb "backtrace 100\n"
879 gdb_expect_list "backtrace from call7h" ".*$gdb_prompt $" {
880 ".*\[\r\n\]#0 .* call7h \\(us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5\\) "
881 ".*\[\r\n\]#1 .* call7g \\(d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b'\\) "
882 ".*\[\r\n\]#2 .* call7f \\(uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4\\) "
883 ".*\[\r\n\]#3 .* call7e \\(f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\) "
884 ".*\[\r\n\]#4 .* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) "
885 ".*\[\r\n\]#5 .* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) "
886 ".*\[\r\n\]#6 .* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
887 ".*\[\r\n\]#7 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) "
888 ".*\[\r\n\]#8 .* main \\(.*\\) "
891 # monitor only allows 8 breakpoints; w89k board allows 10, so
892 # break them up into two groups.
894 gdb_breakpoint call7i
895 gdb_breakpoint call7j
896 gdb_breakpoint call7k
898 # Continue; should stop at call7i and print actual arguments.
903 send_gdb "backtrace 100\n"
904 gdb_expect_list "backtrace from call7i" ".*$gdb_prompt $" {
905 ".*\[\r\n\]#0 .* call7i \\(ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6\\) "
906 ".*\[\r\n\]#1 .* call7h \\(us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5\\) "
907 ".*\[\r\n\]#2 .* call7g \\(d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b'\\) "
908 ".*\[\r\n\]#3 .* call7f \\(uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4\\) "
909 ".*\[\r\n\]#4 .* call7e \\(f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\) "
910 ".*\[\r\n\]#5 .* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) "
911 ".*\[\r\n\]#6 .* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) "
912 ".*\[\r\n\]#7 .* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
913 ".*\[\r\n\]#8 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) "
914 ".*\[\r\n\]#9 .* main \\(.*\\) "
917 # Continue; should stop at call7j and print actual arguments.
922 send_gdb "backtrace 100\n"
923 gdb_expect_list "backtrace from call7j" ".*$gdb_prompt $" {
924 ".*\[\r\n\]#0 .* call7j \\(ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8\\) "
925 ".*\[\r\n\]#1 .* call7i \\(ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6\\) "
926 ".*\[\r\n\]#2 .* call7h \\(us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5\\) "
927 ".*\[\r\n\]#3 .* call7g \\(d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b'\\) "
928 ".*\[\r\n\]#4 .* call7f \\(uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4\\) "
929 ".*\[\r\n\]#5 .* call7e \\(f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\) "
930 ".*\[\r\n\]#6 .* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) "
931 ".*\[\r\n\]#7 .* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) "
932 ".*\[\r\n\]#8 .* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
933 ".*\[\r\n\]#9 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) "
934 ".*\[\r\n\]#10 .* main \\(.*\\) "
937 # Continue; should stop at call7k and print actual arguments.
942 if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix*" }
943 send_gdb "backtrace 100\n"
944 gdb_expect_list "backtrace from call7k" ".*$gdb_prompt $" {
945 ".*\[\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\\) "
946 ".*\[\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\\) "
947 ".*\[\r\n\]#2 .* call7i \\(ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6\\) "
948 ".*\[\r\n\]#3 .* call7h \\(us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5\\) "
949 ".*\[\r\n\]#4 .* call7g \\(d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b'\\) "
950 ".*\[\r\n\]#5 .* call7f \\(uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4\\) "
951 ".*\[\r\n\]#6 .* call7e \\(f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\) "
952 ".*\[\r\n\]#7 .* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) "
953 ".*\[\r\n\]#8 .* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) "
954 ".*\[\r\n\]#9 .* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
955 ".*\[\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\\) "
956 ".*\[\r\n\]#11 .* main \\(.*\\) "
958 gdb_stop_suppressing_tests;
962 # Locate actual args; recursive passing of structs by value
965 proc recursive_structs_by_value {} {
973 gdb_breakpoint hitbottom
975 # Run; should stop at hitbottom and print actual arguments.
979 -re ".*Breakpoint $decimal, hitbottom .*$gdb_prompt $" { pass "run to hitbottom" }
980 -re "$gdb_prompt $" { fail "run to hitbottom" ; gdb_suppress_tests; }
981 timeout { fail "(timeout) run to hitbottom" ; gdb_suppress_tests; }
984 if ![istarget sparclet-*-*] {
985 # The a29k fails all of these tests, perhaps because the prologue
987 setup_xfail "a29k-*-udi"
988 send_gdb "backtrace 100\n"
989 gdb_expect_list "recursive passing of structs by value" ".*$gdb_prompt $" {
990 ".*\[\r\n\]#0 .* hitbottom \\(\\) "
991 ".*\[\r\n\]#1 .* recurse \\(a=\{s = 0, i = 0, l = 0\}, depth=0\\) "
992 ".*\[\r\n\]#2 .* recurse \\(a=\{s = 1, i = 1, l = 1\}, depth=1\\) "
993 ".*\[\r\n\]#3 .* recurse \\(a=\{s = 2, i = 2, l = 2\}, depth=2\\) "
994 ".*\[\r\n\]#4 .* recurse \\(a=\{s = 3, i = 3, l = 3\}, depth=3\\) "
995 ".*\[\r\n\]#5 .* recurse \\(a=\{s = 4, i = 4, l = 4\}, depth=4\\) "
996 ".*\[\r\n\]#6 .* test_struct_args \\(\\) "
997 ".*\[\r\n\]#7 .* main \\(.*\\) "
1000 fail "recursive passing of structs by value (sparclet)"
1002 gdb_stop_suppressing_tests;
1005 proc funcargs_reload { } {
1011 if [istarget "mips-idt-*"] {
1012 # Restart because IDT/SIM runs out of file descriptors.
1015 gdb_reinitialize_dir $srcdir/$subdir
1021 # Test for accessing local stack variables in functions which call alloca
1023 proc localvars_after_alloca { } {
1029 if { ! [ runto localvars_after_alloca ] } then { gdb_suppress_tests; }
1031 # Print each arg as a double check to see if we can print
1032 # them here as well as with backtrace.
1034 if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
1035 gdb_test "print c" " = 97 'a'" "print c after runto localvars_after_alloca"
1036 if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
1037 gdb_test "print s" " = 1" "print s after runto localvars_after_alloca"
1038 gdb_test "print i" " = 2" "print i after runto localvars_after_alloca"
1039 gdb_test "print l" " = 3" "print l after runto localvars_after_alloca"
1042 gdb_test "next" ".*" "next in localvars_after_alloca()"
1044 # Print each arg as a double check to see if we can print
1045 # them here as well as with backtrace.
1047 gdb_test "print c" " = 97 'a'" "print c in localvars_after_alloca"
1048 gdb_test "print s" " = 1" "print s in localvars_after_alloca"
1049 gdb_test "print i" " = 2" "print i in localvars_after_alloca"
1050 gdb_test "print l" " = 3" "print l in localvars_after_alloca"
1052 gdb_test "backtrace 8" "#0.*localvars_after_alloca \\(c=97 'a', s=1, i=2, l=3\\).*#1.*main.*" "backtrace after alloca"
1053 gdb_stop_suppressing_tests;
1056 proc call_after_alloca { } {
1062 if { ! [ runto call_after_alloca_subr ] } then { gdb_suppress_tests; }
1064 # Print each arg as a double check to see if we can print
1065 # them here as well as with backtrace.
1067 if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
1068 gdb_test "print c" " = 97 'a'" "print c in call_after_alloca"
1069 if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
1070 gdb_test "print s" " = 1" "print s in call_after_alloca"
1071 gdb_test "print i" " = 2" "print i in call_after_alloca"
1072 gdb_test "print l" " = 3" "print l in call_after_alloca"
1074 if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
1075 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"
1076 gdb_stop_suppressing_tests;
1080 # Test for accessing local stack variables, backtraces, finish,
1081 # and finally stepping into indirect calls. The point is that on the PA
1082 # these use a funky `dyncall' mechanism which GDB needs to know about.
1084 proc localvars_in_indirect_call { } {
1090 # Can not use "runto call0a" as call0a is called several times
1091 # during single run. Instead stop in a marker function and
1092 # take control from there.
1093 if { ! [ runto marker_indirect_call ] } then { gdb_suppress_tests; }
1095 # break on the next call to call0a, then delete all the breakpoints
1096 # and start testing.
1097 gdb_breakpoint call0a
1101 # Print each arg as a double check to see if we can print
1102 # them here as well as with backtrace.
1104 if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
1105 gdb_test "print c" " = 97 'a'" "print c in localvars_in_indirect_call"
1106 if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
1107 gdb_test "print s" " = 1" "print s in localvars_in_indirect_call"
1108 gdb_test "print i" " = 2" "print i in localvars_in_indirect_call"
1109 gdb_test "print l" " = 3" "print l in localvars_in_indirect_call"
1111 if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
1112 gdb_test "backtrace 8" \
1113 "#0.*call0a \\(c=97 'a', s=1, i=2, l=3\\).*#1.*main.*" \
1114 "backtrace in indirectly called function"
1117 # "finish" brings us back to main. We then will try to step through
1118 # the second indirect call.
1119 # On some targets (e.g. m68k) gdb will stop from the finish in midline
1120 # of the first indirect call. This is due to stack adjustment instructions
1121 # after the indirect call. In these cases we will step till we hit the
1122 # second indirect call.
1127 -re "\\(\\*pointer_to_call0a\\) \\(c, s, i, l\\);.*First.*$gdb_prompt $" {
1128 #On hppa2.0w-hp-hpux11.00, gdb finishes at one line earlier than
1129 #hppa1.1-hp-hpux11.00. Therefore, an extra "step" is necessary to continue the test.
1133 -re ".*\\(\\*pointer_to_call0a\\) \\(c, s, i, l\\);.*Second.*$gdb_prompt $" {
1134 pass "finish from indirectly called function"
1136 -re ".*$gdb_prompt $" {
1137 fail "finish from indirectly called function"
1140 default { fail "finish from indirectly called function" ; gdb_suppress_tests; }
1143 if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
1144 gdb_test "step" "call0a \\(c=97 'a', s=1, i=2, l=3\\).*" \
1145 "stepping into indirectly called function"
1146 gdb_stop_suppressing_tests;
1150 # Test for stepping into indirect calls which may have trampolines (possibly
1151 # cascaded) on both the call path and the gdb_suppress_tests; path.
1152 # to handle trampolines.
1154 proc test_stepping_over_trampolines { } {
1159 # Stop in a marker function and take control from there.
1160 if { ! [ runto marker_call_with_trampolines ] } then { gdb_suppress_tests; }
1162 # Cater for gdb stopping in midline, see comment for finish above.
1165 -re "marker_call_with_trampolines ..;.*$gdb_prompt $" {
1169 -re "pointer_to_call_with_trampolines.*$gdb_prompt $" {
1170 pass "finish from marker_call_with_trampolines"
1172 -re ".*$gdb_prompt $" {
1173 fail "finish from marker_call_with_trampolines"
1175 default { fail "finish from marker_call_with_trampolines" ; gdb_suppress_tests; }
1178 # Try to step into the target function.
1179 gdb_test "step" "call_with_trampolines \\(d1=5\\).*" \
1180 "stepping into function called with trampolines"
1182 # Make we can backtrace and the argument looks correct. */
1183 gdb_test "backtrace 8" "#0.*call_with_trampolines \\(d1=5\\).*1.*main.*" \
1184 "backtrace through call with trampolines"
1186 # Make sure we can get back to main.
1187 # Stepping back to main might stop again after the gdb_suppress_tests; statement
1188 # or immediately transfer control back to main if optimizations
1192 -re "main .* at.*$gdb_prompt $" {
1193 pass "stepping back to main from function called with trampolines" ;
1196 -re "\}.*End of call_with_trampolines.*$gdb_prompt $" {
1200 -re ".*$gdb_prompt $" {
1201 fail "stepping back to main from function called with trampolines"
1203 default { fail "stepping back to main from function called with trampolines" ; gdb_suppress_tests; }
1205 gdb_stop_suppressing_tests;
1208 # Start with a fresh gdb.
1212 gdb_reinitialize_dir $srcdir/$subdir
1215 if [istarget "mips*tx39-*"] {
1217 } elseif [istarget "hppa*-hp-hpux*"] then {
1223 # Determine expected output for unsigned long variables,
1224 # the output varies with sizeof (unsigned long).
1226 set target_sizeof_long 4
1227 send_gdb "print sizeof (long)\n"
1229 -re ".\[0-9\]* = 4.*$gdb_prompt $" { }
1230 -re ".\[0-9\]* = 8.*$gdb_prompt $" { set target_sizeof_long 8 }
1231 -re ".*$gdb_prompt $" {
1232 fail "getting sizeof long"
1234 default { fail "(timeout) getting sizeof long" }
1237 set target_sizeof_int 4
1238 send_gdb "print sizeof (int)\n"
1240 -re ".\[0-9\]* = 2.*$gdb_prompt $" { set target_sizeof_int 2 }
1241 -re ".\[0-9\]* = 4.*$gdb_prompt $" { }
1242 -re ".\[0-9\]* = 8.*$gdb_prompt $" { set target_sizeof_int 8 }
1243 -re ".*$gdb_prompt $" {
1244 fail "getting sizeof unsigned long"
1246 default { fail "(timeout) getting sizeof int" }
1249 set target_bigendian_p 1
1250 send_gdb "show endian\n"
1252 -re ".*little endian.*$gdb_prompt $" { set target_bigendian_p 0 }
1253 -re ".*big endian.*$gdb_prompt $" { }
1254 -re ".*$gdb_prompt $" {
1255 fail "getting target endian"
1257 default { fail "(timeout) getting target endian" }
1264 unsigned_integral_args
1266 if {![target_info exists gdb,skip_float_tests]} {
1267 float_and_integral_args
1272 structs_by_reference
1280 recursive_structs_by_value
1282 localvars_after_alloca
1286 localvars_in_indirect_call
1288 test_stepping_over_trampolines