OSDN Git Service

gdb/testsuite/
authorjkratoch <jkratoch>
Tue, 1 Nov 2011 20:00:00 +0000 (20:00 +0000)
committerjkratoch <jkratoch>
Tue, 1 Nov 2011 20:00:00 +0000 (20:00 +0000)
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
gdb/testsuite/lib/mi-support.exp

index 8f275c6..ba24a37 100644 (file)
@@ -1,3 +1,11 @@
+2011-11-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       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  <joseph@codesourcery.com>
 
        * gdb.base/maint.exp: XFAIL "maint info sections DATA" on MinGW as
index fd57de1..d729c4b 100644 (file)
@@ -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.