[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

@ -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"
# 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
# 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
}
}
}