[PATCH 05/14] gdb/testsuite: Skip a few gdb.base/skip.exp tests for remote targets

Shahab Vahedi shahab.vahedi@gmail.com
Fri Feb 7 15:01:00 GMT 2020


From: Anton Kolesov <Anton.Kolesov@synopsys.com>

Few initial tests in gdb.base/skip.exp expect GDB to be in the state where
there is no default file for "skip" command. This is true when debugging
native targets - there is no inferior until "run" command is executed and
thus there is no "default" skip file. However that is not true for remote
targets - after "prepare_for_testing" test procedure GDB is already
connected to the target and has an existing inferior, so "default" file is
set by that time.

gdb/testsuite/ChangeLog:
2016-07-13  Anton Kolesov <Anton.Kolesov@synopsys.com>

	* gdb.base/skip.exp: Skip a few tests if remotely connected.

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

diff --git a/gdb/testsuite/gdb.base/skip.exp b/gdb/testsuite/gdb.base/skip.exp
index 513c9fcc82ea..31a20c868a2a 100644
--- a/gdb/testsuite/gdb.base/skip.exp
+++ b/gdb/testsuite/gdb.base/skip.exp
@@ -30,10 +30,14 @@ set srcfile skip.c
 set srcfile1 skip1.c
 
 # Right after we start gdb, there's no default file or function to skip.
-
-gdb_test "skip file" "No default file now." "skip file (no default file)"
-gdb_test "skip function" "No default function now."
-gdb_test "skip" "No default function now." "skip (no default function)"
+# However that is not true for remote targets - after "prepare_for_testing" GDB
+# is already connected to the target and has a valid inferior, hence default
+# file.
+if ![use_gdb_stub] {
+    gdb_test "skip file" "No default file now." "skip file (no default file)"
+    gdb_test "skip function" "No default function now."
+    gdb_test "skip" "No default function now." "skip (no default function)"
+}
 
 # Test elided args.
 
-- 
2.25.0



More information about the Gdb-patches mailing list