@@ -23,8 +23,24 @@ require !gdb_debug_enabled
proc test_set_osabi_none { } {
clean_restart
+ # Because the test enables debug output, which is somewhat verbose, if we
+ # look just for the specific line we want to see may timeout before GDB
+ # prints the next prompt when running in very slow or overloaded machines
+ # (especially when the read1 tool is used). We need to consume all the
+ # debug output to avoid triggering the timeout, so use line-by-line
+ # matching.
gdb_test_no_output "set debug arch 1"
- gdb_test "set osabi none" ".*gdbarch_find_by_info: info.osabi 1 \\(none\\).*"
+ set saw_info_osabi 0
+ set test "set osabi none"
+ gdb_test_multiple $test $test -lbl {
+ -re "\r\ngdbarch_find_by_info: info.osabi 1 \\(none\\)(?=\r\n)" {
+ set saw_info_osabi 1
+ exp_continue
+ }
+ -re "$::gdb_prompt \$" {
+ gdb_assert { $saw_info_osabi } $test
+ }
+ }
}
test_set_osabi_none