gdb: add target_ops::supports_displaced_step
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.mi / mi-ns-stale-regcache.exp
index 24bc73ec65b1a6fe66e530a93bac7f1856ee0db8..35a6315470e55f088e70e18b95cff044a20714aa 100644 (file)
@@ -1,5 +1,4 @@
-# Copyright 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
-# Free Software Foundation, Inc.
+# Copyright 2002-2020 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # Regression test for PR11557.  Make sure we don't end up with a stale
 # register cache just after resuming a thread.
 
+if { ![support_displaced_stepping] } { 
+    unsupported "displaced stepping"
+    return -1
+}
+
 load_lib mi-support.exp
 set MIFLAGS "-i=mi"
 
@@ -37,11 +41,9 @@ proc mi_nonstop_resume { command test } {
 #
 # Start here
 #
-set testfile "ns-stale-regcache"
-set srcfile "$testfile.c"
-set binfile "$objdir/$subdir/mi-$testfile"
+standard_testfile ns-stale-regcache.c
 
-set options [list debug incdir=$objdir]
+set options [list debug]
 if {[gdb_compile "$srcdir/$subdir/$srcfile" \
         $binfile executable $options] != "" } {
     return -1
@@ -50,23 +52,11 @@ if {[gdb_compile "$srcdir/$subdir/$srcfile" \
 mi_gdb_reinitialize_dir $srcdir/$subdir
 mi_gdb_load $binfile
 
-set supported 0
-gdb_test_multiple "-gdb-show non-stop" "" {
-    -re ".*\\^done,value=\"off\",supported=\"(\[^\"\]+)\"\r\n$mi_gdb_prompt$" {
-       if { $expect_out(1,string) == "1" } {
-           set supported 1
-       }
-    }
-    -re ".*$mi_gdb_prompt$" {
-    }
-}
-
 mi_gdb_test "-gdb-set non-stop 1" ".*"
-mi_gdb_test "-gdb-set target-async 1" ".*"
-detect_async
+mi_gdb_test "-gdb-set mi-async 1" ".*"
+mi_detect_async
 
 if { [mi_run_to_main] < 0 } {
-    perror "mi-ns-stale-regcache.exp tests suppressed"
     continue
 }
 
This page took 0.026408 seconds and 4 git commands to generate.