diff mbox

[12/14] gdb/testsuite: Skip on of the interp.exp test for remote targets

Message ID 20200207150003.8383-13-shahab.vahedi@gmail.com
State New
Headers show

Commit Message

Shahab Vahedi Feb. 7, 2020, 3 p.m. UTC
From: Anton Kolesov <Anton.Kolesov@synopsys.com>

One of the tests in interp.exp invokes `-stack-info-frame` through MI and
expects that it will return "no registers", because application is not being
run. However, if this is done with gdbserver, then GDB is already connected to
the server, therefore registers actually exist and the test fails.

gdb/testsuite/ChangeLog:
2016-08-19  Anton Kolesov <Anton.Kolesov@synopsys.com>

	* gdb.base/interp.exp: Skip "stack-info-frame" test
	if gdbserver was used.

Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
---
 gdb/testsuite/gdb.base/interp.exp | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)
diff mbox

Patch

diff --git a/gdb/testsuite/gdb.base/interp.exp b/gdb/testsuite/gdb.base/interp.exp
index d2a6d42732e8..2e1e9901e952 100644
--- a/gdb/testsuite/gdb.base/interp.exp
+++ b/gdb/testsuite/gdb.base/interp.exp
@@ -44,14 +44,18 @@  gdb_test_multiple "interpreter-exec mi \"-break-insert --thread a\"" \
 	}
     }
 
-set cmd "interpreter-exec mi \"-stack-info-frame\""
-gdb_test_multiple $cmd $cmd {
-    -re ".error,msg=.No registers\..\r\n$gdb_prompt " {
-	pass "$cmd"
-	gdb_expect 1 {
-	    -re "\r\n$gdb_prompt $" { }
-	}
-    }
+# If this is a remote target, then GDB already connected to the server, so
+# registers do exist and this test doesn't make sense.
+if !$use_gdb_stub {
+  set cmd "interpreter-exec mi \"-stack-info-frame\""
+  gdb_test_multiple $cmd $cmd {
+      -re ".error,msg=.No registers\..\r\n$gdb_prompt " {
+	  pass "$cmd"
+	  gdb_expect 1 {
+	      -re "\r\n$gdb_prompt $" { }
+	  }
+      }
+  }
 }
 
 set cmd "interpreter-exec mi1 \"-break-insert main\""