[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.
This commit is contained in:
Tom de Vries 2021-10-13 11:06:36 +02:00
parent 36170420e3
commit 2786ef85fa
6 changed files with 34 additions and 16 deletions

View file

@ -25,6 +25,9 @@
# Because of (1), the test has to be written in assembly with explicit CFI # Because of (1), the test has to be written in assembly with explicit CFI
# directives. # directives.
# Check if starti command is supported.
require use_gdb_stub 0
load_lib dwarf.exp load_lib dwarf.exp
if {![dwarf2_support]} { if {![dwarf2_support]} {

View file

@ -25,6 +25,9 @@ if { !([isnative] && [istarget *-linux*]) } then {
return 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. # The plan is for async mode to become the default but toggle for now.
set saved_gdbflags $GDBFLAGS set saved_gdbflags $GDBFLAGS
set GDBFLAGS [concat $GDBFLAGS " -ex \"set mi-async on\""] set GDBFLAGS [concat $GDBFLAGS " -ex \"set mi-async on\""]

View file

@ -539,6 +539,8 @@ gdb_test "print \$cvar3" "= void" \
# "show commands". # "show commands".
gdb_test "python gdb.execute(\"show commands\")" "$decimal print \\\$cvar3.*" gdb_test "python gdb.execute(\"show commands\")" "$decimal print \\\$cvar3.*"
# Check if starti command is supported.
if { [use_gdb_stub] == 0 } {
# Test that the from_tty argument to gdb.execute is effective. If # Test that the from_tty argument to gdb.execute is effective. If
# False, the user is not prompted for decisions such as restarting the # False, the user is not prompted for decisions such as restarting the
# program, and "yes" is assumed. If True, the user is prompted. # program, and "yes" is assumed. If True, the user is prompted.
@ -558,3 +560,4 @@ gdb_test_multiple "python gdb.execute('starti', from_tty=True)" $test {
gdb_test "y" "Starting program:.*" $gdb_test_name gdb_test "y" "Starting program:.*" $gdb_test_name
} }
} }
}

View file

@ -17,6 +17,9 @@ if ![supports_reverse] {
return return
} }
# Check if start command is supported.
require use_gdb_stub 0
standard_testfile standard_testfile
if {[prepare_for_testing "failed to prepare" $testfile $srcfile \ if {[prepare_for_testing "failed to prepare" $testfile $srcfile \

View file

@ -25,6 +25,9 @@
# layout must show the contents of f2.c. # layout must show the contents of f2.c.
# 7. Going back to main() shall result in no contents again. # 7. Going back to main() shall result in no contents again.
# Check if start command is supported.
require use_gdb_stub 0
tuiterm_env tuiterm_env
standard_testfile standard_testfile

View file

@ -8251,6 +8251,9 @@ proc require { fn arg1 {arg2 ""} } {
"ensure_gdb_index $binfile -dwarf-5 != -1" { "ensure_gdb_index $binfile -dwarf-5 != -1" {
set msg "Couldn't ensure index in binfile" set msg "Couldn't ensure index in binfile"
} }
"use_gdb_stub == 0" {
set msg "Remote stub used"
}
default { set msg "$fn != $val" } default { set msg "$fn != $val" }
} }