+2021-01-22 Simon Marchi <simon.marchi@polymtl.ca>
+
+ * lib/gdb.exp (gdb_test_multiple): Remove things related to test
+ suppression.
+ (default_gdb_exit): Likewise.
+ (default_gdb_spawn): Likewise.
+ (send_gdb): Likewise.
+ (gdb_expect): Likewise.
+ (gdb_expect_list): Likewise.
+ (default_gdb_init): Likewise.
+ (gdb_suppress_entire_file): Remove.
+ (gdb_suppress_tests): Remove.
+ (gdb_stop_suppressing_tests): Remove.
+ (gdb_clear_suppressed): Remove.
+ * lib/mi-support.exp (mi_uncatched_gdb_exit): Remove things
+ related to test suppression.
+ (default_mi_gdb_start): Likewise.
+ (mi_gdb_reinitialize_dir): Likewise.
+ (mi_gdb_test): Likewise.
+ (mi_run_cmd_full): Likewise.
+ (mi_runto_helper): Likewise.
+ (mi_execute_to): Likewise.
+ * lib/prompt.exp (default_prompt_gdb_start): Likewise.
+ * gdb.base/bitfields.exp: Likewise.
+ * gdb.base/bitfields2.exp: Likewise.
+ * gdb.base/break.exp: Likewise.
+ * gdb.base/call-sc.exp: Likewise.
+ * gdb.base/callfuncs.exp: Likewise.
+ * gdb.base/dfp-test.exp: Likewise.
+ * gdb.base/endian.exp: Likewise.
+ * gdb.base/exprs.exp: Likewise.
+ * gdb.base/funcargs.exp: Likewise.
+ * gdb.base/hbreak2.exp: Likewise.
+ * gdb.base/recurse.exp: Likewise.
+ * gdb.base/scope.exp: Likewise.
+ * gdb.base/sepdebug.exp: Likewise.
+ * gdb.base/structs.exp: Likewise.
+ * gdb.base/until.exp: Likewise.
+ * gdb.cp/misc.exp: Likewise.
+
2021-01-22 Andrew Burgess <andrew.burgess@embecosm.com>
PR cli/25956
global srcfile
if { ! [runto break1] } {
- gdb_suppress_tests
- }
-
- if [gdb_test "print flags" ".*uc = 1 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0.*"] {
- gdb_suppress_tests
- }
- if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #1"] {
- gdb_suppress_tests
+ return
}
+
+ gdb_test "print flags" ".*uc = 1 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0.*"
+ gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #1"
+
# Note that we check for s1 as either 1 or -1, so that failure to
# treat it correctly as a signed 1bit field (values 0 or -1) while
# printing its value does not cause a spurious failure. We do the
# signedness preservation test later.
- if [gdb_test "print flags" ".*uc = 0 .*, s1 = (1|-1), u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (s1)"] {
- gdb_suppress_tests
- }
- if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #2"] {
- gdb_suppress_tests
- }
- if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 1, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (u1)"] {
- gdb_suppress_tests
- }
- if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #3"] {
- gdb_suppress_tests
- }
- if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 1, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (s2)"] {
- gdb_suppress_tests
- }
- if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #4"] {
- gdb_suppress_tests
- }
- if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 1, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (u2)"] {
- gdb_suppress_tests
- }
- if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #5"] {
- gdb_suppress_tests
- }
- if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 1, u3 = 0, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (s3)"] {
- gdb_suppress_tests
- }
- if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #6"] {
- gdb_suppress_tests
- }
- if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 1, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (u3)"] {
- gdb_suppress_tests
- }
- if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #7"] {
- gdb_suppress_tests
- }
- if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 1, u9 = 0, sc = 0.*" "bitfield uniqueness (s9)"] {
- gdb_suppress_tests
- }
- if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #8"] {
- gdb_suppress_tests
- }
- if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 1, sc = 0.*" "bitfield uniqueness (u9)"] {
- gdb_suppress_tests
- }
- if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #9"] {
- gdb_suppress_tests
- }
- if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 1.*" "bitfield uniqueness (sc)"] {
- gdb_suppress_tests
- }
- # Hmmmm?
- gdb_stop_suppressing_tests
+ gdb_test "print flags" ".*uc = 0 .*, s1 = (1|-1), u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (s1)"
+ gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #2"
+ gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 1, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (u1)"
+ gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #3"
+ gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 1, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (s2)"
+ gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #4"
+ gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 1, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (u2)"
+ gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #5"
+ gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 1, u3 = 0, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (s3)"
+ gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #6"
+ gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 1, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (u3)"
+ gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #7"
+ gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 1, u9 = 0, sc = 0.*" "bitfield uniqueness (s9)"
+ gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #8"
+ gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 1, sc = 0.*" "bitfield uniqueness (u9)"
+ gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #9"
+ gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 1.*" "bitfield uniqueness (sc)"
}
delete_breakpoints
if { ![runto break2] } {
- gdb_suppress_tests
- }
-
- if [gdb_test "print/x flags" "= {uc = 0xff, s1 = 0x0, u1 = 0x1, s2 = 0x0, u2 = 0x3, s3 = 0x0, u3 = 0x7, s9 = 0x0, u9 = 0x1ff, sc = 0x0}" "bitfield containment #1"] {
- gdb_suppress_tests
+ return
}
- if [gdb_test "cont" "Break.*break2 \\(\\) at .*$srcfile:$decimal.*" "continuing to break2"] {
- gdb_suppress_tests
- }
+ gdb_test "print/x flags" "= {uc = 0xff, s1 = 0x0, u1 = 0x1, s2 = 0x0, u2 = 0x3, s3 = 0x0, u3 = 0x7, s9 = 0x0, u9 = 0x1ff, sc = 0x0}" "bitfield containment #1"
+ gdb_test "cont" "Break.*break2 \\(\\) at .*$srcfile:$decimal.*" "continuing to break2"
# If program is compiled with Sun CC, then these print out as their
# actual sizes; if compiled with gcc, they print out as 0xffffffff
# (which strikes me as bogus, but accept it at least for now).
- if [gdb_test "print/x flags" "= {uc = 0x0, s1 = 0x(1|f*), u1 = 0x0, s2 = 0x(3|f*), u2 = 0x0, s3 = 0x(7|f*), u3 = 0x0, s9 = 0x(1ff|f*), u9 = 0x0, sc = 0xff}" "bitfield containment #2"] {
- gdb_suppress_tests
- }
- gdb_stop_suppressing_tests
+ gdb_test "print/x flags" "= {uc = 0x0, s1 = 0x(1|f*), u1 = 0x0, s2 = 0x(3|f*), u2 = 0x0, s3 = 0x(7|f*), u3 = 0x0, s9 = 0x(1ff|f*), u9 = 0x0, sc = 0xff}" "bitfield containment #2"
}
# Test unsigned bitfields for unsignedness and range.
delete_breakpoints
if { ![runto break3] } {
- gdb_suppress_tests
+ return
}
- if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 1, s2 = 0, u2 = 3, s3 = 0, u3 = 7, s9 = 0, u9 = 511, sc = 0.*" "unsigned bitfield ranges"] {
- gdb_suppress_tests
- }
- gdb_stop_suppressing_tests
+ gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 1, s2 = 0, u2 = 3, s3 = 0, u3 = 7, s9 = 0, u9 = 511, sc = 0.*" "unsigned bitfield ranges"
}
#
delete_breakpoints
if { ! [runto break4] } {
- gdb_suppress_tests
+ return
}
- if [gdb_test "print flags" "= {uc = 0 .*, s1 = 0, u1 = 0, s2 = 1, u2 = 0, s3 = 3, u3 = 0, s9 = 255, u9 = 0, sc = 0 .*}" "signed bitfields, max positive values"] {
- gdb_suppress_tests
- }
-
- if [gdb_test "cont" "Break.*break4 \\(\\) at .*$srcfile:$decimal.*" "continuing to break4 #1"] {
- gdb_suppress_tests
- }
+ gdb_test "print flags" "= {uc = 0 .*, s1 = 0, u1 = 0, s2 = 1, u2 = 0, s3 = 3, u3 = 0, s9 = 255, u9 = 0, sc = 0 .*}" "signed bitfields, max positive values"
+ gdb_test "cont" "Break.*break4 \\(\\) at .*$srcfile:$decimal.*" "continuing to break4 #1"
# Determine if the target has signed bitfields so we can xfail the
# the signed bitfield tests if it doesn't.
}
-re ".*$gdb_prompt $" {
fail "determining signed-ness of bitfields"
- gdb_suppress_tests
}
- default {
+ default {
fail "determining signed-ness of bitfields"
- gdb_suppress_tests
}
}
- if [gdb_test "print flags" ".*uc = 0 .*, s1 = -1, u1 = 0, s2 = -2, u2 = 0, s3 = -4, u3 = 0, s9 = -256, u9 = 0, sc = 0.*" "signed bitfields, max negative values"] {
- gdb_suppress_tests
- }
-
- if [gdb_test "cont" "Break.*break4 \\(\\) at .*$srcfile:$decimal.*" "continuing to break4 #2"] {
- gdb_suppress_tests
- }
-
- if [gdb_test "print flags" ".*uc = 0 .*, s1 = -1, u1 = 0, s2 = -1, u2 = 0, s3 = -1, u3 = 0, s9 = -1, u9 = 0, sc = 0.*" "signed bitfields with -1"] {
- gdb_suppress_tests
- }
- # Hmmmm???
- gdb_stop_suppressing_tests
+ gdb_test "print flags" ".*uc = 0 .*, s1 = -1, u1 = 0, s2 = -2, u2 = 0, s3 = -4, u3 = 0, s9 = -256, u9 = 0, sc = 0.*" "signed bitfields, max negative values"
+ gdb_test "cont" "Break.*break4 \\(\\) at .*$srcfile:$decimal.*" "continuing to break4 #2"
+ gdb_test "print flags" ".*uc = 0 .*, s1 = -1, u1 = 0, s2 = -1, u2 = 0, s3 = -1, u3 = 0, s9 = -1, u9 = 0, sc = 0.*" "signed bitfields with -1"
}
# Test bitfields at non-zero offsets in a struct.
global decimal
global srcfile
- if [gdb_test "cont" "Break.*$function \\(\\) at .*$srcfile:$decimal.*" "continuing to $function $tag"] {
- gdb_suppress_tests
- }
+ gdb_test "cont" "Break.*$function \\(\\) at .*$srcfile:$decimal.*" "continuing to $function $tag"
}
#
#
proc start_test { function } {
delete_breakpoints
- if [gdb_test "break tester" ".*" "break tester prior to $function"] {
- gdb_suppress_tests
- }
+ gdb_test "break tester" ".*" "break tester prior to $function"
continue_test "tester" "prior to $function"
- if ![gdb_breakpoint $function] {
- gdb_suppress_tests
- }
+ gdb_breakpoint $function
continue_test $function "#0"
}
global srcfile
start_test break1
-
- if [gdb_test "print flags" ".*u1 = 0, u2 = 0, u3 = 0, s1 = 1, s2 = 0, s3 = 0.*" "bitfield uniqueness; flags.s1 = 1"] {
- gdb_suppress_tests
- }
+
+ gdb_test "print flags" ".*u1 = 0, u2 = 0, u3 = 0, s1 = 1, s2 = 0, s3 = 0.*" "bitfield uniqueness; flags.s1 = 1"
continue_test break1 "#1"
- if [gdb_test "print flags" ".*u1 = 1, u2 = 0, u3 = 0, s1 = 0, s2 = 0, s3 = 0.*" "bitfield uniqueness; flags.u1 = 1"] {
- gdb_suppress_tests
- }
+ gdb_test "print flags" ".*u1 = 1, u2 = 0, u3 = 0, s1 = 0, s2 = 0, s3 = 0.*" "bitfield uniqueness; flags.u1 = 1"
continue_test break1 "#2"
- if [gdb_test "print flags" ".*u1 = 0, u2 = 0, u3 = 0, s1 = 0, s2 = 1, s3 = 0.*" "bitfield uniqueness; flags.s2 = 1"] {
- gdb_suppress_tests
- }
+ gdb_test "print flags" ".*u1 = 0, u2 = 0, u3 = 0, s1 = 0, s2 = 1, s3 = 0.*" "bitfield uniqueness; flags.s2 = 1"
continue_test break1 "#3"
- if [gdb_test "print flags" ".*u1 = 0, u2 = 1, u3 = 0, s1 = 0, s2 = 0, s3 = 0.*" "bitfield uniqueness; flags.u2 = 1"] {
- gdb_suppress_tests
- }
+ gdb_test "print flags" ".*u1 = 0, u2 = 1, u3 = 0, s1 = 0, s2 = 0, s3 = 0.*" "bitfield uniqueness; flags.u2 = 1"
continue_test break1 "#4"
- if [gdb_test "print flags" ".*u1 = 0, u2 = 0, u3 = 0, s1 = 0, s2 = 0, s3 = 1.*" "bitfield uniqueness; flags.s3 = 1"] {
- gdb_suppress_tests
- }
+ gdb_test "print flags" ".*u1 = 0, u2 = 0, u3 = 0, s1 = 0, s2 = 0, s3 = 1.*" "bitfield uniqueness; flags.s3 = 1"
continue_test break1 "#5"
- if [gdb_test "print flags" ".*u1 = 0, u2 = 0, u3 = 1, s1 = 0, s2 = 0, s3 = 0.*" "bitfield uniqueness; flags.u3 = 1"] {
- gdb_suppress_tests
- }
- gdb_stop_suppressing_tests
+ gdb_test "print flags" ".*u1 = 0, u2 = 0, u3 = 1, s1 = 0, s2 = 0, s3 = 0.*" "bitfield uniqueness; flags.u3 = 1"
}
# If program is compiled with Sun CC, signed fields print out as their
# actual sizes; if compiled with gcc, they print out as 0xffffffff.
- if [gdb_test "print/x flags" "= {u1 = 0x7fff, u2 = 0x0, u3 = 0xffff, s1 = 0x0, s2 = 0x(1ffffffff|f*), s3 = 0x0}" "bitfield containment; flags.u1, flags.u3, and flags.s3 to all 1s"] {
- gdb_suppress_tests
- }
+ gdb_test "print/x flags" "= {u1 = 0x7fff, u2 = 0x0, u3 = 0xffff, s1 = 0x0, s2 = 0x(1ffffffff|f*), s3 = 0x0}" "bitfield containment; flags.u1, flags.u3, and flags.s3 to all 1s"
continue_test break2 "#1"
- if [gdb_test "print/x flags" "= {u1 = 0x0, u2 = 0x1ffffffff, u3 = 0x0, s1 = 0x(7fff|f*), s2 = 0x0, s3 = 0xf*}" "bitfield containment; flags.u2, flags.s1, flags.s2 to all 1s"] {
- gdb_suppress_tests
- }
- gdb_stop_suppressing_tests
+ gdb_test "print/x flags" "= {u1 = 0x0, u2 = 0x1ffffffff, u3 = 0x0, s1 = 0x(7fff|f*), s2 = 0x0, s3 = 0xf*}" "bitfield containment; flags.u2, flags.s1, flags.s2 to all 1s"
}
# Test unsigned bitfields for unsignedness and range.
start_test break3
- if [gdb_test "print flags" ".*u1 = 32767, u2 = 8589934591, u3 = 65535, s1 = 0, s2 = 0, s3 = 0.*" "maximum unsigned bitfield values"] {
- gdb_suppress_tests
- }
- gdb_stop_suppressing_tests
+ gdb_test "print flags" ".*u1 = 32767, u2 = 8589934591, u3 = 65535, s1 = 0, s2 = 0, s3 = 0.*" "maximum unsigned bitfield values"
}
#
start_test break4
- if [gdb_test "print flags" "= {.*u1 = 0, u2 = 0, u3 = 0, s1 = 16383, s2 = 4294967295, s3 = 32767.*}" "maximum signed bitfield values"] {
- gdb_suppress_tests
- }
+ gdb_test "print flags" "= {.*u1 = 0, u2 = 0, u3 = 0, s1 = 16383, s2 = 4294967295, s3 = 32767.*}" "maximum signed bitfield values"
continue_test break4 "#1"
}
-re ".*$gdb_prompt $" {
fail "determining signed-ness of bitfields"
- gdb_suppress_tests
}
}
set test "most negative signed bitfield values"
if $has_signed_bitfields then {
- if [gdb_test "print flags" "u1 = 0, u2 = 0, u3 = 0, s1 = -16384, s2 = -4294967296, s3 = -32768.*" $test ] {
- gdb_suppress_tests
- }
+ gdb_test "print flags" "u1 = 0, u2 = 0, u3 = 0, s1 = -16384, s2 = -4294967296, s3 = -32768.*" $test
} else {
unsupported $test
}
set test "signed bitfields containing -1"
if $has_signed_bitfields then {
- if [gdb_test "print flags" "u1 = 0, u2 = 0, u3 = 0, s1 = -1, s2 = -1, s3 = -1.*" $test ] {
- gdb_suppress_tests
- }
+ gdb_test "print flags" "u1 = 0, u2 = 0, u3 = 0, s1 = -1, s2 = -1, s3 = -1.*" $test
} else {
unsupported $test
}
-
- gdb_stop_suppressing_tests
}
gdb_test_multiple "print flags.u2 = 0x100000000" $test {
-re "warning: Value does not fit.*$gdb_prompt $" {
fail "$test"
- gdb_suppress_tests
}
-re "= 4294967296.*$gdb_prompt $" {
pass "$test"
gdb_test_multiple "print flags.s2 = 0x80000000" $test {
-re "warning: Value does not fit.*$gdb_prompt $" {
fail "$test"
- gdb_suppress_tests
}
-re "= 2147483648.*$gdb_prompt $" {
pass "$test"
}
}
- if [gdb_test "print flags" "u1 = 0, u2 = 4294967296, u3 = 0, s1 = 0, s2 = 2147483648, s3 = 0.*" "long long bitfield values after set"] {
- gdb_suppress_tests
- }
+ gdb_test "print flags" "u1 = 0, u2 = 4294967296, u3 = 0, s1 = 0, s2 = 2147483648, s3 = 0.*" "long long bitfield values after set"
set test "set long long signed bitfield negative"
if $has_signed_bitfields then {
gdb_test_multiple "print flags.s2 = -1" $test {
-re "warning: Value does not fit.*$gdb_prompt $" {
fail "$test"
- gdb_suppress_tests
}
-re "= -1.*$gdb_prompt $" {
pass "$test"
set test "long long bitfield values after set negative"
if $has_signed_bitfields then {
- if [gdb_test "print flags" "u1 = 0, u2 = 4294967296, u3 = 0, s1 = 0, s2 = -1, s3 = 0.*" $test] {
- gdb_suppress_tests
- }
+ gdb_test "print flags" "u1 = 0, u2 = 4294967296, u3 = 0, s1 = 0, s2 = -1, s3 = 0.*" $test
} else {
unsupported $test
}
-
- gdb_stop_suppressing_tests
}
clean_restart ${binfile}
# Continue until we call factorial recursively with 5.
- if [gdb_test "continue" \
+ gdb_test "continue" \
"Continuing.*Break.* factorial .value=5. .*" \
- "continue to factorial(5)"] then { gdb_suppress_tests }
+ "continue to factorial(5)"
# Do a backtrace just to confirm how many levels deep we are.
- if [gdb_test "backtrace" \
+ gdb_test "backtrace" \
"#0\[ \t\]+ factorial .value=5..*" \
- "backtrace from factorial(5)"] then { gdb_suppress_tests }
+ "backtrace from factorial(5)"
# Now a "next" should position us at the recursive call, which
# we will be performing with 4.
- if [gdb_test "next" \
+ gdb_test "next" \
".* factorial .value - 1.;.*" \
- "next to recursive call"] then { gdb_suppress_tests }
+ "next to recursive call"
# Disable the breakpoint at the entry to factorial by deleting them all.
# The "next" should run until we return to the next line from this
# OK, we should be back in the same stack frame we started from.
# Do a backtrace just to confirm.
- set result [gdb_test "backtrace" \
+ gdb_test "backtrace" \
"#0\[ \t\]+ factorial .value=120.*\r\n#1\[ \t\]+ \[0-9a-fx\]+ in factorial .value=6..*" \
- "backtrace from factorial(5.1)"]
- if { $result != 0 } { gdb_suppress_tests }
+ "backtrace from factorial(5.1)"
- if [target_info exists gdb,noresults] { gdb_suppress_tests }
- gdb_continue_to_end "recursive next test"
- gdb_stop_suppressing_tests
+ if { ![target_info exists gdb,noresults] } {
+ gdb_continue_to_end "recursive next test"
+ }
}
test_next_with_recursion
# Advance to main
if { ![runto_main] } then {
- gdb_suppress_tests
+ return
}
# Get the debug format
with_test_prefix "rerun number ${rerun_count}" {
if { ![runto_main] } {
- gdb_suppress_tests
+ return
}
gdb_test_no_output "set language c"
# of finite numbers, infinite and NaN, and also the setting of different
# decimal value.
-if [gdb_test "next" \
+gdb_test "next" \
".*Positive infd32.*" \
- "next after initializing d32"] then { gdb_suppress_tests }
+ "next after initializing d32"
gdb_test "print d32" "1.2345" "d32 is initialized to 1.2345"
-if [gdb_test "next" \
+gdb_test "next" \
".*Negative infd32.*" \
- "next after assigning builtin infinity to d32"] then { gdb_suppress_tests }
+ "next after assigning builtin infinity to d32"
gdb_test "print d32" "Infinity" "d32 is positive Infinity"
-if [gdb_test "next" \
+gdb_test "next" \
".*__builtin_nand32.*" \
- "next after assigning negative builtin infinity to d32"] then { gdb_suppress_tests }
+ "next after assigning negative builtin infinity to d32"
gdb_test "print d32" "-Infinity" "d32 is negative Infinity"
-if [gdb_test "next" \
+gdb_test "next" \
".*d64 = 1.2345.*" \
- "next after assigning builtin NaN to d32"] then { gdb_suppress_tests }
+ "next after assigning builtin NaN to d32"
gdb_test "print d32" "NaN" "d32 is NaN"
d32_set_tests
# of finite number, infinite and NaN, and also the setting of different
# decimal value.
-if [gdb_test "next" \
+gdb_test "next" \
".*Positive infd64.*" \
- "next after initializing d64"] then { gdb_suppress_tests }
+ "next after initializing d64"
gdb_test "print d64" "1.2345" "d64 is initialized to 1.2345"
-if [gdb_test "next" \
+gdb_test "next" \
".*Negative infd64.*" \
- "next after assigning builtin infinity to d64"] then { gdb_suppress_tests }
+ "next after assigning builtin infinity to d64"
gdb_test "print d64" "Infinity" "d64 is positive Infinity"
-if [gdb_test "next" \
+gdb_test "next" \
".*__builtin_nand64.*" \
- "next after assigning negative builtin infinity to d64"] then { gdb_suppress_tests }
+ "next after assigning negative builtin infinity to d64"
gdb_test "print d64" "-Infinity" "d64 is negative Infinity"
-if [gdb_test "next" \
+gdb_test "next" \
".*d128 = 1.2345.*" \
- "next after assigning builtin NaN to d64"] then { gdb_suppress_tests }
+ "next after assigning builtin NaN to d64"
gdb_test "print d64" "NaN" "d64 is NaN"
d64_set_tests
# of finite number, infinite and NaN, and also the setting of different
# decimal value.
-if [gdb_test "next" \
+gdb_test "next" \
".*Positive infd128.*" \
- "next after initializing d128"] then { gdb_suppress_tests }
+ "next after initializing d128"
gdb_test "print d128" "1.2345" "d128 is initialized to 1.2345"
d128_set_tests
-if [gdb_test "next" \
+gdb_test "next" \
".*Negative infd128.*" \
- "next after assigning builtin infinity to d128"] then { gdb_suppress_tests }
+ "next after assigning builtin infinity to d128"
gdb_test "print d128" "Infinity" "d128 is positive Infinity"
-if [gdb_test "next" \
+gdb_test "next" \
".*__builtin_nand128.*" \
- "next after assigning negative builtin infinity to d128"] then { gdb_suppress_tests }
+ "next after assigning negative builtin infinity to d128"
gdb_test "print d128" "-Infinity" "d128 is negative Infinity"
-if [gdb_test "next" \
+gdb_test "next" \
".*arg0_32.*" \
- "next after assigning builtin NaN to d128"] then { gdb_suppress_tests }
+ "next after assigning builtin NaN to d128"
gdb_test "print d128" "NaN" "d128 is NaN"
# The following tests are intended to verify that gdb can correctly handle
"auto target endianness big"
if { [build_executable ${testfile}.exp $testfile] } {
- gdb_suppress_entire_file "$pf_prefix cannot build executable"
+ untested "failed to compile"
+ return
}
-if { [gdb_file_cmd $binfile] } {
- gdb_suppress_entire_file "$pf_prefix cannot select executable"
-}
+gdb_file_cmd $binfile
+
set test "get target endianness"
if { [gdb_test_multiple "show endian" "$test" {
-re "$en_auto \\\(currently \(big\|little\) endian\\\)\\..*$gdb_prompt" {
pass "$test"
}
}] } {
- gdb_suppress_entire_file \
- "$pf_prefix cannot determine executable endianness"
- set endian ""
+ return
}
# Now check that the automatic endianness is updated
# according to the executable selected.
-if { [gdb_unload] } {
- gdb_suppress_entire_file "$pf_prefix cannot unselect executable"
-}
+gdb_unload
gdb_test "set endian big" "$en_set big endian\\." \
"override target endianness big"
gdb_test "set endian auto" "$en_auto \\\(currently big endian\\\)\\." \
"override auto target endianness big"
-if { [gdb_file_cmd $binfile] } {
- gdb_suppress_entire_file "$pf_prefix cannot select executable"
-}
+
+gdb_file_cmd $binfile
gdb_test "show endian" "$en_auto \\\(currently $endian endian\\\)\\." \
"previously big default executable endianness"
-if { [gdb_unload] } {
- gdb_suppress_entire_file "$pf_prefix cannot unselect executable"
-}
+
+gdb_unload
gdb_test "show endian" "$en_auto \\\(currently $endian endian\\\)\\." \
"previously big default no executable endianness"
gdb_test "set endian little" "$en_set little endian\\." \
"override target endianness little"
gdb_test "set endian auto" "$en_auto \\\(currently little endian\\\)\\." \
"override auto target endianness little"
-if { [gdb_file_cmd $binfile] } {
- gdb_suppress_entire_file "$pf_prefix cannot select executable"
-}
+
+gdb_file_cmd $binfile
gdb_test "show endian" "$en_auto \\\(currently $endian endian\\\)\\." \
"previously little default executable endianness"
-if { [gdb_unload] } {
- gdb_suppress_entire_file "$pf_prefix cannot unselect executable"
-}
+
+gdb_unload
gdb_test "show endian" "$en_auto \\\(currently $endian endian\\\)\\." \
"previously little default no executable endianness"
}
set last_ent [expr [llength $args] - 1]
set testname [lindex $args $last_ent]
- if [gdb_test [lindex $args 0] ".*" "$testname (setup)"] {
- gdb_suppress_tests
- }
+ gdb_test [lindex $args 0] ".*" "$testname (setup)"
for {set x 1} {$x < $last_ent} {set x [expr $x + 2]} {
- if [gdb_test [lindex $args $x] [lindex $args [expr $x + 1]] "$testname ([lindex $args $x])"] {
- gdb_suppress_tests
- }
+ gdb_test [lindex $args $x] [lindex $args [expr $x + 1]] "$testname ([lindex $args $x])"
}
- gdb_stop_suppressing_tests
}
#
# test expressions with "char" types
gdb_test "print l " ".* = 3" "print l after run to call0a"
# Continue; should stop at call0b and print actual arguments.
- if [gdb_test "cont" ".* call0b \\(s=1, i=2, l=3, c=97 'a'\\) .*" "continue to call0b"] {
- gdb_suppress_tests
- }
+ gdb_test "cont" ".* call0b \\(s=1, i=2, l=3, c=97 'a'\\) .*" "continue to call0b"
# Continue; should stop at call0c and print actual arguments.
- if [gdb_test "cont" ".* call0c \\(i=2, l=3, c=97 'a', s=1\\) .*" "continue to call0c"] {
- gdb_suppress_tests
- }
+ gdb_test "cont" ".* call0c \\(i=2, l=3, c=97 'a', s=1\\) .*" "continue to call0c"
# Continue; should stop at call0d and print actual arguments.
- if [gdb_test "cont" ".* call0d \\(l=3, c=97 'a', s=1, i=2\\) .*" "continue to call0d";] {
- gdb_suppress_tests
- }
+ gdb_test "cont" ".* call0d \\(l=3, c=97 'a', s=1, i=2\\) .*" "continue to call0d"
# Continue; should stop at call0e and print actual arguments.
- if [gdb_test "cont" ".* call0e \\(c1=97 'a', l=3, c2=97 'a', i=2, c3=97 'a', s=1, c4=97 'a', c5=97 'a'\\) .*" "continue to call0e" ] {
- gdb_suppress_tests
- }
- gdb_stop_suppressing_tests
+ gdb_test "cont" ".* call0e \\(c1=97 'a', l=3, c2=97 'a', i=2, c3=97 'a', s=1, c4=97 'a', c5=97 'a'\\) .*" "continue to call0e"
}
#
gdb_test "print us" ".* = 6"
gdb_test "print ui" ".* = 7"
gdb_test "print ul" ".* = 8"
-
+
# Continue; should stop at call1b and print actual arguments.
- if [gdb_test "cont" ".* call1b \\(us=6, ui=7, ul=8, uc=98 'b'\\) .*" "continue to call1b"] {
- gdb_suppress_tests
- }
+ gdb_test "cont" ".* call1b \\(us=6, ui=7, ul=8, uc=98 'b'\\) .*" "continue to call1b"
# Continue; should stop at call1c and print actual arguments.
- if [gdb_test "cont" ".* call1c \\(ui=7, ul=8, uc=98 'b', us=6\\) .*" "continue to call1c"] {
- gdb_suppress_tests
- }
+ gdb_test "cont" ".* call1c \\(ui=7, ul=8, uc=98 'b', us=6\\) .*" "continue to call1c"
# Continue; should stop at call1d and print actual arguments.
- if [gdb_test "cont" ".* call1d \\(ul=8, uc=98 'b', us=6, ui=7\\) .*" "continue to call1d"] {
- gdb_suppress_tests
- }
+ gdb_test "cont" ".* call1d \\(ul=8, uc=98 'b', us=6, ui=7\\) .*" "continue to call1d"
# Continue; should stop at call1e and print actual arguments.
- if [gdb_test "cont" ".* call1e \\(uc1=98 'b', ul=8, uc2=98 'b', ui=7, uc3=98 'b', us=6, uc4=98 'b', uc5=98 'b'\\) .*" "continue to call1e"] {
- gdb_suppress_tests
- }
- gdb_stop_suppressing_tests
+ 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"
}
#
setup_xfail "rs6000-*-*"
# Continue; should stop at call2b and print actual arguments.
- if [gdb_test "cont" ".* call2b \\(f1=4, s=1, d1=5, i=2, f2=4, l=3, d2=5, c=97 'a'\\) .*" "continue to call2b"] {
- gdb_suppress_tests
- }
+ gdb_test "cont" ".* call2b \\(f1=4, s=1, d1=5, i=2, f2=4, l=3, d2=5, c=97 'a'\\) .*" "continue to call2b"
# Continue; should stop at call2c and print actual arguments.
- if [gdb_test "cont" ".* call2c \\(s=1, d1=5, i=2, f2=4, l=3, d2=5, c=97 'a', f1=4\\) .*" "continue to call2c"] {
- gdb_suppress_tests
- }
+ gdb_test "cont" ".* call2c \\(s=1, d1=5, i=2, f2=4, l=3, d2=5, c=97 'a', f1=4\\) .*" "continue to call2c"
# Continue; should stop at call2d and print actual arguments.
- if [gdb_test "cont" ".* call2d \\(d1=5, i=2, f2=4, l=3, d2=5, c=97 'a', f1=4, s=1\\) .*" "continue to call2d"] {
- gdb_suppress_tests
- }
+ gdb_test "cont" ".* call2d \\(d1=5, i=2, f2=4, l=3, d2=5, c=97 'a', f1=4, s=1\\) .*" "continue to call2d"
# Continue; should stop at call2e and print actual arguments.
- if [gdb_test "cont" ".* call2e \\(i=2, f2=4, l=3, d2=5, c=97 'a', f1=4, s=1, d1=5\\) .*" "continue to call2e"] {
- gdb_suppress_tests
- }
+ gdb_test "cont" ".* call2e \\(i=2, f2=4, l=3, d2=5, c=97 'a', f1=4, s=1, d1=5\\) .*" "continue to call2e"
# Continue; should stop at call2f and print actual arguments.
- if [gdb_test "cont" ".* call2f \\(f2=4, l=3, d2=5, c=97 'a', f1=4, s=1, d1=5, i=2\\) .*" "continue to call2f"] {
- gdb_suppress_tests
- }
+ gdb_test "cont" ".* call2f \\(f2=4, l=3, d2=5, c=97 'a', f1=4, s=1, d1=5, i=2\\) .*" "continue to call2f"
# Continue; should stop at call2g and print actual arguments.
- if [gdb_test "cont" ".* call2g \\(l=3, d2=5, c=97 'a', f1=4, s=1, d1=5, i=2, f2=4\\) .*" "continue to call2g"] {
- gdb_suppress_tests
- }
+ gdb_test "cont" ".* call2g \\(l=3, d2=5, c=97 'a', f1=4, s=1, d1=5, i=2, f2=4\\) .*" "continue to call2g"
# Continue; should stop at call2h and print actual arguments.
- if [gdb_test "cont" ".* call2h \\(d2=5, c=97 'a', f1=4, s=1, d1=5, i=2, f2=4, l=3\\) .*" "continue to call2h"] {
- gdb_suppress_tests
- }
+ gdb_test "cont" ".* call2h \\(d2=5, c=97 'a', f1=4, s=1, d1=5, i=2, f2=4, l=3\\) .*" "continue to call2h"
# monitor only allows 8 breakpoints; w89k board allows 10, so
# break them up into two groups.
gdb_breakpoint call2i
# Continue; should stop at call2i and print actual arguments.
- if [gdb_test "cont" ".* call2i \\(c1=97 'a', f1=4, c2=97 'a', c3=97 'a', d1=5, c4=97 'a', c5=97 'a', c6=97 'a', f2=4, s=1, c7=97 'a', d2=5\\) .*" "continue to call2i"] {
- gdb_suppress_tests
- }
- gdb_stop_suppressing_tests
+ 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"
}
# Continue; should stop at call3b and print actual arguments.
# Try dereferencing the arguments.
- if [gdb_test "cont" ".* call3b \\(ucp=$hex <uc> \"b.*\", usp=$hex <us>, uip=$hex <ui>, ulp=$hex <ul>\\) .*" "continue to call3b"] {
- gdb_suppress_tests
- }
+ gdb_test "cont" ".* call3b \\(ucp=$hex <uc> \"b.*\", usp=$hex <us>, uip=$hex <ui>, ulp=$hex <ul>\\) .*" "continue to call3b"
gdb_test "print *ucp" ".* = 98 'b'"
gdb_test "print *usp" ".* = 6"
# Continue; should stop at call3c and print actual arguments.
# Try dereferencing the arguments.
- if [gdb_test "cont" ".* call3c \\(fp=$hex <f>, dp=$hex <d>\\) .*" "continue to call3c"] {
- gdb_suppress_tests
- }
+ gdb_test "cont" ".* call3c \\(fp=$hex <f>, dp=$hex <d>\\) .*" "continue to call3c"
gdb_test "print *fp" ".* = 4"
gdb_test "print *dp" ".* = 5"
-
-# pass "locate actual args, pointer types"
- gdb_stop_suppressing_tests
}
#
}
pass "locate actual args, structs/unions passed by reference"
- gdb_stop_suppressing_tests
}
#
} else {
fail "print un (unknown case)"
}
-
- gdb_stop_suppressing_tests
}
#
gdb_continue call6b
- if [gdb_test_sequence "backtrace 100" "backtrace from call6b" {
+ gdb_test_sequence "backtrace 100" "backtrace from call6b" {
"\[\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\]#2 .* main \\(.*\\) at "
- } ] {
- gdb_suppress_tests
}
# Continue; should stop at call6c and print actual arguments.
gdb_continue call6c
- if [gdb_test_sequence "backtrace 100" "backtrace from call6c" {
+ gdb_test_sequence "backtrace 100" "backtrace from call6c" {
"\[\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\]#2 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
"\[\r\n\]#3 .* main \\(.*\\) at "
- } ] {
- gdb_suppress_tests
}
+
# Continue; should stop at call6d and print actual arguments.
# Print backtrace.
gdb_continue call6d
- if [gdb_test_sequence "backtrace 100" "backtrace from call6d" {
+ gdb_test_sequence "backtrace 100" "backtrace from call6d" {
"\[\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\]#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\]#4 .* main \\(.*\\) at "
- } ] {
- gdb_suppress_tests
}
# Continue; should stop at call6e and print actual arguments.
gdb_continue call6e
- if [gdb_test_sequence "backtrace 100" "backtrace from call6e" {
+ gdb_test_sequence "backtrace 100" "backtrace from call6e" {
"\[\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\]#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\]#4 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
"\[\r\n\]#5 .* main \\(.*\\) at "
- } ] {
- gdb_suppress_tests
}
# Continue; should stop at call6f and print actual arguments.
gdb_continue call6f
- if [gdb_test_sequence "backtrace 100" "backtrace from call6f" {
+ gdb_test_sequence "backtrace 100" "backtrace from call6f" {
"\[\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\]#2 .* call6d \\(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\]#6 .* main \\(.*\\) at "
- } ] {
- gdb_suppress_tests
}
# Continue; should stop at call6g and print actual arguments.
gdb_continue call6g
- if [gdb_test_sequence "backtrace 100" "backtrace from call6g" {
+ gdb_test_sequence "backtrace 100" "backtrace from call6g" {
"\[\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\]#2 .* call6e \\(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\]#7 .* main \\(.*\\) at "
- } ] {
- gdb_suppress_tests
}
# Continue; should stop at call6h and print actual arguments.
gdb_continue call6h
- if [gdb_test_sequence "backtrace 100" "backtrace from call6h" {
+ gdb_test_sequence "backtrace 100" "backtrace from call6h" {
"\[\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\]#2 .* call6f \\(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\]#8 .* main \\(.*\\) at "
- } ] {
- gdb_suppress_tests
}
# monitor only allows 8 breakpoints; w89k board allows 10, so
gdb_continue call6i
- if [gdb_test_sequence "backtrace 100" "backtrace from call6i" {
+ gdb_test_sequence "backtrace 100" "backtrace from call6i" {
"\[\r\n\]#0 .* call6i \\(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\]#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\]#9 .* main \\(.*\\) at "
- } ] {
- gdb_suppress_tests
}
# Continue; should stop at call6j and print actual arguments.
gdb_continue call6j
- if [gdb_test_sequence "backtrace 100" "backtrace from call6j" {
+ gdb_test_sequence "backtrace 100" "backtrace from call6j" {
"\[\r\n\]#0 .* call6j \\(ul=8\\) "
"\[\r\n\]#1 .* call6i \\(ui=7, ul=8\\) "
"\[\r\n\]#2 .* call6h \\(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\]#10 .* main \\(.*\\) at "
- } ] {
- gdb_suppress_tests
}
# Continue; should stop at call6k and print actual arguments.
# Print backtrace.
gdb_continue call6k
- if [gdb_test_sequence "backtrace 100" "backtrace from call6k" {
+ gdb_test_sequence "backtrace 100" "backtrace from call6k" {
"\[\r\n\]#0 .* call6k \\(\\) "
"\[\r\n\]#1 .* call6j \\(ul=8\\) "
"\[\r\n\]#2 .* call6i \\(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\]#11 .* main \\(.*\\) at "
- } ] {
- gdb_suppress_tests
}
- gdb_stop_suppressing_tests
}
"\[\r\n\]#10 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) "
"\[\r\n\]#11 .* main \\(.*\\) at "
}
- gdb_stop_suppressing_tests
}
#
"\[\r\n\]#6 .* test_struct_args \\(\\) "
"\[\r\n\]#7 .* main \\(.*\\) at "
}
- gdb_stop_suppressing_tests
}
#
global decimal
global gcc_compiled
- if { ! [ runto localvars_after_alloca ] } then { gdb_suppress_tests; }
+ if { ![runto localvars_after_alloca] } {
+ return
+ }
# Print each arg as a double check to see if we can print
# them here as well as with backtrace.
gdb_test "print l" " = 3" "print l in localvars_after_alloca"
gdb_test "backtrace 8" "#0.*localvars_after_alloca \\(c=97 'a', s=1, i=2, l=3\\).*#1.*main.*" "backtrace after alloca"
- gdb_stop_suppressing_tests
}
proc call_after_alloca { } {
global decimal
global gcc_compiled
- if { ! [ runto call_after_alloca_subr ] } then { gdb_suppress_tests; }
+ if { ![runto call_after_alloca_subr] } {
+ return
+ }
# Print each arg as a double check to see if we can print
# them here as well as with backtrace.
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
gdb_test "backtrace 8" "#0.*call_after_alloca_subr \\(c=97 'a', s=1, i=2, l=3, uc=98 'b', us=11, ui=12, ul=13\\).*#1.*call_after_alloca \\(c=97 'a', s=1, i=2, l=3\\).*#2.*main.*" "backtrace from call_after_alloca_subr"
- gdb_stop_suppressing_tests
}
#
# Can not use "runto call0a" as call0a is called several times
# during single run. Instead stop in a marker function and
# take control from there.
- if { ! [ runto marker_indirect_call ] } then { gdb_suppress_tests; }
+ if { ![runto marker_indirect_call] } {
+ return
+ }
# break on the next call to call0a, then delete all the breakpoints
# and start testing.
}
-re ".*$gdb_prompt $" {
fail "finish from indirectly called function"
- gdb_suppress_tests
}
- default {
+ default {
fail "finish from indirectly called function"
- gdb_suppress_tests
}
}
if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
gdb_test "step" "call0a \\(c=97 'a', s=1, i=2, l=3\\).*" \
"stepping into indirectly called function"
- gdb_stop_suppressing_tests
}
#
global decimal
# Stop in a marker function and take control from there.
- if { ! [ runto marker_call_with_trampolines ] } then { gdb_suppress_tests; }
+ if { ![runto marker_call_with_trampolines] } {
+ return
+ }
# Cater for gdb stopping in midline, see comment for finish above.
gdb_test_multiple "finish" "finish from marker_call_with_trampolines" {
-re ".*$gdb_prompt $" {
fail "finish from marker_call_with_trampolines"
}
- default {
+ default {
fail "finish from marker_call_with_trampolines"
- gdb_suppress_tests
}
}
gdb_test_multiple "step" "stepping back to main from function called with trampolines" {
-re "main .* at.*$gdb_prompt $" {
pass "stepping back to main from function called with trampolines"
- gdb_suppress_tests
}
-re "\}.*End of call_with_trampolines.*$gdb_prompt $" {
send_gdb "step\n"
}
default {
fail "stepping back to main from function called with trampolines"
- gdb_suppress_tests
}
}
- gdb_stop_suppressing_tests
}
set prev_timeout $timeout
# Run until we call factorial with 6
gdb_run_cmd
- if [gdb_test "" \
+ gdb_test "" \
"Break.* factorial .value=6. .*" \
- "run to factorial(6)"] then { gdb_suppress_tests }
+ "run to factorial(6)"
# Continue until we call factorial recursively with 5.
- if [gdb_test "continue" \
+ gdb_test "continue" \
"Continuing.*Break.* factorial .value=5. .*" \
- "continue to factorial(5)"] then { gdb_suppress_tests }
+ "continue to factorial(5)"
# Do a backtrace just to confirm how many levels deep we are.
- if [gdb_test "backtrace" \
+ gdb_test "backtrace" \
"#0\[ \t\]+ factorial .value=5..*" \
- "backtrace from factorial(5)"] then { gdb_suppress_tests }
+ "backtrace from factorial(5)"
# Now a "next" should position us at the recursive call, which
# we will be performing with 4.
- if [gdb_test "next" \
+ gdb_test "next" \
".* factorial .value - 1.;.*" \
- "next to recursive call"] then { gdb_suppress_tests }
+ "next to recursive call"
# Disable the breakpoint at the entry to factorial by deleting them all.
# The "next" should run until we return to the next line from this
# OK, we should be back in the same stack frame we started from.
# Do a backtrace just to confirm.
- set result [gdb_test "backtrace" \
+ gdb_test "backtrace" \
"#0\[ \t\]+ factorial .value=120.*\r\n#1\[ \t\]+ \[0-9a-fx\]+ in factorial .value=6..*" \
- "backtrace from factorial(5.1)"]
- if { $result != 0 } { gdb_suppress_tests }
+ "backtrace from factorial(5.1)"
- if [target_info exists gdb,noresults] { gdb_suppress_tests }
- gdb_continue_to_end "recursive next test"
- gdb_stop_suppressing_tests
+ if { ![target_info exists gdb,noresults] } {
+ gdb_continue_to_end "recursive next test"
+ }
}
test_next_with_recursion
"set first instance watchpoint"
# Continue until initial set of b.
- if [gdb_test "continue" \
+ gdb_test "continue" \
"Continuing.*\[Ww\]atchpoint.*: b.*Old value = 0.*New value = 10.*" \
- "continue to first instance watchpoint, first time"] then {
- gdb_suppress_tests
- }
+ "continue to first instance watchpoint, first time"
# Continue inward for a few iterations
gdb_test "continue" "Breakpoint.* recurse \\(a=9\\).*" \
"set second instance watchpoint"
# Continue until initial set of b (second instance).
- if [gdb_test "continue" \
+ gdb_test "continue" \
"Continuing.*\[Ww\]atchpoint.*: b.*Old value = 0.*New value = 5.*"\
- "continue to second instance watchpoint, first time"] then {
- gdb_suppress_tests
- }
+ "continue to second instance watchpoint, first time"
# Continue inward for a few iterations
gdb_test "continue" "Breakpoint.* recurse \\(a=4\\).*" \
"continue to recurse (a = 1)"
# Continue until second set of b (second instance).
- if [gdb_test "continue" \
+ gdb_test "continue" \
"Continuing.*\[Ww\]atchpoint.*: b.*Old value = 5.*New value = 120.*return.*" \
- "continue to second instance watchpoint, second time"] then {
- gdb_suppress_tests
- }
+ "continue to second instance watchpoint, second time"
# Continue again. We should have a watchpoint go out of scope now
- if [gdb_test "continue" \
+ gdb_test "continue" \
"Continuing.*\[Ww\]atchpoint.*deleted.*recurse \\(a=6\\) .*" \
- "second instance watchpoint deleted when leaving scope"] then {
- gdb_suppress_tests
- }
+ "second instance watchpoint deleted when leaving scope"
# Continue until second set of b (first instance).
# 24320 is allowed as the final value for b as that's the value
# b would have on systems with 16bit integers.
#
# We could fix the test program to deal with this too.
- if [gdb_test "continue" \
+ gdb_test "continue" \
"Continuing.*\[Ww\]atchpoint.*b.*Old value = 10.*New value = \(3628800|24320\).*return.*" \
- "continue to first instance watchpoint, second time"] then {
- gdb_suppress_tests
- }
+ "continue to first instance watchpoint, second time"
# Continue again. We should have a watchpoint go out of scope now.
#
# this basically by watching for the frame pointer to change. When
# the frame pointer changes, the test expects to be back in main, but
# instead it is still in the epilogue of the callee.
- if [gdb_test "continue" \
+ gdb_test "continue" \
"Continuing.*\[Ww\]atchpoint.*deleted.*\(main \\(\\) \|21.*\}\).*" \
- "first instance watchpoint deleted when leaving scope"] then {
- gdb_suppress_tests
- }
+ "first instance watchpoint deleted when leaving scope"
}
- gdb_stop_suppressing_tests
}
# Preserve the old timeout, and set a new one that should be
gdb_test "next" "$decimal.*foo \\(\\);" "next over init0() in main"
# Print scope0.c::filelocal, which is 1
-
- if [gdb_test "print filelocal" "\\\$$decimal = 1"] {
- gdb_suppress_tests
- }
-
-
- if [gdb_test "print 'scope0.c'::filelocal" "\\\$$decimal = 1" "print 'scope0.c'::filelocal at main" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal"] {
- gdb_suppress_tests
- }
-
+ gdb_test "print filelocal" "\\\$$decimal = 1"
+ gdb_test "print 'scope0.c'::filelocal" "\\\$$decimal = 1" "print 'scope0.c'::filelocal at main" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal"
# Print scope0.c::filelocal_bss, which is 101
-
- if [gdb_test "print filelocal_bss" "\\\$$decimal = 101"] {
- gdb_suppress_tests
- }
-
-
- if [gdb_test "print 'scope0.c'::filelocal_bss" "\\\$$decimal = 101" "print 'scope0.c'::filelocal_bss in test_at_main" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal_bss"] {
- gdb_suppress_tests
- }
-
+ gdb_test "print filelocal_bss" "\\\$$decimal = 101"
+ gdb_test "print 'scope0.c'::filelocal_bss" "\\\$$decimal = 101" "print 'scope0.c'::filelocal_bss in test_at_main" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal_bss"
# Print scope0.c::filelocal_ro, which is 201
# No clue why the rs6000 fails this test.
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
- if [gdb_test "print filelocal_ro" "\\\$$decimal = 201" "print filelocal_ro in test_at_main" ] {
- gdb_suppress_tests
- }
-
+ gdb_test "print filelocal_ro" "\\\$$decimal = 201" "print filelocal_ro in test_at_main"
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
- if [gdb_test "print 'scope0.c'::filelocal_ro" "\\\$$decimal = 201" "print 'scope0.c'::filelocal_ro" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal_ro"] {
- gdb_suppress_tests
- }
-
+ gdb_test "print 'scope0.c'::filelocal_ro" "\\\$$decimal = 201" "print 'scope0.c'::filelocal_ro" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal_ro"
# Print scope1.c::filelocal, which is 2
-
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
- if [gdb_test "print 'scope1.c'::filelocal" "\\\$$decimal = 2" "print 'scope1.c'::filelocal" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal"] {
- gdb_suppress_tests
- }
-
+ gdb_test "print 'scope1.c'::filelocal" "\\\$$decimal = 2" "print 'scope1.c'::filelocal" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal"
# Print scope1.c::filelocal_bss, which is 102
-
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
- if [gdb_test "print 'scope1.c'::filelocal_bss" "\\\$$decimal = 102" "print 'scope1.c'::filelocal_bss" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal_bss"] {
- gdb_suppress_tests
- }
-
+ gdb_test "print 'scope1.c'::filelocal_bss" "\\\$$decimal = 102" "print 'scope1.c'::filelocal_bss" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal_bss"
# Print scope1.c::filelocal_ro, which is 202
-
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
- if [gdb_test "print 'scope1.c'::filelocal_ro" "\\\$$decimal = 202" "print 'scope1.c'::filelocal_ro" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal_ro"] {
- gdb_suppress_tests
- }
-
+ gdb_test "print 'scope1.c'::filelocal_ro" "\\\$$decimal = 202" "print 'scope1.c'::filelocal_ro" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal_ro"
# Print scope1.c::foo::funclocal, which is 3
-
- if [gdb_test "print foo::funclocal" "\\\$$decimal = 3"] {
- gdb_suppress_tests
- }
-
+ gdb_test "print foo::funclocal" "\\\$$decimal = 3"
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
- if [gdb_test "print 'scope1.c'::foo::funclocal" "\\\$$decimal = 3" "print 'scope1.c'::foo::funclocal" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal"] {
- gdb_suppress_tests
- }
-
+ gdb_test "print 'scope1.c'::foo::funclocal" "\\\$$decimal = 3" "print 'scope1.c'::foo::funclocal" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal"
# Print scope1.c::foo::funclocal_ro, which is 203
-
- if [gdb_test "print foo::funclocal_ro" "\\\$$decimal = 203"] {
- gdb_suppress_tests
- }
-
+ gdb_test "print foo::funclocal_ro" "\\\$$decimal = 203"
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
- if [gdb_test "print 'scope1.c'::foo::funclocal_ro" "\\\$$decimal = 203" "print 'scope1.c'::foo::funclocal_ro" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal_ro"] {
- gdb_suppress_tests
- }
-
+ gdb_test "print 'scope1.c'::foo::funclocal_ro" "\\\$$decimal = 203" "print 'scope1.c'::foo::funclocal_ro" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal_ro"
# Print scope1.c::bar::funclocal, which is 4
-
- if [gdb_test "print bar::funclocal" "\\\$$decimal = 4"] {
- gdb_suppress_tests
- }
-
+ gdb_test "print bar::funclocal" "\\\$$decimal = 4"
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
- if [gdb_test "print 'scope1.c'::bar::funclocal" "\\\$$decimal = 4" "print 'scope1.c'::bar::funclocal" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::bar::funclocal"] {
- gdb_suppress_tests
- }
- gdb_stop_suppressing_tests
-
+ gdb_test "print 'scope1.c'::bar::funclocal" "\\\$$decimal = 4" "print 'scope1.c'::bar::funclocal" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::bar::funclocal"
}
proc test_at_foo {} {
global srcdir
global subdir
- if [gdb_test "next" ".*bar \\(\\);" "" ] {
- gdb_suppress_tests
- }
-
+ gdb_test "next" ".*bar \\(\\);"
# Print scope0.c::filelocal, which is 1
-
- if [gdb_test "print 'scope0.c'::filelocal" "\\\$$decimal = 1" "print 'scope0.c'::filelocal at foo" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal"] {
- gdb_suppress_tests
- }
-
+ gdb_test "print 'scope0.c'::filelocal" "\\\$$decimal = 1" "print 'scope0.c'::filelocal at foo" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal"
# Print scope0.c::filelocal_bss, which is 101
-
- if [gdb_test "print 'scope0.c'::filelocal_bss" "\\\$$decimal = 101" "print 'scope0.c'::filelocal_bss in test_at_foo" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal_bss"] {
- gdb_suppress_tests
- }
-
+ gdb_test "print 'scope0.c'::filelocal_bss" "\\\$$decimal = 101" "print 'scope0.c'::filelocal_bss in test_at_foo" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal_bss"
# Print scope0.c::filelocal_ro, which is 201
-
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
- if [gdb_test "print 'scope0.c'::filelocal_ro" "\\\$$decimal = 201" "print 'scope0.c'::filelocal_ro" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal_ro"] {
- gdb_suppress_tests
- }
+ gdb_test "print 'scope0.c'::filelocal_ro" "\\\$$decimal = 201" "print 'scope0.c'::filelocal_ro" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal_ro"
- gdb_test "print filelocal" "\\\$$decimal = 2" "print filelocal at foo"
-
# Print scope1.c::filelocal, which is 2
+ gdb_test "print filelocal" "\\\$$decimal = 2" "print filelocal at foo"
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
- if [gdb_test "print 'scope1.c'::filelocal" "\\\$$decimal = 2" "print 'scope1.c'::filelocal at foo" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal"] {
- gdb_suppress_tests
- }
-
+ gdb_test "print 'scope1.c'::filelocal" "\\\$$decimal = 2" "print 'scope1.c'::filelocal at foo" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal"
gdb_test "print filelocal_bss" "\\\$$decimal = 102" \
"print filelocal_bss at foo"
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
gdb_test "print 'scope1.c'::bar::funclocal" "\\\$$decimal = 4" "print 'scope1.c'::bar::funclocal at foo" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::bar::funclocal"
- gdb_stop_suppressing_tests
}
global srcdir
global subdir
- if [gdb_test "next" ".*" "" ] {
- gdb_suppress_tests
- }
-
+ gdb_test "next"
# Print scope0.c::filelocal, which is 1
+ gdb_test "print 'scope0.c'::filelocal" "\\\$$decimal = 1" "print 'scope0.c'::filelocal at bar" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal"
- if [gdb_test "print 'scope0.c'::filelocal" "\\\$$decimal = 1" "print 'scope0.c'::filelocal at bar" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal"] {
- gdb_suppress_tests
- }
-
-
- # Print scope0.c::filelocal_bss, which is 101
-
- if [gdb_test "print 'scope0.c'::filelocal_bss" "\\\$$decimal = 101" "print 'scope0.c'::filelocal_bss in test_at_bar" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal_bss"] {
- gdb_suppress_tests
- }
-
-
- # Print scope0.c::filelocal_ro, which is 201
+ # Print scope0.c::filelocal_bss, which is 101
+ gdb_test "print 'scope0.c'::filelocal_bss" "\\\$$decimal = 101" "print 'scope0.c'::filelocal_bss in test_at_bar" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal_bss"
+ # Print scope0.c::filelocal_ro, which is 201
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
- if [gdb_test "print 'scope0.c'::filelocal_ro" "\\\$$decimal = 201" "print 'scope0.c'::filelocal_ro at bar" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal_ro"] {
- gdb_suppress_tests
- }
-
+ gdb_test "print 'scope0.c'::filelocal_ro" "\\\$$decimal = 201" "print 'scope0.c'::filelocal_ro at bar" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal_ro"
# Print scope1.c::filelocal, which is 2
-
- if [gdb_test "print filelocal" "\\\$$decimal = 2" "print filelocal at bar" ] {
- gdb_suppress_tests
- }
-
+ gdb_test "print filelocal" "\\\$$decimal = 2" "print filelocal at bar"
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
- if [gdb_test "print 'scope1.c'::filelocal" "\\\$$decimal = 2" "print 'scope1.c'::filelocal at bar" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal"] {
- gdb_suppress_tests
- }
-
+ gdb_test "print 'scope1.c'::filelocal" "\\\$$decimal = 2" "print 'scope1.c'::filelocal at bar" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal"
# Print scope1.c::filelocal_bss, which is 102
-
- if [gdb_test "print filelocal_bss" "\\\$$decimal = 102" "print filelocal_bss at bar" ] {
- gdb_suppress_tests
- }
-
+ gdb_test "print filelocal_bss" "\\\$$decimal = 102" "print filelocal_bss at bar"
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
- if [gdb_test "print 'scope1.c'::filelocal_bss" "\\\$$decimal = 102" "print 'scope1.c'::filelocal_bss at bar" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal_bss"] {
- gdb_suppress_tests
- }
-
+ gdb_test "print 'scope1.c'::filelocal_bss" "\\\$$decimal = 102" "print 'scope1.c'::filelocal_bss at bar" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal_bss"
# Print scope1.c::filelocal_ro, which is 202
-
- if [gdb_test "print filelocal_ro" "\\\$$decimal = 202" "print filelocal_ro in test_at_bar" ] {
- gdb_suppress_tests
- }
-
+ gdb_test "print filelocal_ro" "\\\$$decimal = 202" "print filelocal_ro in test_at_bar"
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
- if [gdb_test "print 'scope1.c'::filelocal_ro" "\\\$$decimal = 202" "print 'scope1.c'::filelocal_ro at bar" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal_ro"] {
- gdb_suppress_tests
- }
-
+ gdb_test "print 'scope1.c'::filelocal_ro" "\\\$$decimal = 202" "print 'scope1.c'::filelocal_ro at bar" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal_ro"
# Print scope1.c::foo::funclocal, which is 3
-
- if [gdb_test "print foo::funclocal" "\\\$$decimal = 3" "print foo::funclocal at bar" ] {
- gdb_suppress_tests
- }
-
+ gdb_test "print foo::funclocal" "\\\$$decimal = 3" "print foo::funclocal at bar"
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
- if [gdb_test "print 'scope1.c'::foo::funclocal" "\\\$$decimal = 3" "print 'scope1.c'::foo::funclocal at bar" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal"] {
- gdb_suppress_tests
- }
-
+ gdb_test "print 'scope1.c'::foo::funclocal" "\\\$$decimal = 3" "print 'scope1.c'::foo::funclocal at bar" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal"
# Print scope1.c::foo::funclocal_bss, which is 103
-
- if [gdb_test "print foo::funclocal_bss" "\\\$$decimal = 103" "print foo::funclocal_bss at bar" ] {
- gdb_suppress_tests
- }
-
+ gdb_test "print foo::funclocal_bss" "\\\$$decimal = 103" "print foo::funclocal_bss at bar"
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
- if [gdb_test "print 'scope1.c'::foo::funclocal_bss" "\\\$$decimal = 103" "print 'scope1.c'::foo::funclocal_bss at bar" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal_bss"] {
- gdb_suppress_tests
- }
-
+ gdb_test "print 'scope1.c'::foo::funclocal_bss" "\\\$$decimal = 103" "print 'scope1.c'::foo::funclocal_bss at bar" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal_bss"
# Print scope1.c::foo::funclocal_ro, which is 203
-
- if [gdb_test "print foo::funclocal_ro" "\\\$$decimal = 203" "print foo::funclocal_ro at bar" ] {
- gdb_suppress_tests
- }
-
+ gdb_test "print foo::funclocal_ro" "\\\$$decimal = 203" "print foo::funclocal_ro at bar"
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
- if [gdb_test "print 'scope1.c'::foo::funclocal_ro" "\\\$$decimal = 203" "print 'scope1.c'::foo::funclocal_ro at bar" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal_ro"] {
- gdb_suppress_tests
- }
-
+ gdb_test "print 'scope1.c'::foo::funclocal_ro" "\\\$$decimal = 203" "print 'scope1.c'::foo::funclocal_ro at bar" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal_ro"
# Print scope1.c::bar::funclocal, which is 4
-
- if [gdb_test "print funclocal" "\\\$$decimal = 4" "print funclocal at bar" ] {
- gdb_suppress_tests
- }
-
-
- if [gdb_test "print bar::funclocal" "\\\$$decimal = 4" "print bar::funclocal at bar" ] {
- gdb_suppress_tests
- }
-
+ gdb_test "print funclocal" "\\\$$decimal = 4" "print funclocal at bar"
+ gdb_test "print bar::funclocal" "\\\$$decimal = 4" "print bar::funclocal at bar"
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
- if [gdb_test "print 'scope1.c'::bar::funclocal" "\\\$$decimal = 4" "print 'scope1.c'::bar::funclocal at bar" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::bar::funclocal"] {
- gdb_suppress_tests
- }
-
+ gdb_test "print 'scope1.c'::bar::funclocal" "\\\$$decimal = 4" "print 'scope1.c'::bar::funclocal at bar" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::bar::funclocal"
# Print scope1.c::bar::funclocal_bss, which is 104
-
- if [gdb_test "print funclocal_bss" "\\\$$decimal = 104" "print funclocal_bss at bar" ] {
- gdb_suppress_tests
- }
-
-
- if [gdb_test "print bar::funclocal_bss" "\\\$$decimal = 104" "print bar::funclocal_bss at bar" ] {
- gdb_suppress_tests
- }
-
+ gdb_test "print funclocal_bss" "\\\$$decimal = 104" "print funclocal_bss at bar"
+ gdb_test "print bar::funclocal_bss" "\\\$$decimal = 104" "print bar::funclocal_bss at bar"
if { [test_compiler_info gcc-*-*] } then { setup_xfail "rs6000-*-*" }
- if [gdb_test "print 'scope1.c'::bar::funclocal_bss" "\\\$$decimal = 104" "print 'scope1.c'::bar::funclocal_bss at bar" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::bar::funclocal_bss"] {
- gdb_suppress_tests
- }
- gdb_stop_suppressing_tests
-
+ gdb_test "print 'scope1.c'::bar::funclocal_bss" "\\\$$decimal = 104" "print 'scope1.c'::bar::funclocal_bss at bar" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::bar::funclocal_bss"
}
# This test has little to do with local scopes, but it is in scope.exp anyway.
gdb_breakpoint marker1
- if [gdb_test "cont" "Break.* marker1 \\(\\) at .*:$decimal.*" "continue to marker1"] {
- gdb_suppress_tests
- }
-
- if [gdb_test "up" ".*autovars.*" "up from marker1 in scope.exp" ] {
- gdb_suppress_tests
- }
+ gdb_test "cont" "Break.* marker1 \\(\\) at .*:$decimal.*" "continue to marker1"
+ gdb_test "up" ".*autovars.*" "up from marker1 in scope.exp"
set count 0
while {$count < 100} {
- if [gdb_test "print i$count" ".* = $count" "" ] {
- gdb_suppress_tests
- }
-
+ gdb_test "print i$count" ".* = $count" ""
set count [expr $count+1]
}
clear_xfail "*-*-*"
gdb_breakpoint marker3
gdb_breakpoint marker4
- if [gdb_test "cont" "Break.* marker2 \\(\\) at .*:$decimal.*" "continue to marker2"] {
- gdb_suppress_tests
- }
- if [gdb_test "up" ".*localscopes.*" "up from marker2 in scopes.exp" ] {
- gdb_suppress_tests
- }
+ gdb_test "cont" "Break.* marker2 \\(\\) at .*:$decimal.*" "continue to marker2"
+ gdb_test "up" ".*localscopes.*" "up from marker2 in scopes.exp"
# Should be at first (outermost) scope. Check values.
gdb_test "print localval3" "No symbol \"localval3\" in current context." \
"print localval3, outer scope"
- if [gdb_test "cont" "Break.* marker3 \\(\\) at .*:$decimal.*" \
- "continue to marker3 in scope.exp"] then { gdb_suppress_tests }
- if [gdb_test "up" ".*localscopes.*" "up from marker3 in scope.exp"] {
- gdb_suppress_tests
- }
+ gdb_test "cont" "Break.* marker3 \\(\\) at .*:$decimal.*" \
+ "continue to marker3 in scope.exp"
+ gdb_test "up" ".*localscopes.*" "up from marker3 in scope.exp"
# Should be at next (first nested) scope. Check values.
# This test will only fail if the file was compiled by gcc, but
# there's no way to check that.
- if [gdb_test "cont" "Break.* marker4.*at .*:$decimal.*" \
- "continue to marker4 in scope.exp"] then { gdb_suppress_tests }
- if [gdb_test "up" ".*localscopes.*" "up from marker4 in scope.exp"] {
- gdb_suppress_tests
- }
+ gdb_test "cont" "Break.* marker4.*at .*:$decimal.*" \
+ "continue to marker4 in scope.exp"
+ gdb_test "up" ".*localscopes.*" "up from marker4 in scope.exp"
gdb_test "print localval" " = 30" "print localval, innermost scope"
gdb_test "print localval1" " = 11" "print localval1, innermost scope"
gdb_test "print localval2" " = 12" "print localval2, innermost scope"
gdb_test "print localval3" " = 13" "print localval3, innermost scope"
- gdb_stop_suppressing_tests
}
# Note, we don't pass a binfile to clean_restart because we need to
# Continue until we call factorial recursively with 5.
- if [gdb_test "continue" \
+ gdb_test "continue" \
"Continuing.*Break.* factorial .value=5. .*" \
- "continue to factorial(5)"] then { gdb_suppress_tests }
+ "continue to factorial(5)"
# Do a backtrace just to confirm how many levels deep we are.
- if [gdb_test "backtrace" \
+ gdb_test "backtrace" \
"#0\[ \t\]+ factorial .value=5..*" \
- "backtrace from factorial(5)"] then { gdb_suppress_tests }
+ "backtrace from factorial(5)"
# Now a "next" should position us at the recursive call, which
# we will be performing with 4.
- if [gdb_test "next" \
+ gdb_test "next" \
".* factorial .value - 1.;.*" \
- "next to recursive call"] then { gdb_suppress_tests }
+ "next to recursive call"
# Disable the breakpoint at the entry to factorial by deleting them all.
# The "next" should run until we return to the next line from this
# OK, we should be back in the same stack frame we started from.
# Do a backtrace just to confirm.
- set result [gdb_test "backtrace" \
+ gdb_test "backtrace" \
"#0\[ \t\]+ factorial .value=120.*\r\n#1\[ \t\]+ \[0-9a-fx\]+ in factorial .value=6..*" \
- "backtrace from factorial(5.1)"]
- if { $result != 0 } { gdb_suppress_tests }
+ "backtrace from factorial(5.1)"
- if [target_info exists gdb,noresults] { gdb_suppress_tests }
- gdb_continue_to_end "recursive next test"
- gdb_stop_suppressing_tests
+ if { ![target_info exists gdb,noresults] } {
+ gdb_continue_to_end "recursive next test"
+ }
}
test_next_with_recursion
# Advance to main
if { ![runto_main] } then {
- gdb_suppress_tests
+ return
}
# Get the debug format
"malformed until"
# Rerun up to factorial, outer invocation
-if { ![runto factorial] } then { gdb_suppress_tests; }
+if { ![runto factorial] } {
+ return
+}
+
delete_breakpoints
# At this point, 'until' should continue the inferior up to when all the
# Run to a function called by main
#
-if { ![runto marker2] } then { gdb_suppress_tests; }
+if { ![runto marker2] } {
+ return
+}
+
delete_breakpoints
# Now issue an until with another function, not called by the current
}
set last_ent [expr [llength $args] - 1]
set testname [lindex $args $last_ent]
- if [gdb_test_no_output [lindex $args 0] "$testname (setup)"] {
- gdb_suppress_tests
- }
+ gdb_test_no_output [lindex $args 0] "$testname (setup)"
+
for {set x 1} {$x < $last_ent} {set x [expr $x + 2]} {
- if [gdb_test [lindex $args $x] [lindex $args [expr $x + 1]] "$testname ([lindex $args $x])"] {
- gdb_suppress_tests
- }
+ gdb_test [lindex $args $x] [lindex $args [expr $x + 1]] "$testname ([lindex $args $x])"
}
- gdb_stop_suppressing_tests
}
proc do_tests {} {
if { $foo < [expr $len - 1] } {
set str [string range "$string" 0 $foo]
if { [send_gdb "$str"] != "" } {
- global suppress_flag
-
- if { ! $suppress_flag } {
- perror "Couldn't send $command to GDB."
- }
- fail "$message"
- return $result
+ perror "Couldn't send $command to GDB."
}
# since we're checking if each line of the multi-line
# command are 'accepted' by GDB here,
}
if { "$string" != "" } {
if { [send_gdb "$string"] != "" } {
- global suppress_flag
-
- if { ! $suppress_flag } {
- perror "Couldn't send $command to GDB."
- }
- fail "$message"
- return $result
+ perror "Couldn't send $command to GDB."
}
}
}
if { $message != "" } {
fail "$message"
}
- gdb_suppress_entire_file "GDB died"
set result -1
}
}
global gdb_spawn_id inferior_spawn_id
global inotify_log_file
- gdb_stop_suppressing_tests
-
if ![info exists gdb_spawn_id] {
return
}
global INTERNAL_GDBFLAGS GDBFLAGS
global gdb_spawn_id
- gdb_stop_suppressing_tests
-
# Set the default value, it may be overriden later by specific testfile.
#
# Use `set_board_info use_gdb_stub' for the board file to flag the inferior
# For options for TYPE see gdb_stdin_log_write
proc send_gdb { string {type standard}} {
- global suppress_flag
- if { $suppress_flag } {
- return "suppressed"
- }
gdb_stdin_log_write $string $type
return [remote_send host "$string"]
}
set tmt [get_largest_timeout]
}
- global suppress_flag
- global remote_suppress_flag
- if [info exists remote_suppress_flag] {
- set old_val $remote_suppress_flag
- }
- if [info exists suppress_flag] {
- if { $suppress_flag } {
- set remote_suppress_flag 1
- }
- }
set code [catch \
{uplevel remote_expect host $tmt $expcode} string]
- if [info exists old_val] {
- set remote_suppress_flag $old_val
- } else {
- if [info exists remote_suppress_flag] {
- unset remote_suppress_flag
- }
- }
if {$code == 1} {
global errorInfo errorCode
proc gdb_expect_list {test sentinel list} {
global gdb_prompt
- global suppress_flag
set index 0
set ok 1
- if { $suppress_flag } {
- set ok 0
- unresolved "${test}"
- }
+
while { ${index} < [llength ${list}] } {
set pattern [lindex ${list} ${index}]
set index [expr ${index} + 1]
}
}
-#
-#
-proc gdb_suppress_entire_file { reason } {
- global suppress_flag
-
- warning "$reason\n"
- set suppress_flag -1
-}
-
-#
-# Set suppress_flag, which will cause all subsequent calls to send_gdb and
-# gdb_expect to fail immediately (until the next call to
-# gdb_stop_suppressing_tests).
-#
-proc gdb_suppress_tests { args } {
- global suppress_flag
-
- return; # fnf - disable pending review of results where
- # testsuite ran better without this
- incr suppress_flag
-
- if { $suppress_flag == 1 } {
- if { [llength $args] > 0 } {
- warning "[lindex $args 0]\n"
- } else {
- warning "Because of previous failure, all subsequent tests in this group will automatically fail.\n"
- }
- }
-}
-
-#
-# Clear suppress_flag.
-#
-proc gdb_stop_suppressing_tests { } {
- global suppress_flag
-
- if [info exists suppress_flag] {
- if { $suppress_flag > 0 } {
- set suppress_flag 0
- clone_output "Tests restarted.\n"
- }
- } else {
- set suppress_flag 0
- }
-}
-
-proc gdb_clear_suppressed { } {
- global suppress_flag
-
- set suppress_flag 0
-}
-
# Spawn the gdb process.
#
# This doesn't expect any output or do any other initialization,
set cleanfiles {}
- gdb_clear_suppressed
-
set gdb_test_file_name [file rootname [file tail $test_file_name]]
# Make sure that the wrapper is rebuilt
global mi_gdb_prompt
global MIFLAGS
- gdb_stop_suppressing_tests
-
if { [info procs sid_exit] != "" } {
sid_exit
}
return [eval mi_gdb_start_separate_mi_tty $args]
}
- gdb_stop_suppressing_tests
set inferior_pty no-tty
# Set the default value, it may be overriden later by specific testfile.
global mi_gdb_prompt
global MIFLAGS
- global suppress_flag
- if { $suppress_flag } {
- return
- }
-
if [is_remote host] {
return ""
}
if { $foo < [expr $len - 1] } {
set str [string range "$string" 0 $foo]
if { [send_gdb "$str"] != "" } {
- global suppress_flag
-
- if { ! $suppress_flag } {
- perror "Couldn't send $command to GDB."
- }
- fail "$message"
- return $result
+ perror "Couldn't send $command to GDB."
}
gdb_expect 2 {
-re "\[\r\n\]" { }
}
if { "$string" != "" } {
if { [send_gdb "$string"] != "" } {
- global suppress_flag
-
- if { ! $suppress_flag } {
- perror "Couldn't send $command to GDB."
- }
- fail "$message"
- return $result
+ perror "Couldn't send $command to GDB."
}
}
}
if { $message != "" } {
fail "$message"
}
- gdb_suppress_entire_file "GDB died"
return -1
}
-re "Ending remote debugging.*$mi_gdb_prompt\[ \]*$" {
# If USE_MI_COMMAND is false, they are effectively arguments passed
# to the test program. If the global USE_GDB_STUB is true, ARGS is not used.
proc mi_run_cmd_full {use_mi_command args} {
- global suppress_flag
- if { $suppress_flag } {
- return -1
- }
global mi_gdb_prompt use_gdb_stub
global thread_selected_re
global library_loaded_re
#
# FUNC is the linespec of the place to stop (it inserts a breakpoint here).
# It returns:
-# -1 if test suppressed, failed, timedout
+# -1 if failed, timedout
# 0 if test passed
#
# Supported options:
# -qualified -- pass --qualified to -break-insert
proc mi_runto_helper {func run_or_continue args} {
- global suppress_flag
- if { $suppress_flag } {
- return -1
- }
-
global mi_gdb_prompt expect_out
global hex decimal fullname_syntax
# after the first prompt is printed.
proc mi_execute_to { cmd reason func args file line extra test } {
- global suppress_flag
- if { $suppress_flag } {
- return -1
- }
-
mi_send_resuming_command "$cmd" "$test"
set r [mi_expect_stop $reason $func $args $file $line $extra $test]
return $r
global timeout
global gdb_spawn_id
- gdb_stop_suppressing_tests
-
verbose "Spawning $GDB $INTERNAL_GDBFLAGS $GDBFLAGS"
if [info exists gdb_spawn_id] {