* gdb.server/ext-run.exp: Fix intermittent failures.
authorDoug Evans <dje@google.com>
Thu, 18 Nov 2010 20:25:12 +0000 (20:25 +0000)
committerDoug Evans <dje@google.com>
Thu, 18 Nov 2010 20:25:12 +0000 (20:25 +0000)
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.server/ext-run.exp

index d3d76ef06f97134884fa605554800f5f5cc34695..a2798f99ef4d85b4f977788e840703fb57b0ce51 100644 (file)
@@ -1,3 +1,7 @@
+2010-11-18  Doug Evans  <dje@google.com>
+
+       * gdb.server/ext-run.exp: Fix intermittent failures.
+
 2010-11-12  Nathan Froyd  <froydnj@codesourcery.com>
 
        * gdb.stabs/gdb11479.exp: Use runto_main.
index d8fda739260bd95ef4bd7ec5ec630b498bca893d..e268a7d97af9be2b63b44caf58198915e836dc2d 100644 (file)
@@ -52,7 +52,22 @@ if { [istarget *-*-linux*] } {
     # On Linux, gdbserver can also report the list of processes.
     # But only if xml support is compiled in.
     if { $do_xml_test } {
-       gdb_test "info os processes" ".*pid +user +command.*1 +root +\[/a-z\]*init.*" "get process list"
+       # This is done in a way to avoid the timeout that can occur from
+       # applying .* regexp to large output.  It is copied from
+       # gdb.base/maint.exp "maint check-symtabs".
+       send_gdb "info os processes\n"
+       gdb_expect {
+           -re ".*pid +user +command.*1 +root +\[/a-z\]*init" {
+               gdb_expect {
+                   -re "$gdb_prompt $" {
+                       pass "get process list"
+                   }
+                   timeout { fail "(timeout) get process list" }
+               }
+           }
+           -re ".*$gdb_prompt $" { fail "get process list" }
+           timeout { fail "(timeout) get process list" }
+       }
     }
 }
 
This page took 0.04177 seconds and 4 git commands to generate.