1 # Copyright 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000
2 # Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 # Please email any bugs, comments, and/or additions to this file to:
19 # bug-gdb@prep.ai.mit.edu
21 # This file was written by Fred Fish. (fnf@cygnus.com)
30 set testfile "funcargs"
31 set srcfile ${testfile}.c
32 set binfile ${objdir}/${subdir}/${testfile}
33 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
34 gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
37 # Create and source the file that provides information about the compiler
38 # used to compile the test case.
39 if [get_compiler_info ${binfile}] {
44 # Locate actual args; integral types.
47 proc integral_args {} {
60 # Run; should stop at call0a and print actual arguments.
61 # The a29k fails all of these tests, perhaps because the prologue
63 setup_xfail "a29k-*-udi"
64 if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
67 -re ".* call0a \\(c=97 'a', s=1, i=2, l=3\\) .*$gdb_prompt $" {
70 -re "$gdb_prompt $" { fail "run to call0a" ; gdb_suppress_tests }
71 timeout { fail "(timeout) run to call0a" ; gdb_suppress_tests }
74 # Print each arg as a double check to see if we can print
75 # them here as well as with backtrace.
76 gdb_test "print c" ".* = 97 'a'" "print c after run to call0a"
77 gdb_test "print s" ".* = 1" "print s after run to call0a"
78 gdb_test "print i" ".* = 2" "print i after run to call0a"
79 gdb_test "print l " ".* = 3" "print l after run to call0a"
81 # Continue; should stop at call0b and print actual arguments.
82 if [gdb_test "cont" ".* call0b \\(s=1, i=2, l=3, c=97 'a'\\) .*" "continue to call0b"] {
86 # Continue; should stop at call0c and print actual arguments.
87 if [gdb_test "cont" ".* call0c \\(i=2, l=3, c=97 'a', s=1\\) .*" "continue to call0c"] {
91 # Continue; should stop at call0d and print actual arguments.
92 if [gdb_test "cont" ".* call0d \\(l=3, c=97 'a', s=1, i=2\\) .*" "continue to call0d";] {
96 # Continue; should stop at call0e and print actual arguments.
97 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" ] {
100 gdb_stop_suppressing_tests;
104 # Locate actual args; unsigned integral types.
107 proc unsigned_integral_args {} {
114 gdb_breakpoint call1a;
115 gdb_breakpoint call1b;
116 gdb_breakpoint call1c;
117 gdb_breakpoint call1d;
118 gdb_breakpoint call1e;
120 # Run; should stop at call1a and print actual arguments.
121 # The a29k fails all of these tests, perhaps because the prologue
123 setup_xfail "a29k-*-udi"
124 if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
127 -re ".* call1a \\(uc=98 'b', us=6, ui=7, ul=8\\) .*$gdb_prompt $" {
130 -re "$gdb_prompt $" { fail "run to call1a" ; gdb_suppress_tests; }
131 timeout { fail "(timeout) run to call1a" ; gdb_suppress_tests; }
134 # Print each arg as a double check to see if we can print
135 # them here as well as with backtrace.
136 gdb_test "print uc" ".* = 98 'b'"
137 gdb_test "print us" ".* = 6"
138 gdb_test "print ui" ".* = 7"
139 gdb_test "print ul" ".* = 8"
141 # Continue; should stop at call1b and print actual arguments.
142 if [gdb_test "cont" ".* call1b \\(us=6, ui=7, ul=8, uc=98 'b'\\) .*" "continue to call1b"] {
146 # Continue; should stop at call1c and print actual arguments.
147 if [gdb_test "cont" ".* call1c \\(ui=7, ul=8, uc=98 'b', us=6\\) .*" "continue to call1c"] {
151 # Continue; should stop at call1d and print actual arguments.
152 if [gdb_test "cont" ".* call1d \\(ul=8, uc=98 'b', us=6, ui=7\\) .*" "continue to call1d"] {
156 # Continue; should stop at call1e and print actual arguments.
157 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"] {
160 gdb_stop_suppressing_tests;
164 # Locate actual args; integrals mixed with floating point.
167 proc float_and_integral_args {} {
171 global hp_cc_compiler
175 gdb_breakpoint call2a
176 gdb_breakpoint call2b
177 gdb_breakpoint call2c
178 gdb_breakpoint call2d
179 gdb_breakpoint call2e
180 gdb_breakpoint call2f
181 gdb_breakpoint call2g
182 gdb_breakpoint call2h
184 # Run; should stop at call2a and print actual arguments.
186 setup_xfail "i960-*-*" 1813
187 # The a29k fails all of these tests, perhaps because the prologue
189 setup_xfail "a29k-*-udi"
190 if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" "mips-sgi-irix5*" }
191 # The debug info. for "f" is not correct. It's a known bug.
192 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
195 -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" }
196 -re ".* call2a \\(c=97 'a', f1=.*, s=1, d1=5, i=2, f2=4, l=3, d2=5\\) .*$gdb_prompt $" { xfail "run to call2a" }
197 -re "$gdb_prompt $" { fail "run to call2a" ; gdb_suppress_tests; }
198 timeout { fail "(timeout) run to call2a" ; gdb_suppress_tests; }
201 # Print each arg as a double check to see if we can print
202 gdb_test "print c" ".* = 97 'a'" "print c after run to call2a"
203 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
204 gdb_test "print f1" ".* = 4" "print f1 after run to call2a"
205 gdb_test "print s" ".* = 1" "print s after run to call2a"
206 gdb_test "print d1" ".* = 5" "print d1 after run to call2a"
207 gdb_test "print i" ".* = 2" "print i after run to call2a"
208 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
209 gdb_test "print f2" ".* = 4" "print f2 after run to call2a"
210 gdb_test "print l" ".* = 3" "print l after run to call2a"
211 gdb_test "print d2" ".* = 5" "print d2 after run to call2a"
213 setup_xfail "rs6000-*-*"
214 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
215 if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix*" }
216 # Continue; should stop at call2b and print actual arguments.
217 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"] {
221 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
222 # Continue; should stop at call2c and print actual arguments.
223 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"] {
227 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
228 # Continue; should stop at call2d and print actual arguments.
229 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"] {
233 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
234 # Continue; should stop at call2e and print actual arguments.
235 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"] {
239 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
240 # Continue; should stop at call2f and print actual arguments.
241 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"] {
245 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
246 # Continue; should stop at call2g and print actual arguments.
247 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"] {
251 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
252 # Continue; should stop at call2h and print actual arguments.
253 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"] {
257 # monitor only allows 8 breakpoints; w89k board allows 10, so
258 # break them up into two groups.
260 gdb_breakpoint call2i
262 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
263 # Continue; should stop at call2i and print actual arguments.
264 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"] {
267 gdb_stop_suppressing_tests;
271 # Locate actual args; dereference pointers to ints and floats.
274 proc pointer_args {} {
281 gdb_breakpoint call3a
282 gdb_breakpoint call3b
283 gdb_breakpoint call3c
285 # Run; should stop at call3a and print actual arguments.
286 # Try dereferencing the arguments.
288 # The a29k fails all of these tests, perhaps because the prologue
290 setup_xfail "a29k-*-udi"
293 -re ".* call3a \\(cp=$hex \"a.*\", sp=$hex, ip=$hex, lp=$hex\\) .*$gdb_prompt $" { pass "run to call3a" }
294 -re "$gdb_prompt $" { fail "run to call3a" ; gdb_suppress_tests; }
295 timeout { fail "(timeout) run to call3a" ; gdb_suppress_tests; }
298 gdb_test "print *cp" ".* = 97 'a'"
299 gdb_test "print *sp" ".* = 1"
300 gdb_test "print *ip" ".* = 2"
301 gdb_test "print *lp" ".* = 3"
303 # Continue; should stop at call3b and print actual arguments.
304 # Try dereferencing the arguments.
305 if [gdb_test "cont" ".* call3b \\(ucp=$hex \"b.*\", usp=$hex, uip=$hex, ulp=$hex\\) .*" "continue to call3b"] {
309 gdb_test "print *ucp" ".* = 98 'b'"
310 gdb_test "print *usp" ".* = 6"
311 gdb_test "print *uip" ".* = 7"
312 gdb_test "print *ulp" ".* = 8"
314 # Continue; should stop at call3c and print actual arguments.
315 # Try dereferencing the arguments.
316 if [gdb_test "cont" ".* call3c \\(fp=$hex, dp=$hex\\) .*" "continue to call3c"] {
320 gdb_test "print *fp" ".* = 4"
321 gdb_test "print *dp" ".* = 5"
323 # pass "locate actual args, pointer types"
324 gdb_stop_suppressing_tests;
328 # Locate actual args; structures and unions passed by reference.
331 proc structs_by_reference {} {
335 global target_sizeof_int
336 global target_sizeof_long
337 global target_bigendian_p
341 gdb_breakpoint call4a
342 gdb_breakpoint call4b
344 # Run; should stop at call4a and print actual arguments.
345 # Try dereferencing the arguments.
347 # The a29k fails all of these tests, perhaps because the prologue
349 setup_xfail "a29k-*-udi"
352 -re ".* call4a \\(stp=$hex\\) .*$gdb_prompt $" {
355 -re "$gdb_prompt $" { fail "run to call4a" ; gdb_suppress_tests; }
356 timeout { fail "(timeout) run to call4a" ; gdb_suppress_tests; }
359 gdb_test "print *stp" ".* = \{s1 = 101, s2 = 102\}"
361 # Continue; should stop at call4b and print actual arguments.
363 gdb_test "cont" ".* call4b \\(unp=$hex\\) .*" "continue to call4b"
365 # Try dereferencing the arguments.
366 if { $target_sizeof_long == $target_sizeof_int } {
367 gdb_test "print *unp" ".* = \{u1 = 1, u2 = 1\}" \
368 "print *unp (sizeof long == sizeof int)"
369 } elseif { ! $target_bigendian_p } {
370 gdb_test "print *unp" ".* = \{u1 = 1, u2 = 1\}" \
371 "print *unp (little-endian, sizeof long != sizeof int)"
372 } elseif { $target_sizeof_long == 8 && $target_sizeof_int == 4 } {
373 gdb_test "print *unp" ".* = \{u1 = 1, u2 = 4294967296\}" \
374 "print *unp (big-endian, sizeof long == 8, sizeof int = 4)"
375 } elseif { $target_sizeof_long == 4 && $target_sizeof_int == 2 } {
376 gdb_test "print *unp" ".* = \{u1 = 1, u2 = 65536\}" \
377 "print *unp (big-endian, sizeof long == 4, sizeof int = 2)"
379 fail "print *unp (unknown case)"
382 pass "locate actual args, structs/unions passed by reference"
383 gdb_stop_suppressing_tests;
387 # Locate actual args; structures and unions passed by value.
390 proc structs_by_value {} {
394 global target_sizeof_int
395 global target_sizeof_long
396 global target_bigendian_p
400 gdb_breakpoint call5a
401 gdb_breakpoint call5b
403 # Run; should stop at call5a and print actual arguments.
404 # Try dereferencing the arguments.
406 # The a29k fails all of these tests, perhaps because the prologue
408 setup_xfail "a29k-*-udi"
411 -re ".* call5a \\(st=\{s1 = 101, s2 = 102\}\\) .*$gdb_prompt $" {
414 -re "$gdb_prompt $" { fail "run to call5a" ; gdb_suppress_tests; }
415 timeout { fail "(timeout) run to call5a" ; gdb_suppress_tests; }
418 gdb_test "print st" ".* = \{s1 = 101, s2 = 102\}"
420 # Continue; should stop at call5b and print actual arguments.
421 if { $target_sizeof_long == $target_sizeof_int } {
422 gdb_test "cont" ".* call5b \\(un=\{u1 = 2, u2 = 2\}\\) .*" \
423 "continue to call5b (sizeof long == sizeof int)"
424 } elseif { ! $target_bigendian_p } {
425 gdb_test "cont" ".* call5b \\(un=\{u1 = 2, u2 = 2\}\\) .*" \
426 "continue to call5b (little-endian, sizeof long != sizeof int)"
427 } elseif { $target_sizeof_long == 8 && $target_sizeof_int == 4 } {
428 gdb_test "cont" ".* call5b \\(un=\{u1 = 2, u2 = 8589934592\}\\) .*" \
429 "continue to call5b (big-endian, sizeof long == 8, sizeof int = 4)"
430 } elseif { $target_sizeof_long == 4 && $target_sizeof_int == 2 } {
431 gdb_test "cont" ".* call5b \\(un=\{u1 = 2, u2 = 131072\}\\) .*" \
432 "continue to call5b (big-endian, sizeof long == 4, sizeof int = 2)"
434 fail "continue to call5b (unknown case)"
437 # Try dereferencing the arguments.
438 if { $target_sizeof_long == $target_sizeof_int } {
439 gdb_test "print un" ".* = \{u1 = 2, u2 = 2\}" \
440 "print un (sizeof long == sizeof int)"
441 } elseif { ! $target_bigendian_p } {
442 gdb_test "print un" ".* = \{u1 = 2, u2 = 2\}" \
443 "print un (little-endian, sizeof long != sizeof int)"
444 } elseif { $target_sizeof_long == 8 && $target_sizeof_int == 4 } {
445 gdb_test "print un" ".* = \{u1 = 2, u2 = 8589934592\}" \
446 "print un (big-endian, sizeof long == 8, sizeof int = 4)"
447 } elseif { $target_sizeof_long == 4 && $target_sizeof_int == 2 } {
448 gdb_test "print un" ".* = \{u1 = 2, u2 = 131072\}" \
449 "print un (big-endian, sizeof long == 4, sizeof int = 2)"
451 fail "print un (unknown case)"
454 gdb_stop_suppressing_tests;
458 # Locate actual args; discard, shuffle, and call
461 proc discard_and_shuffle {} {
467 global hp_cc_compiler
471 gdb_breakpoint call6a
472 gdb_breakpoint call6b
473 gdb_breakpoint call6c
474 gdb_breakpoint call6d
475 gdb_breakpoint call6e
476 gdb_breakpoint call6f
477 gdb_breakpoint call6g
478 gdb_breakpoint call6h
480 # Run; should stop at call6a and print actual arguments.
483 # The a29k fails all of these tests, perhaps because the prologue
485 setup_xfail "a29k-*-udi"
488 -re ".*Breakpoint $decimal, call6a .*$gdb_prompt $" { pass "run to call6a" }
489 -re "$gdb_prompt $" { fail "run to call6a" ; gdb_suppress_tests; }
490 timeout { fail "(timeout) run to call6a" ; gdb_suppress_tests; }
493 setup_xfail "rs6000-*-*"
495 if {!$gcc_compiled} {
496 setup_xfail "mips-sgi-irix5*"
499 # The debug info. for "f" is not correct. It's a known bug.
500 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
501 send_gdb "backtrace 100\n"
503 -re "backtrace 100\[\r\n\]+
504 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\r
505 .* main \\(.*\\) .*\r
507 pass "backtrace from call6a"
509 -re "backtrace 100\[\r\n\]+
510 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=.*, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\r
511 .* main \\(.*\\) .*\r
513 xfail "backtrace from call6a"
515 -re "$gdb_prompt $" {
516 fail "backtrace from call6a"
520 fail "(timeout) backtrace from call6a"
525 # Continue; should stop at call6b and print actual arguments.
530 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
531 send_gdb "backtrace 100\n"
532 if [gdb_expect_list "backtrace from call6b" ".*$gdb_prompt $" {
533 ".*\[\r\n\]#0 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
534 ".*\[\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\\) "
535 ".*\[\r\n\]#2 .* main \\(.*\\) "
540 # Continue; should stop at call6c and print actual arguments.
545 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
546 send_gdb "backtrace 100\n"
547 if [gdb_expect_list "backtrace from call6c" ".*$gdb_prompt $" {
548 ".*\[\r\n\]#0 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
549 ".*\[\r\n\]#1 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
550 ".*\[\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\\) "
551 ".*\[\r\n\]#3 .* main \\(.*\\) "
555 # Continue; should stop at call6d and print actual arguments.
560 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
561 send_gdb "backtrace 100\n"
562 if [gdb_expect_list "backtrace from call6d" ".*$gdb_prompt $" {
563 ".*\[\r\n\]#0 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
564 ".*\[\r\n\]#1 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
565 ".*\[\r\n\]#2 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
566 ".*\[\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\\) "
567 ".*\[\r\n\]#4 .* main \\(.*\\) "
572 # Continue; should stop at call6e and print actual arguments.
577 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
578 send_gdb "backtrace 100\n"
579 if [gdb_expect_list "backtrace from call6e" ".*$gdb_prompt $" {
580 ".*\[\r\n\]#0 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
581 ".*\[\r\n\]#1 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
582 ".*\[\r\n\]#2 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
583 ".*\[\r\n\]#3 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
584 ".*\[\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\\) "
585 ".*\[\r\n\]#5 .* main \\(.*\\) "
590 # Continue; should stop at call6f and print actual arguments.
595 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
596 send_gdb "backtrace 100\n"
597 if [gdb_expect_list "backtrace from call6f" ".*$gdb_prompt $" {
598 ".*\[\r\n\]#0 .* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
599 ".*\[\r\n\]#1 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
600 ".*\[\r\n\]#2 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
601 ".*\[\r\n\]#3 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
602 ".*\[\r\n\]#4 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
603 ".*\[\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\\) "
604 ".*\[\r\n\]#6 .* main \\(.*\\) "
609 # Continue; should stop at call6g and print actual arguments.
614 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
615 send_gdb "backtrace 100\n"
616 if [gdb_expect_list "backtrace from call6g" ".*$gdb_prompt $" {
617 ".*\[\r\n\]#0 .* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\) "
618 ".*\[\r\n\]#1 .* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
619 ".*\[\r\n\]#2 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
620 ".*\[\r\n\]#3 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
621 ".*\[\r\n\]#4 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
622 ".*\[\r\n\]#5 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
623 ".*\[\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\\) "
624 ".*\[\r\n\]#7 .* main \\(.*\\) "
629 # Continue; should stop at call6h and print actual arguments.
634 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
635 send_gdb "backtrace 100\n"
636 if [gdb_expect_list "backtrace from call6h" ".*$gdb_prompt $" {
637 ".*\[\r\n\]#0 .* call6h \\(us=6, ui=7, ul=8\\) "
638 ".*\[\r\n\]#1 .* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\) "
639 ".*\[\r\n\]#2 .* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
640 ".*\[\r\n\]#3 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
641 ".*\[\r\n\]#4 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
642 ".*\[\r\n\]#5 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
643 ".*\[\r\n\]#6 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
644 ".*\[\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\\) "
645 ".*\[\r\n\]#8 .* main \\(.*\\) "
650 # monitor only allows 8 breakpoints; w89k board allows 10, so
651 # break them up into two groups.
653 gdb_breakpoint call6i
654 gdb_breakpoint call6j
655 gdb_breakpoint call6k
657 # Continue; should stop at call6i and print actual arguments.
662 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
663 send_gdb "backtrace 100\n"
664 if [gdb_expect_list "backtrace from call6i" ".*$gdb_prompt $" {
665 ".*\[\r\n\]#0 .* call6i \\(ui=7, ul=8\\) "
666 ".*\[\r\n\]#1 .* call6h \\(us=6, ui=7, ul=8\\) "
667 ".*\[\r\n\]#2 .* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\) "
668 ".*\[\r\n\]#3 .* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
669 ".*\[\r\n\]#4 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
670 ".*\[\r\n\]#5 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
671 ".*\[\r\n\]#6 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
672 ".*\[\r\n\]#7 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
673 ".*\[\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\\) "
674 ".*\[\r\n\]#9 .* main \\(.*\\) "
679 # Continue; should stop at call6j and print actual arguments.
684 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
685 send_gdb "backtrace 100\n"
686 if [gdb_expect_list "backtrace from call6j" ".*$gdb_prompt $" {
687 ".*\[\r\n\]#0 .* call6j \\(ul=8\\) "
688 ".*\[\r\n\]#1 .* call6i \\(ui=7, ul=8\\) "
689 ".*\[\r\n\]#2 .* call6h \\(us=6, ui=7, ul=8\\) "
690 ".*\[\r\n\]#3 .* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\) "
691 ".*\[\r\n\]#4 .* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
692 ".*\[\r\n\]#5 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
693 ".*\[\r\n\]#6 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
694 ".*\[\r\n\]#7 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
695 ".*\[\r\n\]#8 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
696 ".*\[\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\\) "
697 ".*\[\r\n\]#10 .* main \\(.*\\) "
702 # Continue; should stop at call6k and print actual arguments.
704 # This fails on i960-*-vxworks because gdb gets confused by
705 # breakpoints on adjacent instructions.
706 setup_xfail "i960-*-vxworks" 1786
709 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
710 send_gdb "backtrace 100\n"
711 if [gdb_expect_list "backtrace from call6k" ".*$gdb_prompt $" {
712 ".*\[\r\n\]#0 .* call6k \\(\\) "
713 ".*\[\r\n\]#1 .* call6j \\(ul=8\\) "
714 ".*\[\r\n\]#2 .* call6i \\(ui=7, ul=8\\) "
715 ".*\[\r\n\]#3 .* call6h \\(us=6, ui=7, ul=8\\) "
716 ".*\[\r\n\]#4 .* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\) "
717 ".*\[\r\n\]#5 .* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
718 ".*\[\r\n\]#6 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
719 ".*\[\r\n\]#7 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
720 ".*\[\r\n\]#8 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
721 ".*\[\r\n\]#9 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
722 ".*\[\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\\) "
723 ".*\[\r\n\]#11 .* main \\(.*\\) "
727 gdb_stop_suppressing_tests;
732 # Locate actual args; shuffle round robin and call
735 proc shuffle_round_robin {} {
741 global hp_cc_compiler
745 gdb_breakpoint call7a
746 gdb_breakpoint call7b
747 gdb_breakpoint call7c
748 gdb_breakpoint call7d
749 gdb_breakpoint call7e
750 gdb_breakpoint call7f
751 gdb_breakpoint call7g
752 gdb_breakpoint call7h
754 # Run; should stop at call7a and print actual arguments.
757 # The a29k fails all of these tests, perhaps because the prologue
759 setup_xfail "a29k-*-udi"
762 -re ".*Breakpoint $decimal, call7a .*$gdb_prompt $" {
765 -re "$gdb_prompt $" { fail "run to call7a" ; gdb_suppress_tests; }
766 timeout { fail "(timeout) run to call7a" ; gdb_suppress_tests; }
769 setup_xfail "i960-*-*" 1813
770 if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" "mips-sgi-irix5*" }
771 # The debug info. for "f" is not correct. It's a known bug.
772 if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
773 send_gdb "backtrace 100\n"
775 -re "backtrace 100\[\r\n\]+
776 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) .*\r
777 .* main \\(.*\\) .*\r
779 pass "backtrace from call7a"
781 -re "backtrace 100\[\r\n\]+
782 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=.*, uc=98 'b', d=5, us=6, ul=8, ui=7\\) .*\r
783 .* main \\(.*\\) .*\r
785 xfail "backtrace from call7a"
787 -re "$gdb_prompt $" { fail "backtrace from call7a" ; return }
788 timeout { fail "(timeout) backtrace from call7a" ; return }
791 # Continue; should stop at call7b and print actual arguments.
796 if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
798 send_gdb "backtrace 100\n"
799 gdb_expect_list "backtrace from call7b" ".*$gdb_prompt $" {
800 ".*\[\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'\\) "
801 ".*\[\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\\) "
802 ".*\[\r\n\]#2 .* main \\(.*\\) "
805 # Continue; should stop at call7c and print actual arguments.
810 send_gdb "backtrace 100\n"
811 gdb_expect_list "backtrace from call7c" ".*$gdb_prompt $" {
812 ".*\[\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\\) "
813 ".*\[\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'\\) "
814 ".*\[\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\\) "
815 ".*\[\r\n\]#3 .* main \\(.*\\) "
818 # Continue; should stop at call7d and print actual arguments.
823 send_gdb "backtrace 100\n"
824 gdb_expect_list "backtrace from call7d" ".*$gdb_prompt $" {
825 ".*\[\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\\) "
826 ".*\[\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\\) "
827 ".*\[\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'\\) "
828 ".*\[\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\\) "
829 ".*\[\r\n\]#4 .* main \\(.*\\) "
834 send_gdb "backtrace 100\n"
835 gdb_expect_list "backtrace from call7e" ".*$gdb_prompt $" {
836 ".*\[\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\\) "
837 ".*\[\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\\) "
838 ".*\[\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\\) "
839 ".*\[\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'\\) "
840 ".*\[\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\\) "
841 ".*\[\r\n\]#5 .* main \\(.*\\) "
844 # Continue; should stop at call7f and print actual arguments.
849 send_gdb "backtrace 100\n"
850 gdb_expect_list "backtrace from call7f" ".*$gdb_prompt $" {
851 ".*\[\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\\) "
852 ".*\[\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\\) "
853 ".*\[\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\\) "
854 ".*\[\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\\) "
855 ".*\[\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'\\) "
856 ".*\[\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\\) "
857 ".*\[\r\n\]#6 .* main \\(.*\\) "
860 # Continue; should stop at call7g and print actual arguments.
865 send_gdb "backtrace 100\n"
866 gdb_expect_list "backtrace from call7g" ".*$gdb_prompt $" {
867 ".*\[\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'\\) "
868 ".*\[\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\\) "
869 ".*\[\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\\) "
870 ".*\[\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\\) "
871 ".*\[\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\\) "
872 ".*\[\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'\\) "
873 ".*\[\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\\) "
874 ".*\[\r\n\]#7 .* main \\(.*\\) "
879 send_gdb "backtrace 100\n"
880 gdb_expect_list "backtrace from call7h" ".*$gdb_prompt $" {
881 ".*\[\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\\) "
882 ".*\[\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'\\) "
883 ".*\[\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\\) "
884 ".*\[\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\\) "
885 ".*\[\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\\) "
886 ".*\[\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\\) "
887 ".*\[\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'\\) "
888 ".*\[\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\\) "
889 ".*\[\r\n\]#8 .* main \\(.*\\) "
892 # monitor only allows 8 breakpoints; w89k board allows 10, so
893 # break them up into two groups.
895 gdb_breakpoint call7i
896 gdb_breakpoint call7j
897 gdb_breakpoint call7k
899 # Continue; should stop at call7i and print actual arguments.
904 send_gdb "backtrace 100\n"
905 gdb_expect_list "backtrace from call7i" ".*$gdb_prompt $" {
906 ".*\[\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\\) "
907 ".*\[\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\\) "
908 ".*\[\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'\\) "
909 ".*\[\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\\) "
910 ".*\[\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\\) "
911 ".*\[\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\\) "
912 ".*\[\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\\) "
913 ".*\[\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'\\) "
914 ".*\[\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\\) "
915 ".*\[\r\n\]#9 .* main \\(.*\\) "
918 # Continue; should stop at call7j and print actual arguments.
923 send_gdb "backtrace 100\n"
924 gdb_expect_list "backtrace from call7j" ".*$gdb_prompt $" {
925 ".*\[\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\\) "
926 ".*\[\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\\) "
927 ".*\[\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\\) "
928 ".*\[\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'\\) "
929 ".*\[\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\\) "
930 ".*\[\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\\) "
931 ".*\[\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\\) "
932 ".*\[\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\\) "
933 ".*\[\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'\\) "
934 ".*\[\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\\) "
935 ".*\[\r\n\]#10 .* main \\(.*\\) "
938 # Continue; should stop at call7k and print actual arguments.
943 if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix*" }
944 send_gdb "backtrace 100\n"
945 gdb_expect_list "backtrace from call7k" ".*$gdb_prompt $" {
946 ".*\[\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\\) "
947 ".*\[\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\\) "
948 ".*\[\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\\) "
949 ".*\[\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\\) "
950 ".*\[\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'\\) "
951 ".*\[\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\\) "
952 ".*\[\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\\) "
953 ".*\[\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\\) "
954 ".*\[\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\\) "
955 ".*\[\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'\\) "
956 ".*\[\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\\) "
957 ".*\[\r\n\]#11 .* main \\(.*\\) "
959 gdb_stop_suppressing_tests;
963 # Locate actual args; recursive passing of structs by value
966 proc recursive_structs_by_value {} {
974 gdb_breakpoint hitbottom
976 # Run; should stop at hitbottom and print actual arguments.
980 -re ".*Breakpoint $decimal, hitbottom .*$gdb_prompt $" { pass "run to hitbottom" }
981 -re "$gdb_prompt $" { fail "run to hitbottom" ; gdb_suppress_tests; }
982 timeout { fail "(timeout) run to hitbottom" ; gdb_suppress_tests; }
985 if ![istarget sparclet-*-*] {
986 # The a29k fails all of these tests, perhaps because the prologue
988 setup_xfail "a29k-*-udi"
989 send_gdb "backtrace 100\n"
990 gdb_expect_list "recursive passing of structs by value" ".*$gdb_prompt $" {
991 ".*\[\r\n\]#0 .* hitbottom \\(\\) "
992 ".*\[\r\n\]#1 .* recurse \\(a=\{s = 0, i = 0, l = 0\}, depth=0\\) "
993 ".*\[\r\n\]#2 .* recurse \\(a=\{s = 1, i = 1, l = 1\}, depth=1\\) "
994 ".*\[\r\n\]#3 .* recurse \\(a=\{s = 2, i = 2, l = 2\}, depth=2\\) "
995 ".*\[\r\n\]#4 .* recurse \\(a=\{s = 3, i = 3, l = 3\}, depth=3\\) "
996 ".*\[\r\n\]#5 .* recurse \\(a=\{s = 4, i = 4, l = 4\}, depth=4\\) "
997 ".*\[\r\n\]#6 .* test_struct_args \\(\\) "
998 ".*\[\r\n\]#7 .* main \\(.*\\) "
1001 fail "recursive passing of structs by value (sparclet)"
1003 gdb_stop_suppressing_tests;
1006 proc funcargs_reload { } {
1012 if [istarget "mips-idt-*"] {
1013 # Restart because IDT/SIM runs out of file descriptors.
1016 gdb_reinitialize_dir $srcdir/$subdir
1022 # Test for accessing local stack variables in functions which call alloca
1024 proc localvars_after_alloca { } {
1030 if { ! [ runto localvars_after_alloca ] } then { gdb_suppress_tests; }
1032 # Print each arg as a double check to see if we can print
1033 # them here as well as with backtrace.
1035 if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
1036 gdb_test "print c" " = 97 'a'" "print c after runto localvars_after_alloca"
1037 if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
1038 gdb_test "print s" " = 1" "print s after runto localvars_after_alloca"
1039 gdb_test "print i" " = 2" "print i after runto localvars_after_alloca"
1040 gdb_test "print l" " = 3" "print l after runto localvars_after_alloca"
1043 gdb_test "next" ".*" "next in localvars_after_alloca()"
1045 # Print each arg as a double check to see if we can print
1046 # them here as well as with backtrace.
1048 gdb_test "print c" " = 97 'a'" "print c in localvars_after_alloca"
1049 gdb_test "print s" " = 1" "print s in localvars_after_alloca"
1050 gdb_test "print i" " = 2" "print i in localvars_after_alloca"
1051 gdb_test "print l" " = 3" "print l in localvars_after_alloca"
1053 gdb_test "backtrace 8" "#0.*localvars_after_alloca \\(c=97 'a', s=1, i=2, l=3\\).*#1.*main.*" "backtrace after alloca"
1054 gdb_stop_suppressing_tests;
1057 proc call_after_alloca { } {
1063 if { ! [ runto call_after_alloca_subr ] } then { gdb_suppress_tests; }
1065 # Print each arg as a double check to see if we can print
1066 # them here as well as with backtrace.
1068 if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
1069 gdb_test "print c" " = 97 'a'" "print c in call_after_alloca"
1070 if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
1071 gdb_test "print s" " = 1" "print s in call_after_alloca"
1072 gdb_test "print i" " = 2" "print i in call_after_alloca"
1073 gdb_test "print l" " = 3" "print l in call_after_alloca"
1075 if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
1076 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"
1077 gdb_stop_suppressing_tests;
1081 # Test for accessing local stack variables, backtraces, finish,
1082 # and finally stepping into indirect calls. The point is that on the PA
1083 # these use a funky `dyncall' mechanism which GDB needs to know about.
1085 proc localvars_in_indirect_call { } {
1091 # Can not use "runto call0a" as call0a is called several times
1092 # during single run. Instead stop in a marker function and
1093 # take control from there.
1094 if { ! [ runto marker_indirect_call ] } then { gdb_suppress_tests; }
1096 # break on the next call to call0a, then delete all the breakpoints
1097 # and start testing.
1098 gdb_breakpoint call0a
1102 # Print each arg as a double check to see if we can print
1103 # them here as well as with backtrace.
1105 if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
1106 gdb_test "print c" " = 97 'a'" "print c in localvars_in_indirect_call"
1107 if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
1108 gdb_test "print s" " = 1" "print s in localvars_in_indirect_call"
1109 gdb_test "print i" " = 2" "print i in localvars_in_indirect_call"
1110 gdb_test "print l" " = 3" "print l in localvars_in_indirect_call"
1112 if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
1113 gdb_test "backtrace 8" \
1114 "#0.*call0a \\(c=97 'a', s=1, i=2, l=3\\).*#1.*main.*" \
1115 "backtrace in indirectly called function"
1118 # "finish" brings us back to main. We then will try to step through
1119 # the second indirect call.
1120 # On some targets (e.g. m68k) gdb will stop from the finish in midline
1121 # of the first indirect call. This is due to stack adjustment instructions
1122 # after the indirect call. In these cases we will step till we hit the
1123 # second indirect call.
1128 -re "\\(\\*pointer_to_call0a\\) \\(c, s, i, l\\);.*First.*$gdb_prompt $" {
1129 #On hppa2.0w-hp-hpux11.00, gdb finishes at one line earlier than
1130 #hppa1.1-hp-hpux11.00. Therefore, an extra "step" is necessary to continue the test.
1134 -re ".*\\(\\*pointer_to_call0a\\) \\(c, s, i, l\\);.*Second.*$gdb_prompt $" {
1135 pass "finish from indirectly called function"
1137 -re ".*$gdb_prompt $" {
1138 fail "finish from indirectly called function"
1141 default { fail "finish from indirectly called function" ; gdb_suppress_tests; }
1144 if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
1145 gdb_test "step" "call0a \\(c=97 'a', s=1, i=2, l=3\\).*" \
1146 "stepping into indirectly called function"
1147 gdb_stop_suppressing_tests;
1151 # Test for stepping into indirect calls which may have trampolines (possibly
1152 # cascaded) on both the call path and the gdb_suppress_tests; path.
1153 # to handle trampolines.
1155 proc test_stepping_over_trampolines { } {
1160 # Stop in a marker function and take control from there.
1161 if { ! [ runto marker_call_with_trampolines ] } then { gdb_suppress_tests; }
1163 # Cater for gdb stopping in midline, see comment for finish above.
1166 -re "marker_call_with_trampolines ..;.*$gdb_prompt $" {
1170 -re "pointer_to_call_with_trampolines.*$gdb_prompt $" {
1171 pass "finish from marker_call_with_trampolines"
1173 -re ".*$gdb_prompt $" {
1174 fail "finish from marker_call_with_trampolines"
1176 default { fail "finish from marker_call_with_trampolines" ; gdb_suppress_tests; }
1179 # Try to step into the target function.
1180 gdb_test "step" "call_with_trampolines \\(d1=5\\).*" \
1181 "stepping into function called with trampolines"
1183 # Make we can backtrace and the argument looks correct. */
1184 gdb_test "backtrace 8" "#0.*call_with_trampolines \\(d1=5\\).*1.*main.*" \
1185 "backtrace through call with trampolines"
1187 # Make sure we can get back to main.
1188 # Stepping back to main might stop again after the gdb_suppress_tests; statement
1189 # or immediately transfer control back to main if optimizations
1193 -re "main .* at.*$gdb_prompt $" {
1194 pass "stepping back to main from function called with trampolines" ;
1197 -re "\}.*End of call_with_trampolines.*$gdb_prompt $" {
1201 -re ".*$gdb_prompt $" {
1202 fail "stepping back to main from function called with trampolines"
1204 default { fail "stepping back to main from function called with trampolines" ; gdb_suppress_tests; }
1206 gdb_stop_suppressing_tests;
1209 # Start with a fresh gdb.
1213 gdb_reinitialize_dir $srcdir/$subdir
1216 if [istarget "mips*tx39-*"] {
1218 } elseif [istarget "hppa*-hp-hpux*"] then {
1224 # Determine expected output for unsigned long variables,
1225 # the output varies with sizeof (unsigned long).
1227 set target_sizeof_long 4
1228 send_gdb "print sizeof (long)\n"
1230 -re ".\[0-9\]* = 4.*$gdb_prompt $" { }
1231 -re ".\[0-9\]* = 8.*$gdb_prompt $" { set target_sizeof_long 8 }
1232 -re ".*$gdb_prompt $" {
1233 fail "getting sizeof long"
1235 default { fail "(timeout) getting sizeof long" }
1238 set target_sizeof_int 4
1239 send_gdb "print sizeof (int)\n"
1241 -re ".\[0-9\]* = 2.*$gdb_prompt $" { set target_sizeof_int 2 }
1242 -re ".\[0-9\]* = 4.*$gdb_prompt $" { }
1243 -re ".\[0-9\]* = 8.*$gdb_prompt $" { set target_sizeof_int 8 }
1244 -re ".*$gdb_prompt $" {
1245 fail "getting sizeof unsigned long"
1247 default { fail "(timeout) getting sizeof int" }
1250 set target_bigendian_p 1
1251 send_gdb "show endian\n"
1253 -re ".*little endian.*$gdb_prompt $" { set target_bigendian_p 0 }
1254 -re ".*big endian.*$gdb_prompt $" { }
1255 -re ".*$gdb_prompt $" {
1256 fail "getting target endian"
1258 default { fail "(timeout) getting target endian" }
1265 unsigned_integral_args
1267 if {![target_info exists gdb,skip_float_tests]} {
1268 float_and_integral_args
1273 structs_by_reference
1281 recursive_structs_by_value
1283 localvars_after_alloca
1287 localvars_in_indirect_call
1289 test_stepping_over_trampolines