* lib/gdb.exp (gdb_test_sequence): Return result of gdb_expect_list.

(gdb_expect_list): Fix spelling errors in comments.
	* gdb.arch/system-gcore.exp: Use gdb_test_sequence instead of
	send_gdb/gdb_expect_list where applicable.
	* gdb.base/call-ar-st.exp: Ditto.
	* gdb.base/funcargs.exp: Ditto.
	* gdb.base/gcore.exp: Ditto.
	* gdb.base/page.exp: Ditto.
	* gdb.base/sigaltstack.exp: Ditto.
	* gdb.base/siginfo.exp: Ditto.
	* gdb.base/sigstep.exp: Ditto.
	* gdb.base/trace-commands.exp: Ditto.
This commit is contained in:
Doug Evans 2010-11-30 17:41:14 +00:00
parent c3e5cf5f4d
commit 5fa290c134
11 changed files with 256 additions and 279 deletions

View file

@ -1,3 +1,18 @@
2010-11-30 Doug Evans <dje@google.com>
* lib/gdb.exp (gdb_test_sequence): Return result of gdb_expect_list.
(gdb_expect_list): Fix spelling errors in comments.
* gdb.arch/system-gcore.exp: Use gdb_test_sequence instead of
send_gdb/gdb_expect_list where applicable.
* gdb.base/call-ar-st.exp: Ditto.
* gdb.base/funcargs.exp: Ditto.
* gdb.base/gcore.exp: Ditto.
* gdb.base/page.exp: Ditto.
* gdb.base/sigaltstack.exp: Ditto.
* gdb.base/siginfo.exp: Ditto.
* gdb.base/sigstep.exp: Ditto.
* gdb.base/trace-commands.exp: Ditto.
2010-11-29 Doug Evans <dje@google.com> 2010-11-29 Doug Evans <dje@google.com>
* gdb.python/py-pp-maint.exp: Change printer-name:subprinter-name to * gdb.python/py-pp-maint.exp: Change printer-name:subprinter-name to

View file

@ -154,17 +154,16 @@ gdb_expect {
} }
} }
send_gdb "where\n" gdb_test_sequence "where" "where in corefile" {
gdb_expect_list "where in corefile" ".*$gdb_prompt $" { "\[\r\n\]+#0 .* terminal_func \\(\\) at "
".*\[\r\n\]+#0 .* terminal_func \\(\\) at " "\[\r\n\]+#1 .* array_func \\(\\) at "
".*\[\r\n\]+#1 .* array_func \\(\\) at " "\[\r\n\]+#2 .* factorial_func \\(value=1\\) at "
".*\[\r\n\]+#2 .* factorial_func \\(value=1\\) at " "\[\r\n\]+#3 .* factorial_func \\(value=2\\) at "
".*\[\r\n\]+#3 .* factorial_func \\(value=2\\) at " "\[\r\n\]+#4 .* factorial_func \\(value=3\\) at "
".*\[\r\n\]+#4 .* factorial_func \\(value=3\\) at " "\[\r\n\]+#5 .* factorial_func \\(value=4\\) at "
".*\[\r\n\]+#5 .* factorial_func \\(value=4\\) at " "\[\r\n\]+#6 .* factorial_func \\(value=5\\) at "
".*\[\r\n\]+#6 .* factorial_func \\(value=5\\) at " "\[\r\n\]+#7 .* factorial_func \\(value=6\\) at "
".*\[\r\n\]+#7 .* factorial_func \\(value=6\\) at " "\[\r\n\]+#8 .* main \\(.*\\) at "
".*\[\r\n\]+#8 .* main \\(.*\\) at "
} }
set post_corefile_regs [capture_command_output "info registers" ""] set post_corefile_regs [capture_command_output "info registers" ""]

View file

