From 405e54e9944dcdcea88518f8d9bdbeff6752d78f Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Tue, 1 Nov 2011 20:00:01 +0000 Subject: [PATCH] gdb/testsuite/ Fix racy FAILs. * lib/mi-support.exp (mi_gdb_test): Replace thread_selected_re and breakpoint_re globals import by async. Set string_regex to .* for async. Remove the optional thread_selected_re and breakpoint_re globals expectations. --- gdb/testsuite/ChangeLog | 8 ++++++++ gdb/testsuite/lib/mi-support.exp | 9 +++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 8f275c66ff3..ba24a37bc71 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2011-11-01 Jan Kratochvil + + Fix racy FAILs. + * lib/mi-support.exp (mi_gdb_test): Replace thread_selected_re and + breakpoint_re globals import by async. Set string_regex to .* for + async. Remove the optional thread_selected_re and breakpoint_re + globals expectations. + 2011-11-01 Joseph Myers * gdb.base/maint.exp: XFAIL "maint info sections DATA" on MinGW as diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp index fd57de1ab35..d729c4baeab 100644 --- a/gdb/testsuite/lib/mi-support.exp +++ b/gdb/testsuite/lib/mi-support.exp @@ -576,7 +576,7 @@ proc mi_gdb_test { args } { global verbose global mi_gdb_prompt global GDB expect_out - global inferior_exited_re thread_selected_re breakpoint_re + global inferior_exited_re async upvar timeout timeout set command [lindex $args 0] @@ -651,6 +651,11 @@ proc mi_gdb_test { args } { set tmt 60; } } + if {$async} { + # With $prompt_re "" there may come arbitrary asynchronous response + # from the previous command, before or after $string_regex. + set string_regex ".*" + } verbose -log "Expecting: ^($string_regex\[\r\n\]+)?($pattern\[\r\n\]+$mi_gdb_prompt\[ \]*)" gdb_expect $tmt { -re "\\*\\*\\* DOSEXIT code.*" { @@ -668,7 +673,7 @@ proc mi_gdb_test { args } { gdb_start set result -1 } - -re "^(?:$thread_selected_re|$breakpoint_re)*($string_regex\[\r\n\]+)?($pattern\[\r\n\]+$mi_gdb_prompt\[ \]*)" { + -re "^($string_regex\[\r\n\]+)?($pattern\[\r\n\]+$mi_gdb_prompt\[ \]*)" { # At this point, $expect_out(1,string) is the MI input command. # and $expect_out(2,string) is the MI output command. # If $expect_out(1,string) is "", then there was no MI input command here. -- 2.30.2