diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0de5a9d1597..5bceb92c379 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2021-03-25 Pedro Alves + + * remote.c + (remote_target::check_pending_events_prevent_wildcard_vcont): + Check whether the event's ptid is not null_ptid before looking up + the corresponding inferior. + 2021-03-24 Changbin Du * riscv-tdep.c (riscv_breakpoint_kind_from_pc): Remove call to diff --git a/gdb/remote.c b/gdb/remote.c index ff1366ebc40..188f507febd 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -7190,14 +7190,16 @@ remote_target::check_pending_events_prevent_wildcard_vcont || event->ws.kind == TARGET_WAITKIND_VFORKED) *may_global_wildcard = 0; - struct inferior *inf = find_inferior_ptid (this, event->ptid); - /* This may be the first time we heard about this process. Regardless, we must not do a global wildcard resume, otherwise we'd resume this process too. */ *may_global_wildcard = 0; - if (inf != NULL) - get_remote_inferior (inf)->may_wildcard_vcont = false; + if (event->ptid != null_ptid) + { + inferior *inf = find_inferior_ptid (this, event->ptid); + if (inf != NULL) + get_remote_inferior (inf)->may_wildcard_vcont = false; + } } } diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 1bcdaeb69d5..65c322562cd 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2021-03-25 Pedro Alves + + * gdb.server/stop-reply-no-thread-multi.exp (run_test): Add + "target_non_stop" parameter and use it. + (top level): Add "maint set target-non-stop on/off" testing axis. + 2021-03-25 Andrew Burgess * lib/ada.exp (gnat_runtime_has_debug_info): Use -wrap with diff --git a/gdb/testsuite/gdb.server/stop-reply-no-thread-multi.exp b/gdb/testsuite/gdb.server/stop-reply-no-thread-multi.exp index 6350f5771e3..50cf10fe313 100644 --- a/gdb/testsuite/gdb.server/stop-reply-no-thread-multi.exp +++ b/gdb/testsuite/gdb.server/stop-reply-no-thread-multi.exp @@ -41,10 +41,15 @@ if { [build_executable "failed to prepare" $testfile $srcfile {debug pthreads}] } # Run the tests with different features of GDBserver disabled. -proc run_test { disable_feature } { +# TARGET_NON_STOP is passed to "maint set target-non-stop". +proc run_test { target_non_stop disable_feature } { global binfile gdb_prompt decimal hex + global GDBFLAGS - clean_restart ${binfile} + save_vars { GDBFLAGS } { + append GDBFLAGS " -ex \"maint set target-non-stop $target_non_stop\"" + clean_restart ${binfile} + } # Make sure we're disconnected, in case we're testing with an # extended-remote board, therefore already connected. @@ -131,6 +136,11 @@ 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 +# +# Also test both all-stop and non-stop variants of the remote +# protocol. +foreach_with_prefix target-non-stop {"off" "on"} { + foreach_with_prefix to_disable { "" Tthread T } { + run_test ${target-non-stop} $to_disable + } }