aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2021-10-13 11:06:36 +0200
committerTom de Vries <tdevries@suse.de>2021-10-13 11:06:36 +0200
commit2786ef85faf16c13029548832c4e4b025bf2624c (patch)
treec766139ff53864e476a7d65b537e1339ee3cec63 /gdb
parent36170420e329a8d6229eb89b38d8680cf39f1d53 (diff)
downloadgdb-2786ef85faf16c13029548832c4e4b025bf2624c.zip
gdb-2786ef85faf16c13029548832c4e4b025bf2624c.tar.gz
gdb-2786ef85faf16c13029548832c4e4b025bf2624c.tar.bz2
[gdb/testsuite] Require use_gdb_stub == 0 where appropriate
When running with target board native-gdbserver, we run into a number of FAILs due to use of the start command (and similar), which is not supported when use_gdb_stub == 1. Fix this by: - requiring use_gdb_stub == 0 for the entire test-case, or - guarding some tests in the test-case with use_gdb_stub == 0. Tested on x86_64-linux.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.exp3
-rw-r--r--gdb/testsuite/gdb.mi/mi-async.exp3
-rw-r--r--gdb/testsuite/gdb.python/python.exp37
-rw-r--r--gdb/testsuite/gdb.reverse/insn-reverse.exp3
-rw-r--r--gdb/testsuite/gdb.tui/tui-missing-src.exp3
-rw-r--r--gdb/testsuite/lib/gdb.exp3
6 files changed, 35 insertions, 17 deletions
diff --git a/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.exp b/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.exp
index f95558d..e19c474 100644
--- a/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.exp
+++ b/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.exp
@@ -25,6 +25,9 @@
# Because of (1), the test has to be written in assembly with explicit CFI
# directives.
+# Check if starti command is supported.
+require use_gdb_stub 0
+
load_lib dwarf.exp
if {![dwarf2_support]} {
diff --git a/gdb/testsuite/gdb.mi/mi-async.exp b/gdb/testsuite/gdb.mi/mi-async.exp
index d2fec08..1272c68 100644
--- a/gdb/testsuite/gdb.mi/mi-async.exp
+++ b/gdb/testsuite/gdb.mi/mi-async.exp
@@ -25,6 +25,9 @@ if { !([isnative] && [istarget *-linux*]) } then {
return
}
+# Check if start command is supported.
+require use_gdb_stub 0
+
# The plan is for async mode to become the default but toggle for now.
set saved_gdbflags $GDBFLAGS
set GDBFLAGS [concat $GDBFLAGS " -ex \"set mi-async on\""]
diff --git a/gdb/testsuite/gdb.python/python.exp b/gdb/testsuite/gdb.python/python.exp
index 7f9c2b4..c36699d 100644
--- a/gdb/testsuite/gdb.python/python.exp
+++ b/gdb/testsuite/gdb.python/python.exp
@@ -539,22 +539,25 @@ gdb_test "print \$cvar3" "= void" \
# "show commands".
gdb_test "python gdb.execute(\"show commands\")" "$decimal print \\\$cvar3.*"
-# Test that the from_tty argument to gdb.execute is effective. If
-# False, the user is not prompted for decisions such as restarting the
-# program, and "yes" is assumed. If True, the user is prompted.
-# Case 1, from_tty=False.
-gdb_test "python gdb.execute('starti', from_tty=False)" \
- "Program stopped.*" \
- "starti via gdb.execute, not from tty"
-
-# Case 2, from_tty=True.
-set test "starti via gdb.execute, from tty"
-set question \
- [multi_line \
- {The program being debugged has been started already\.} \
- {Start it from the beginning\? \(y or n\) $}]
-gdb_test_multiple "python gdb.execute('starti', from_tty=True)" $test {
- -re $question {
- gdb_test "y" "Starting program:.*" $gdb_test_name
+# Check if starti command is supported.
+if { [use_gdb_stub] == 0 } {
+ # Test that the from_tty argument to gdb.execute is effective. If
+ # False, the user is not prompted for decisions such as restarting the
+ # program, and "yes" is assumed. If True, the user is prompted.
+ # Case 1, from_tty=False.
+ gdb_test "python gdb.execute('starti', from_tty=False)" \
+ "Program stopped.*" \
+ "starti via gdb.execute, not from tty"
+
+ # Case 2, from_tty=True.
+ set test "starti via gdb.execute, from tty"
+ set question \
+ [multi_line \
+ {The program being debugged has been started already\.} \
+ {Start it from the beginning\? \(y or n\) $}]
+ gdb_test_multiple "python gdb.execute('starti', from_tty=True)" $test {
+ -re $question {
+ gdb_test "y" "Starting program:.*" $gdb_test_name
+ }
}
}
diff --git a/gdb/testsuite/gdb.reverse/insn-reverse.exp b/gdb/testsuite/gdb.reverse/insn-reverse.exp
index 47f0166..50b8e9c 100644
--- a/gdb/testsuite/gdb.reverse/insn-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/insn-reverse.exp
@@ -17,6 +17,9 @@ if ![supports_reverse] {
return
}
+# Check if start command is supported.
+require use_gdb_stub 0
+
standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile \
diff --git a/gdb/testsuite/gdb.tui/tui-missing-src.exp b/gdb/testsuite/gdb.tui/tui-missing-src.exp
index 3116864..c108cce 100644
--- a/gdb/testsuite/gdb.tui/tui-missing-src.exp
+++ b/gdb/testsuite/gdb.tui/tui-missing-src.exp
@@ -25,6 +25,9 @@
# layout must show the contents of f2.c.
# 7. Going back to main() shall result in no contents again.
+# Check if start command is supported.
+require use_gdb_stub 0
+
tuiterm_env
standard_testfile
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 90131fe..7f02504 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -8251,6 +8251,9 @@ proc require { fn arg1 {arg2 ""} } {
"ensure_gdb_index $binfile -dwarf-5 != -1" {
set msg "Couldn't ensure index in binfile"
}
+ "use_gdb_stub == 0" {
+ set msg "Remote stub used"
+ }
default { set msg "$fn != $val" }
}