[gdb/testsuite] Fix target_supports_scheduler_locking raciness
authorTom de Vries <tdevries@suse.de>
Thu, 4 Oct 2018 12:10:39 +0000 (14:10 +0200)
committerTom de Vries <tdevries@suse.de>
Tue, 9 Oct 2018 13:33:00 +0000 (15:33 +0200)
When calling gdb_start_cmd, it's the caller's responsibility to wait for gdb
to return to the prompt.  In target_supports_scheduler_locking, that's not the
case, and consequently, target_supports_scheduler_locking fails spuriously.

Fix by using runto_main instead.

Build and reg-tested on x86_64-linux.

2018-10-09  Tom de Vries  <tdevries@suse.de>

* lib/gdb.exp (target_supports_scheduler_locking): Replace gdb_start_cmd
with runto_main.

gdb/testsuite/ChangeLog
gdb/testsuite/lib/gdb.exp

index d35abb51528424ece6a9c805b71596a669a2122f..c6275787149d5e66117ec807a3649b85f37b6bf3 100644 (file)
@@ -1,3 +1,8 @@
+2018-10-09  Tom de Vries  <tdevries@suse.de>
+
+       * lib/gdb.exp (target_supports_scheduler_locking): Replace gdb_start_cmd
+       with runto_main.
+
 2018-10-08  Weimin Pan  <weimin.pan@oracle.com>
 
        PR c++/16841
index e91a3c8d3af0cf7bdad482d463c73b92a3af48a0..2d197d9b5c8a05bd7832ace35f24ec75eb1d2fa7 100644 (file)
@@ -5971,7 +5971,9 @@ gdb_caching_proc target_supports_scheduler_locking {
     }
 
     clean_restart $obj
-    gdb_start_cmd
+    if ![runto_main] {
+        return 0
+    }
 
     set supports_schedule_locking -1
     set current_schedule_locking_mode ""