@ -86,21 +86,19 @@ gdb_test continue \
#call print_double_array(double_array) #call print_double_array(double_array)
if {![gdb_skip_float_test "print print_double_array(double_array)"] && \ if {![gdb_skip_float_test "print print_double_array(double_array)"] && \
![gdb_skip_stdio_test "print print_double_array(double_array)"] } { ![gdb_skip_stdio_test "print print_double_array(double_array)"] } {
send_gdb "print print_double_array(double_array)\n" gdb_test_sequence "print print_double_array(double_array)" "" {
gdb_expect_list "print print_double_array(double_array)" ".*$gdb_prompt $" {
"\[ \t\r\n\]+array_d :" "\[ \t\r\n\]+array_d :"
"\[ \t\r\n\]+=========" "\[ \t\r\n\]+========="
"\[ \t\r\n\]+0.000000" "\[ \t\r\n\]+0.000000"
"\[ \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\]+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\]+" "\[ \t\r\n\]+"
} }
} }
#call print_char_array(char_array) #call print_char_array(char_array)
if ![gdb_skip_stdio_test "print_char_array(char_array)"] { if ![gdb_skip_stdio_test "print_char_array(char_array)"] {
send_gdb "print print_char_array(char_array)\n" gdb_test_sequence "print print_char_array(char_array)" "" {
gdb_expect_list "print print_char_array(char_array)" ".*$gdb_prompt $" {
"\[ \t\r\n\]+array_c :" "\[ \t\r\n\]+array_c :"
"\[ \t\r\n\]+=========" "\[ \t\r\n\]+========="
"\[ \t\r\n\]+\[ \t\r\n\]+Z" "\[ \t\r\n\]+\[ \t\r\n\]+Z"
@ -110,17 +108,13 @@ if ![gdb_skip_stdio_test "print_char_array(char_array)"] {
} }
} }
#go -until 1216 #go -until 1216
gdb_test "tbreak 1216" \ gdb_test "tbreak 1216" \
"Temporary breakpoint.*file.*$srcfile, line 1216.*" \ "Temporary breakpoint.*file.*$srcfile, line 1216.*" \
"tbreakpoint line 1216" "tbreakpoint line 1216"
if ![gdb_skip_stdio_test "continue to 1216"] { if ![gdb_skip_stdio_test "continue to 1216"] {
send_gdb "continue\n" gdb_test_sequence "continue" "continue to 1216" {
gdb_expect_list "continue to 1216" ".*$gdb_prompt $" {
"\[ \t\r\n\]+array_c :" "\[ \t\r\n\]+array_c :"
"\[ \t\r\n\]+=========" "\[ \t\r\n\]+========="
"\[ \t\r\n\]+\[ \t\r\n\]+Z" "\[ \t\r\n\]+\[ \t\r\n\]+Z"
@ -154,18 +148,17 @@ gdb_test "tbreak 1220" \
if {![gdb_skip_float_test "continuing to breakpoint 1220"] && \ if {![gdb_skip_float_test "continuing to breakpoint 1220"] && \
![gdb_skip_stdio_test "continuing to breakpoint 1220"] } { ![gdb_skip_stdio_test "continuing to breakpoint 1220"] } {
send_gdb "continue\n" gdb_test_sequence "continue" "continuing to breakpoint 1220" {
gdb_expect_list "continuing to breakpoint 1220" ".*$gdb_prompt $" {
"Continuing\\." "Continuing\\."
"\[ \t\r\n\]+array_d :" "\[ \t\r\n\]+array_d :"
"\[ \t\r\n\]+=========" "\[ \t\r\n\]+========="
"\[ \t\r\n\]+0.000000" "\[ \t\r\n\]+0.000000"
"\[ \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\]+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\]+" "\[ \t\r\n\]+"
".*array_f :" "array_f :"
".*student id :\[\t \]+.*YELLOW" "student id :\[\t \]+.*YELLOW"
".*array_i :" "array_i :"
".*main \\(\\) at .*call-ar-st.c:1220\[ \t\r\n\]+.*print_all_arrays\\(integer_array, char_array, float_array, double_array\\)." "main \\(\\) at .*call-ar-st.c:1220\[ \t\r\n\]+.*print_all_arrays\\(integer_array, char_array, float_array, double_array\\)."
} }
} else { } else {
gdb_test "continue" ".*" "" gdb_test "continue" ".*" ""
@ -188,8 +181,7 @@ if ![gdb_skip_stdio_test "next over print_int_array in print_all_arrays"] {
#call print_double_array(array_d) #call print_double_array(array_d)
if {![gdb_skip_float_test "print print_double_array(array_d)"] && \ if {![gdb_skip_float_test "print print_double_array(array_d)"] && \
![gdb_skip_stdio_test "print print_double_array(array_d)"] } { ![gdb_skip_stdio_test "print print_double_array(array_d)"] } {
send_gdb "print print_double_array(array_d)\n" gdb_test_sequence "print print_double_array(array_d)" "" {
gdb_expect_list "print print_double_array(array_d)" ".*$gdb_prompt $" {
"array_d :" "array_d :"
"\[ \t\r\n\]+=========" "\[ \t\r\n\]+========="
"\[ \t\r\n\]+\[ \t\r\n\]+0.000000" "\[ \t\r\n\]+\[ \t\r\n\]+0.000000"
@ -205,10 +197,9 @@ gdb_test "tbreak 1236" \
if {![gdb_skip_float_test "continuing to 1236"] && \ if {![gdb_skip_float_test "continuing to 1236"] && \
![gdb_skip_stdio_test "continuing to 1236"] } { ![gdb_skip_stdio_test "continuing to 1236"] } {
send_gdb "continue\n" gdb_test_sequence "continue" "continuing to 1236" {
gdb_expect_list "continuing to 1236" ".*$gdb_prompt $" {
"Continuing\\..*array_c" "Continuing\\..*array_c"
".*array_f" "array_f"
"\[ \t\r\n\]+array_d :" "\[ \t\r\n\]+array_d :"
"\[ \t\r\n\]+=========" "\[ \t\r\n\]+========="
"\[ \t\r\n\]+0.000000" "\[ \t\r\n\]+0.000000"
@ -304,8 +295,7 @@ if ![gdb_skip_stdio_test "continuing to 1281"] {
if {![gdb_skip_float_test "print print_small_structs(...)"] && \ if {![gdb_skip_float_test "print print_small_structs(...)"] && \
![gdb_skip_stdio_test "print print_small_structs(...)"] } { ![gdb_skip_stdio_test "print print_small_structs(...)"] } {
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_test_sequence "print print_small_structs(*struct1, *struct2, *struct3, *struct4, *flags, *flags_combo, *three_char, *five_char, *int_char_combo, *d1, *d2, *d3, *f1, *f2, *f3)" "print print_small_structs" {
gdb_expect_list "print print_small_structs" ".*$gdb_prompt $" {
"\[\t\r\n \]+alpha" "\[\t\r\n \]+alpha"
"\[\t\r\n \]+gamma" "\[\t\r\n \]+gamma"
"\[\t\r\n \]+epsilon" "\[\t\r\n \]+epsilon"
@ -353,8 +343,7 @@ gdb_test "print compute_with_small_structs(20)" \
if {![gdb_skip_float_test "print print_ten_doubles(...)"] && \ if {![gdb_skip_float_test "print print_ten_doubles(...)"] && \
![gdb_skip_stdio_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_test_sequence "print print_ten_doubles(123.456, 123.456, -0.12, -1.23, 343434.8, 89.098, 3.14, -5678.12345, -0.11111111, 216.97065)" "print print_ten_doubles" {
gdb_expect_list "print print_ten_doubles" ".*$gdb_prompt $" {
"\[\t\r\n \]+Two Doubles : 123.45\[0-9\]*.*123.45\[0-9\]*" "\[\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 : -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 : 343434.\[0-9\]*.*89.09\[0-9\]*"
@ -428,8 +417,7 @@ if {![gdb_skip_float_test "print_small_structs from print_long_arg_list"] && \
setup_kfail "gdb/1539" "sparc-*-*" 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_test_sequence "print print_small_structs(struct1, struct2, struct3, struct4, flags, flags_combo, three_char, five_char, int_char_combo, d1, d2, d3, f1, f2, f3)" "print print_small_structs from print_long_arg_list" {
gdb_expect_list "print print_small_structs from print_long_arg_list" ".*$gdb_prompt $" {
"\[\t\r\n \]+alpha" "\[\t\r\n \]+alpha"
"\[\t\r\n \]+gamma" "\[\t\r\n \]+gamma"
"\[\t\r\n \]+epsilon" "\[\t\r\n \]+epsilon"
@ -510,8 +498,7 @@ if {$hp_aCC_compiler} {setup_xfail "hppa*-*-*" CLLbs16994}
if {![gdb_skip_float_test "print print_long_arg_list"] && \ if {![gdb_skip_float_test "print print_long_arg_list"] && \
![gdb_skip_stdio_test "print print_long_arg_list"] } { ![gdb_skip_stdio_test "print print_long_arg_list"] } {
send_gdb "print print_long_arg_list(a, b, c, d, e, f, *struct1, *struct2, *struct3, *struct4, *flags, *flags_combo, *three_char, *five_char, *int_char_combo, *d1, *d2, *d3, *f1, *f2, *f3)\n" gdb_test_sequence "print print_long_arg_list(a, b, c, d, e, f, *struct1, *struct2, *struct3, *struct4, *flags, *flags_combo, *three_char, *five_char, *int_char_combo, *d1, *d2, *d3, *f1, *f2, *f3)" "print print_long_arg_list" {
gdb_expect_list "print print_long_arg_list" ".*$gdb_prompt $" {
"\[ \n\r\t\]+double : 22.250000" "\[ \n\r\t\]+double : 22.250000"
"\[ \n\r\t\]+double : 33.375000" "\[ \n\r\t\]+double : 33.375000"
"\[ \n\r\t\]+int : 0" "\[ \n\r\t\]+int : 0"
@ -571,9 +558,8 @@ if ![gdb_skip_stdio_test "print sum_struct_print(...)"] {
#call print_struct_rep(*struct1, *struct2, *struct3) #call print_struct_rep(*struct1, *struct2, *struct3)
if ![gdb_skip_stdio_test "print print_struct_rep(...)"] { if ![gdb_skip_stdio_test "print print_struct_rep(...)"] {
send_gdb "print print_struct_rep(*struct1, *struct2, *struct3)\n" gdb_test_sequence "print print_struct_rep(*struct1, *struct2, *struct3)" \
gdb_expect_list "print print_struct_rep(*struct1, *struct2, *struct3)" \ "print print_struct_rep(*struct1, *struct2, *struct3)" {
".*$gdb_prompt $" {
"\[ \t\n\r\]+Contents of struct1:" "\[ \t\n\r\]+Contents of struct1:"
"\[ \t\n\r\]+ 22 0" "\[ \t\n\r\]+ 22 0"
"\[ \t\n\r\]+Contents of struct2:" "\[ \t\n\r\]+Contents of struct2:"

View file

@ -469,11 +469,10 @@ proc discard_and_shuffle {} {
gdb_continue call6b gdb_continue call6b
send_gdb "backtrace 100\n" if [gdb_test_sequence "backtrace 100" "backtrace from call6b" {
if [gdb_expect_list "backtrace from call6b" ".*$gdb_prompt $" { "\[\r\n\]#0 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#0 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#1 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#1 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#2 .* main \\(.*\\) at "
".*\[\r\n\]#2 .* main \\(.*\\) "
} ] { } ] {
gdb_suppress_tests; gdb_suppress_tests;
} }
@ -483,12 +482,11 @@ proc discard_and_shuffle {} {
gdb_continue call6c gdb_continue call6c
send_gdb "backtrace 100\n" if [gdb_test_sequence "backtrace 100" "backtrace from call6c" {
if [gdb_expect_list "backtrace from call6c" ".*$gdb_prompt $" { "\[\r\n\]#0 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#0 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#1 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#1 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#2 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#2 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#3 .* main \\(.*\\) at "
".*\[\r\n\]#3 .* main \\(.*\\) "
} ] { } ] {
gdb_suppress_tests; gdb_suppress_tests;
} }
@ -497,13 +495,12 @@ proc discard_and_shuffle {} {
gdb_continue call6d gdb_continue call6d
send_gdb "backtrace 100\n" if [gdb_test_sequence "backtrace 100" "backtrace from call6d" {
if [gdb_expect_list "backtrace from call6d" ".*$gdb_prompt $" { "\[\r\n\]#0 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#0 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#1 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#1 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#2 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#2 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#3 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#3 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#4 .* main \\(.*\\) at "
".*\[\r\n\]#4 .* main \\(.*\\) "
} ] { } ] {
gdb_suppress_tests; gdb_suppress_tests;
} }
@ -513,14 +510,13 @@ proc discard_and_shuffle {} {
gdb_continue call6e gdb_continue call6e
send_gdb "backtrace 100\n" if [gdb_test_sequence "backtrace 100" "backtrace from call6e" {
if [gdb_expect_list "backtrace from call6e" ".*$gdb_prompt $" { "\[\r\n\]#0 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#0 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#1 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#1 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#2 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#2 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#3 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#3 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#4 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#4 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#5 .* main \\(.*\\) at "
".*\[\r\n\]#5 .* main \\(.*\\) "
} ] { } ] {
gdb_suppress_tests; gdb_suppress_tests;
} }
@ -530,15 +526,14 @@ proc discard_and_shuffle {} {
gdb_continue call6f gdb_continue call6f
send_gdb "backtrace 100\n" if [gdb_test_sequence "backtrace 100" "backtrace from call6f" {
if [gdb_expect_list "backtrace from call6f" ".*$gdb_prompt $" { "\[\r\n\]#0 .* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#0 .* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#1 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#1 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#2 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#2 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#3 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#3 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#4 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#4 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#5 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#5 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#6 .* main \\(.*\\) at "
".*\[\r\n\]#6 .* main \\(.*\\) "
} ] { } ] {
gdb_suppress_tests; gdb_suppress_tests;
} }
@ -548,16 +543,15 @@ proc discard_and_shuffle {} {
gdb_continue call6g gdb_continue call6g
send_gdb "backtrace 100\n" if [gdb_test_sequence "backtrace 100" "backtrace from call6g" {
if [gdb_expect_list "backtrace from call6g" ".*$gdb_prompt $" { "\[\r\n\]#0 .* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#0 .* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#1 .* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#1 .* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#2 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#2 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#3 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#3 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#4 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#4 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#5 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#5 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#6 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#6 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#7 .* main \\(.*\\) at "
".*\[\r\n\]#7 .* main \\(.*\\) "
} ] { } ] {
gdb_suppress_tests; gdb_suppress_tests;
} }
@ -567,17 +561,16 @@ proc discard_and_shuffle {} {
gdb_continue call6h gdb_continue call6h
send_gdb "backtrace 100\n" if [gdb_test_sequence "backtrace 100" "backtrace from call6h" {
if [gdb_expect_list "backtrace from call6h" ".*$gdb_prompt $" { "\[\r\n\]#0 .* call6h \\(us=6, ui=7, ul=8\\) "
".*\[\r\n\]#0 .* call6h \\(us=6, ui=7, ul=8\\) " "\[\r\n\]#1 .* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#1 .* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#2 .* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#2 .* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#3 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#3 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#4 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#4 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#5 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#5 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#6 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#6 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#7 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#7 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#8 .* main \\(.*\\) at "
".*\[\r\n\]#8 .* main \\(.*\\) "
} ] { } ] {
gdb_suppress_tests; gdb_suppress_tests;
} }
@ -594,18 +587,17 @@ proc discard_and_shuffle {} {
gdb_continue call6i gdb_continue call6i
send_gdb "backtrace 100\n" if [gdb_test_sequence "backtrace 100" "backtrace from call6i" {
if [gdb_expect_list "backtrace from call6i" ".*$gdb_prompt $" { "\[\r\n\]#0 .* call6i \\(ui=7, ul=8\\) "
".*\[\r\n\]#0 .* call6i \\(ui=7, ul=8\\) " "\[\r\n\]#1 .* call6h \\(us=6, ui=7, ul=8\\) "
".*\[\r\n\]#1 .* call6h \\(us=6, ui=7, ul=8\\) " "\[\r\n\]#2 .* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#2 .* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#3 .* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#3 .* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#4 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#4 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#5 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#5 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#6 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#6 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#7 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#7 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#8 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#8 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#9 .* main \\(.*\\) at "
".*\[\r\n\]#9 .* main \\(.*\\) "
} ] { } ] {
gdb_suppress_tests; gdb_suppress_tests;
} }
@ -615,19 +607,18 @@ proc discard_and_shuffle {} {
gdb_continue call6j gdb_continue call6j
send_gdb "backtrace 100\n" if [gdb_test_sequence "backtrace 100" "backtrace from call6j" {
if [gdb_expect_list "backtrace from call6j" ".*$gdb_prompt $" { "\[\r\n\]#0 .* call6j \\(ul=8\\) "
".*\[\r\n\]#0 .* call6j \\(ul=8\\) " "\[\r\n\]#1 .* call6i \\(ui=7, ul=8\\) "
".*\[\r\n\]#1 .* call6i \\(ui=7, ul=8\\) " "\[\r\n\]#2 .* call6h \\(us=6, ui=7, ul=8\\) "
".*\[\r\n\]#2 .* call6h \\(us=6, ui=7, ul=8\\) " "\[\r\n\]#3 .* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#3 .* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#4 .* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#4 .* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#5 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#5 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#6 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#6 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#7 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#7 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#8 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#8 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#9 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#9 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#10 .* main \\(.*\\) at "
".*\[\r\n\]#10 .* main \\(.*\\) "
} ] { } ] {
gdb_suppress_tests; gdb_suppress_tests;
} }
@ -636,20 +627,19 @@ proc discard_and_shuffle {} {
# Print backtrace. # Print backtrace.
gdb_continue call6k gdb_continue call6k
send_gdb "backtrace 100\n" if [gdb_test_sequence "backtrace 100" "backtrace from call6k" {
if [gdb_expect_list "backtrace from call6k" ".*$gdb_prompt $" { "\[\r\n\]#0 .* call6k \\(\\) "
".*\[\r\n\]#0 .* call6k \\(\\) " "\[\r\n\]#1 .* call6j \\(ul=8\\) "
".*\[\r\n\]#1 .* call6j \\(ul=8\\) " "\[\r\n\]#2 .* call6i \\(ui=7, ul=8\\) "
".*\[\r\n\]#2 .* call6i \\(ui=7, ul=8\\) " "\[\r\n\]#3 .* call6h \\(us=6, ui=7, ul=8\\) "
".*\[\r\n\]#3 .* call6h \\(us=6, ui=7, ul=8\\) " "\[\r\n\]#4 .* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#4 .* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#5 .* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#5 .* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#6 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#6 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#7 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#7 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#8 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#8 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#9 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#9 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#10 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
".*\[\r\n\]#10 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) " "\[\r\n\]#11 .* main \\(.*\\) at "
".*\[\r\n\]#11 .* main \\(.*\\) "
} ] { } ] {
gdb_suppress_tests; gdb_suppress_tests;
} }
@ -708,11 +698,10 @@ proc shuffle_round_robin {} {
if {$gcc_compiled} then { setup_xfail "rs6000-*-*" } if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
send_gdb "backtrace 100\n" gdb_test_sequence "backtrace 100" "backtrace from call7b" {
gdb_expect_list "backtrace from call7b" ".*$gdb_prompt $" { "\[\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'\\) "
".*\[\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'\\) " "\[\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\\) "
".*\[\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\\) " "\[\r\n\]#2 .* main \\(.*\\) at "
".*\[\r\n\]#2 .* main \\(.*\\) "
} }
# Continue; should stop at call7c and print actual arguments. # Continue; should stop at call7c and print actual arguments.
@ -720,12 +709,11 @@ proc shuffle_round_robin {} {
gdb_continue call7c gdb_continue call7c
send_gdb "backtrace 100\n" gdb_test_sequence "backtrace 100" "backtrace from call7c" {
gdb_expect_list "backtrace from call7c" ".*$gdb_prompt $" { "\[\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\\) "
".*\[\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\\) " "\[\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'\\) "
".*\[\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'\\) " "\[\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\\) "
".*\[\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\\) " "\[\r\n\]#3 .* main \\(.*\\) at "
".*\[\r\n\]#3 .* main \\(.*\\) "
} }
# Continue; should stop at call7d and print actual arguments. # Continue; should stop at call7d and print actual arguments.
@ -733,25 +721,23 @@ proc shuffle_round_robin {} {
gdb_continue call7d gdb_continue call7d
send_gdb "backtrace 100\n" gdb_test_sequence "backtrace 100" "backtrace from call7d" {
gdb_expect_list "backtrace from call7d" ".*$gdb_prompt $" { "\[\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\\) "
".*\[\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\\) " "\[\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\\) "
".*\[\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\\) " "\[\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'\\) "
".*\[\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'\\) " "\[\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\\) "
".*\[\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\\) " "\[\r\n\]#4 .* main \\(.*\\) at "
".*\[\r\n\]#4 .* main \\(.*\\) "
} }
gdb_continue call7e gdb_continue call7e
send_gdb "backtrace 100\n" gdb_test_sequence "backtrace 100" "backtrace from call7e" {
gdb_expect_list "backtrace from call7e" ".*$gdb_prompt $" { "\[\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\\) "
".*\[\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\\) " "\[\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\\) "
".*\[\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\\) " "\[\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\\) "
".*\[\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\\) " "\[\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'\\) "
".*\[\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'\\) " "\[\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\\) "
".*\[\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\\) " "\[\r\n\]#5 .* main \\(.*\\) at "
".*\[\r\n\]#5 .* main \\(.*\\) "
} }
# Continue; should stop at call7f and print actual arguments. # Continue; should stop at call7f and print actual arguments.
@ -759,15 +745,14 @@ proc shuffle_round_robin {} {
gdb_continue call7f gdb_continue call7f
send_gdb "backtrace 100\n" gdb_test_sequence "backtrace 100" "backtrace from call7f" {
gdb_expect_list "backtrace from call7f" ".*$gdb_prompt $" { "\[\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\\) "
".*\[\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\\) " "\[\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\\) "
".*\[\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\\) " "\[\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\\) "
".*\[\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\\) " "\[\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\\) "
".*\[\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\\) " "\[\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'\\) "
".*\[\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'\\) " "\[\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\\) "
".*\[\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\\) " "\[\r\n\]#6 .* main \\(.*\\) at "
".*\[\r\n\]#6 .* main \\(.*\\) "
} }
# Continue; should stop at call7g and print actual arguments. # Continue; should stop at call7g and print actual arguments.
@ -775,31 +760,29 @@ proc shuffle_round_robin {} {
gdb_continue call7g gdb_continue call7g
send_gdb "backtrace 100\n" gdb_test_sequence "backtrace 100" "backtrace from call7g" {
gdb_expect_list "backtrace from call7g" ".*$gdb_prompt $" { "\[\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'\\) "
".*\[\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'\\) " "\[\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\\) "
".*\[\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\\) " "\[\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\\) "
".*\[\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\\) " "\[\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\\) "
".*\[\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\\) " "\[\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\\) "
".*\[\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\\) " "\[\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'\\) "
".*\[\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'\\) " "\[\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\\) "
".*\[\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\\) " "\[\r\n\]#7 .* main \\(.*\\) at "
".*\[\r\n\]#7 .* main \\(.*\\) "
} }
gdb_continue call7h gdb_continue call7h
send_gdb "backtrace 100\n" gdb_test_sequence "backtrace 100" "backtrace from call7h" {
gdb_expect_list "backtrace from call7h" ".*$gdb_prompt $" { "\[\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\\) "
".*\[\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\\) " "\[\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'\\) "
".*\[\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'\\) " "\[\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\\) "
".*\[\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\\) " "\[\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\\) "
".*\[\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\\) " "\[\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\\) "
".*\[\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\\) " "\[\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\\) "
".*\[\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\\) " "\[\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'\\) "
".*\[\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'\\) " "\[\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\\) "
".*\[\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\\) " "\[\r\n\]#8 .* main \\(.*\\) at "
".*\[\r\n\]#8 .* main \\(.*\\) "
} }
# monitor only allows 8 breakpoints; w89k board allows 10, so # monitor only allows 8 breakpoints; w89k board allows 10, so
@ -814,18 +797,17 @@ proc shuffle_round_robin {} {
gdb_continue call7i gdb_continue call7i
send_gdb "backtrace 100\n" gdb_test_sequence "backtrace 100" "backtrace from call7i" {
gdb_expect_list "backtrace from call7i" ".*$gdb_prompt $" { "\[\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\\) "
".*\[\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\\) " "\[\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\\) "
".*\[\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\\) " "\[\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'\\) "
".*\[\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'\\) " "\[\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\\) "
".*\[\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\\) " "\[\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\\) "
".*\[\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\\) " "\[\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\\) "
".*\[\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\\) " "\[\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\\) "
".*\[\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\\) " "\[\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'\\) "
".*\[\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'\\) " "\[\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\\) "
".*\[\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\\) " "\[\r\n\]#9 .* main \\(.*\\) at "
".*\[\r\n\]#9 .* main \\(.*\\) "
} }
# Continue; should stop at call7j and print actual arguments. # Continue; should stop at call7j and print actual arguments.
@ -833,19 +815,18 @@ proc shuffle_round_robin {} {
gdb_continue call7j gdb_continue call7j
send_gdb "backtrace 100\n" gdb_test_sequence "backtrace 100" "backtrace from call7j" {
gdb_expect_list "backtrace from call7j" ".*$gdb_prompt $" { "\[\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\\) "
".*\[\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\\) " "\[\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\\) "
".*\[\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\\) " "\[\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\\) "
".*\[\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\\) " "\[\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'\\) "
".*\[\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'\\) " "\[\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\\) "
".*\[\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\\) " "\[\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\\) "
".*\[\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\\) " "\[\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\\) "
".*\[\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\\) " "\[\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\\) "
".*\[\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\\) " "\[\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'\\) "
".*\[\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'\\) " "\[\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\\) "
".*\[\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\\) " "\[\r\n\]#10 .* main \\(.*\\) at "
".*\[\r\n\]#10 .* main \\(.*\\) "
} }
# Continue; should stop at call7k and print actual arguments. # Continue; should stop at call7k and print actual arguments.
@ -854,20 +835,19 @@ proc shuffle_round_robin {} {
gdb_continue call7k gdb_continue call7k
if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix*" } if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix*" }
send_gdb "backtrace 100\n" gdb_test_sequence "backtrace 100" "backtrace from call7k" {
gdb_expect_list "backtrace from call7k" ".*$gdb_prompt $" { "\[\r\n\]#0 .* call7k \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) "
".*\[\r\n\]#0 .* call7k \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) " "\[\r\n\]#1 .* call7j \\(ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8\\) "
".*\[\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\\) " "\[\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\\) "
".*\[\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\\) " "\[\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\\) "
".*\[\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\\) " "\[\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'\\) "
".*\[\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'\\) " "\[\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\\) "
".*\[\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\\) " "\[\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\\) "
".*\[\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\\) " "\[\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\\) "
".*\[\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\\) " "\[\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\\) "
".*\[\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\\) " "\[\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'\\) "
".*\[\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'\\) " "\[\r\n\]#10 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) "
".*\[\r\n\]#10 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) " "\[\r\n\]#11 .* main \\(.*\\) at "
".*\[\r\n\]#11 .* main \\(.*\\) "
} }
gdb_stop_suppressing_tests; gdb_stop_suppressing_tests;
} }
@ -896,16 +876,15 @@ proc recursive_structs_by_value {} {
} }
if ![istarget sparclet-*-*] { if ![istarget sparclet-*-*] {
send_gdb "backtrace 100\n" gdb_test_sequence "backtrace 100" "recursive passing of structs by value" {
gdb_expect_list "recursive passing of structs by value" ".*$gdb_prompt $" { "\[\r\n\]#0 .* hitbottom \\(\\) "
".*\[\r\n\]#0 .* hitbottom \\(\\) " "\[\r\n\]#1 .* recurse \\(a=\{s = 0, i = 0, l = 0\}, depth=0\\) "
".*\[\r\n\]#1 .* recurse \\(a=\{s = 0, i = 0, l = 0\}, depth=0\\) " "\[\r\n\]#2 .* recurse \\(a=\{s = 1, i = 1, l = 1\}, depth=1\\) "
".*\[\r\n\]#2 .* recurse \\(a=\{s = 1, i = 1, l = 1\}, depth=1\\) " "\[\r\n\]#3 .* recurse \\(a=\{s = 2, i = 2, l = 2\}, depth=2\\) "
".*\[\r\n\]#3 .* recurse \\(a=\{s = 2, i = 2, l = 2\}, depth=2\\) " "\[\r\n\]#4 .* recurse \\(a=\{s = 3, i = 3, l = 3\}, depth=3\\) "
".*\[\r\n\]#4 .* recurse \\(a=\{s = 3, i = 3, l = 3\}, depth=3\\) " "\[\r\n\]#5 .* recurse \\(a=\{s = 4, i = 4, l = 4\}, depth=4\\) "
".*\[\r\n\]#5 .* recurse \\(a=\{s = 4, i = 4, l = 4\}, depth=4\\) " "\[\r\n\]#6 .* test_struct_args \\(\\) "
".*\[\r\n\]#6 .* test_struct_args \\(\\) " "\[\r\n\]#7 .* main \\(.*\\) at "
".*\[\r\n\]#7 .* main \\(.*\\) "
} }
} else { } else {
fail "recursive passing of structs by value (sparclet)" fail "recursive passing of structs by value (sparclet)"

View file

@ -138,17 +138,16 @@ gdb_test_multiple "core ${objdir}/${subdir}/gcore.test" \
} }
} }
send_gdb "where\n" gdb_test_sequence "where" "where in corefile" {
gdb_expect_list "where in corefile" ".*$gdb_prompt $" { "\[\r\n\]+#0 .* terminal_func \\(\\) at "
".*\[\r\n\]+#0 .* terminal_func \\(\\) at " "\[\r\n\]+#1 .* array_func \\(\\) at "
".*\[\r\n\]+#1 .* array_func \\(\\) at " "\[\r\n\]+#2 .* factorial_func \\(value=1\\) at "
".*\[\r\n\]+#2 .* factorial_func \\(value=1\\) at " "\[\r\n\]+#3 .* factorial_func \\(value=2\\) at "
".*\[\r\n\]+#3 .* factorial_func \\(value=2\\) at " "\[\r\n\]+#4 .* factorial_func \\(value=3\\) at "
".*\[\r\n\]+#4 .* factorial_func \\(value=3\\) at " "\[\r\n\]+#5 .* factorial_func \\(value=4\\) at "
".*\[\r\n\]+#5 .* factorial_func \\(value=4\\) at " "\[\r\n\]+#6 .* factorial_func \\(value=5\\) at "
".*\[\r\n\]+#6 .* factorial_func \\(value=5\\) at " "\[\r\n\]+#7 .* factorial_func \\(value=6\\) at "
".*\[\r\n\]+#7 .* factorial_func \\(value=6\\) at " "\[\r\n\]+#8 .* main \\(.*\\) at "
".*\[\r\n\]+#8 .* main \\(.*\\) at "
} }
set post_corefile_regs [capture_command_output "info registers" ""] set post_corefile_regs [capture_command_output "info registers" ""]

View file

@ -25,8 +25,7 @@ gdb_start
gdb_test_no_output "set pagination off" gdb_test_no_output "set pagination off"
gdb_test "show pagination" "State of pagination is off.*" "pagination is off" gdb_test "show pagination" "State of pagination is off.*" "pagination is off"
send_gdb "help\n" gdb_test_sequence "help" "unpaged help" {
gdb_expect_list "unpaged help" ".*$gdb_prompt $" {
"List of classes of commands:" "List of classes of commands:"
"" ""
"aliases -- Aliases of other commands" "aliases -- Aliases of other commands"

View file

@ -63,8 +63,7 @@ gdb_test "continue" ".* catcher .*" "continue to catch"
gdb_test "next" gdb_test "next"
# Full backtrace? # Full backtrace?
send_gdb "bt\n" gdb_test_sequence "bt" "backtrace" {
gdb_expect_list "backtrace" ".*$gdb_prompt $" {
"\[\r\n\]+.0 \[^\r\n\]* catcher " "\[\r\n\]+.0 \[^\r\n\]* catcher "
"\[\r\n\]+.1 .signal handler called." "\[\r\n\]+.1 .signal handler called."
"\[\r\n\]+.2 \[^\r\n\]* thrower .next_level=INNER" "\[\r\n\]+.2 \[^\r\n\]* thrower .next_level=INNER"
@ -72,7 +71,7 @@ gdb_expect_list "backtrace" ".*$gdb_prompt $" {
"\[\r\n\]+.4 .signal handler called." "\[\r\n\]+.4 .signal handler called."
"\[\r\n\]+.5 \[^\r\n\]* thrower .next_level=OUTER" "\[\r\n\]+.5 \[^\r\n\]* thrower .next_level=OUTER"
"\[\r\n\]+.6 \[^\r\n\]* catcher " "\[\r\n\]+.6 \[^\r\n\]* catcher "
"\[\r\n\]+.7 \[^\r\n\]* main .*" "\[\r\n\]+.7 \[^\r\n\]* main "
} }
proc finish_test { pattern msg } { proc finish_test { pattern msg } {

View file

@ -62,11 +62,10 @@ if { ![runto_main] } then {
# Run to the signal handler, validate the backtrace. # Run to the signal handler, validate the backtrace.
gdb_test "break handler" gdb_test "break handler"
gdb_test "continue" ".* handler .*" "continue to stepi handler" gdb_test "continue" ".* handler .*" "continue to stepi handler"
send_gdb "bt\n" gdb_test_sequence "bt" "backtrace for nexti" {
gdb_expect_list "backtrace for nexti" ".*$gdb_prompt $" {
"\[\r\n\]+.0 \[^\r\n\]* handler " "\[\r\n\]+.0 \[^\r\n\]* handler "
"\[\r\n\]+.1 .signal handler called." "\[\r\n\]+.1 .signal handler called."
"\[\r\n\]+.2 \[^\r\n\]* main .*" "\[\r\n\]+.2 \[^\r\n\]* main "
} }
# Check that GDB can step the inferior back to main # Check that GDB can step the inferior back to main

View file

@ -61,11 +61,10 @@ if { ![runto_main] } then {
# Run to the signal handler, validate the backtrace. # Run to the signal handler, validate the backtrace.
gdb_test "break handler" gdb_test "break handler"
gdb_test "continue" ".* handler .*" "continue to stepi handler" gdb_test "continue" ".* handler .*" "continue to stepi handler"
send_gdb "bt\n" gdb_test_sequence "bt" "backtrace for nexti" {
gdb_expect_list "backtrace for nexti" ".*$gdb_prompt $" {
"\[\r\n\]+.0 \[^\r\n\]* handler " "\[\r\n\]+.0 \[^\r\n\]* handler "
"\[\r\n\]+.1 .signal handler called." "\[\r\n\]+.1 .signal handler called."
"\[\r\n\]+.2 \[^\r\n\]* main .*" "\[\r\n\]+.2 \[^\r\n\]* main "
} }
proc advance { i } { proc advance { i } {

View file

@ -48,8 +48,7 @@ gdb_test "show trace-commands" "State of GDB CLI command tracing is off\\." \
"show trace-commands says off" "show trace-commands says off"
# Source the script with verbose mode. # Source the script with verbose mode.
send_gdb "source -v tracecommandsscript\n" gdb_test_sequence "source -v tracecommandsscript" "source -v" {
gdb_expect_list "source -v" ".*$gdb_prompt $" {
{[\r\n]\+echo in tracecommandsscript\\n} {[\r\n]\+echo in tracecommandsscript\\n}
{[\r\n]\+define func} {[\r\n]\+define func}
{[\r\n]\+if 1} {[\r\n]\+if 1}
@ -73,8 +72,8 @@ gdb_test "show trace-commands" \
gdb_test "echo hi\\n" {\+echo hi\\n[\r\n]+hi} "simple trace-commands test" gdb_test "echo hi\\n" {\+echo hi\\n[\r\n]+hi} "simple trace-commands test"
# Nested test # Nested test
send_gdb "if 1\nset \$i = 0\nwhile \$i < 5\nfunc \$i\nset \$i += 1\nend\nend\n" gdb_test_sequence "if 1\nset \$i = 0\nwhile \$i < 5\nfunc \$i\nset \$i += 1\nend\nend" \
gdb_expect_list "nested trace-commands test" ".*$gdb_prompt $" { "nested trace-commands test" {
{[\r\n]\+if 1} {[\r\n]\+if 1}
{[\r\n]\+\+set \$i = 0} {[\r\n]\+\+set \$i = 0}
{[\r\n]\+\+while \$i < 5} {[\r\n]\+\+while \$i < 5}
@ -96,12 +95,11 @@ gdb_expect_list "nested trace-commands test" ".*$gdb_prompt $" {
} }
# Function with source works # Function with source works
send_gdb "define topfunc\nsource tracecommandsscript\nend\n" gdb_test_sequence "define topfunc\nsource tracecommandsscript\nend" \
gdb_expect_list "define user command" ".*$gdb_prompt $" { "define user command" {
{[\r\n]\+define topfunc} {[\r\n]\+define topfunc}
} }
send_gdb "topfunc\n" gdb_test_sequence "topfunc" "nested trace-commands test with source" {
gdb_expect_list "nested trace-commands test with source" ".*$gdb_prompt $" {
{[\r\n]\+topfunc} {[\r\n]\+topfunc}
{[\r\n]\+\+source tracecommandsscript} {[\r\n]\+\+source tracecommandsscript}
{[\r\n]\+\+echo in tracecommandsscript\\n} {[\r\n]\+\+echo in tracecommandsscript\\n}
@ -116,8 +114,8 @@ gdb_expect_list "nested trace-commands test with source" ".*$gdb_prompt $" {
} }
# Test nest depth resets properly on error # Test nest depth resets properly on error
send_gdb "if 1\nif 2\nload\necho should not get here\\n\nend\nend\n" gdb_test_sequence "if 1\nif 2\nload\necho should not get here\\n\nend\nend" \
gdb_expect_list "depth resets on error part 1" ".*$gdb_prompt $" { "depth resets on error part 1" {
{[\r\n]\+if 1} {[\r\n]\+if 1}
{[\r\n]\+\+if 2} {[\r\n]\+\+if 2}
{[\r\n]\+\+\+load} {[\r\n]\+\+\+load}

View file

@ -936,6 +936,11 @@ proc gdb_test_no_output { args } {
# #
# Like gdb_test and gdb_test_multiple, the output is expected to end with the # Like gdb_test and gdb_test_multiple, the output is expected to end with the
# gdb prompt, which must not be specified in EXPECTED_OUTPUT_LIST. # gdb prompt, which must not be specified in EXPECTED_OUTPUT_LIST.
#
# Returns:
# 1 if the test failed,
# 0 if the test passes,
# -1 if there was an internal error.
proc gdb_test_sequence { command test_name expected_output_list } { proc gdb_test_sequence { command test_name expected_output_list } {
global gdb_prompt global gdb_prompt
@ -944,7 +949,7 @@ proc gdb_test_sequence { command test_name expected_output_list } {
} }
lappend expected_output_list ""; # implicit ".*" before gdb prompt lappend expected_output_list ""; # implicit ".*" before gdb prompt
send_gdb "$command\n" send_gdb "$command\n"
gdb_expect_list $test_name "$gdb_prompt $" $expected_output_list return [gdb_expect_list $test_name "$gdb_prompt $" $expected_output_list]
} }
@ -2376,10 +2381,10 @@ proc gdb_expect { args } {
} }
} }
# gdb_expect_list MESSAGE SENTINEL LIST -- expect a sequence of outputs # gdb_expect_list TEST SENTINEL LIST -- expect a sequence of outputs
# #
# Check for long sequence of output by parts. # Check for long sequence of output by parts.
# MESSAGE: is the test message to be printed with the test success/fail. # TEST: is the test message to be printed with the test success/fail.
# SENTINEL: Is the terminal pattern indicating that output has finished. # SENTINEL: Is the terminal pattern indicating that output has finished.
# LIST: is the sequence of outputs to match. # LIST: is the sequence of outputs to match.
# If the sentinel is recognized early, it is considered an error. # If the sentinel is recognized early, it is considered an error.
@ -2388,7 +2393,7 @@ proc gdb_expect { args } {
# 1 if the test failed, # 1 if the test failed,
# 0 if the test passes, # 0 if the test passes,
# -1 if there was an internal error. # -1 if there was an internal error.
#
proc gdb_expect_list {test sentinel list} { proc gdb_expect_list {test sentinel list} {
global gdb_prompt global gdb_prompt
global suppress_flag global suppress_flag