diff options
Diffstat (limited to 'gdb/testsuite/gdb.server/stop-reply-no-thread.exp')
-rw-r--r-- | gdb/testsuite/gdb.server/stop-reply-no-thread.exp | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/gdb/testsuite/gdb.server/stop-reply-no-thread.exp b/gdb/testsuite/gdb.server/stop-reply-no-thread.exp index ffc1c27..7d99b09 100644 --- a/gdb/testsuite/gdb.server/stop-reply-no-thread.exp +++ b/gdb/testsuite/gdb.server/stop-reply-no-thread.exp @@ -33,7 +33,7 @@ if [prepare_for_testing "failed to prepare" $testfile $srcfile] { } # Run the tests with different features of GDBserver disabled. -proc run_test { disable_feature } { +proc run_test { disable_feature target_nonstop } { global binfile gdb_prompt decimal clean_restart ${binfile} @@ -42,7 +42,11 @@ proc run_test { disable_feature } { # extended-remote board, therefore already connected. gdb_test "disconnect" ".*" - set res [gdbserver_start "--disable-packet=${disable_feature}" $binfile] + set packet_arg "" + if { $disable_feature != "" } { + set packet_arg "--disable-packet=${disable_feature}" + } + set res [gdbserver_start $packet_arg $binfile] set gdbserver_protocol [lindex $res 0] set gdbserver_gdbport [lindex $res 1] @@ -50,6 +54,9 @@ proc run_test { disable_feature } { gdb_test_no_output "set remote threads-packet off" gdb_test_no_output "set remote multiprocess-feature-packet off" + # Set target-nonstop mode. + gdb_test_no_output "maint set target-non-stop ${target_nonstop}" + set res [gdb_target_cmd $gdbserver_protocol $gdbserver_gdbport] if ![gdb_assert {$res == 0} "connect"] { return @@ -76,6 +83,13 @@ proc run_test { disable_feature } { # Cannot execute this command without a live selected thread. # (gdb) gdb_test "c" "Breakpoint $decimal, main.*" "continue to main" + + # Continue until exit. The server sends a 'W' with no PID. + # Bad GDB gave an error like below when target is nonstop: + # (gdb) c + # Continuing. + # No process or thread specified in stop reply: W00 + gdb_continue_to_end "" continue 1 } # Disable different features within gdbserver: @@ -85,6 +99,8 @@ proc run_test { disable_feature } { # # T: Start GDBserver with the entire 'T' stop reply packet disabled, # GDBserver will instead send the 'S' stop reply. -foreach_with_prefix to_disable { Tthread T } { - run_test $to_disable +foreach_with_prefix to_disable { "" Tthread T } { + foreach_with_prefix t_nonstop { off on } { + run_test $to_disable $t_nonstop + } } |