aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog9
-rw-r--r--gdb/remote-notif.c2
-rw-r--r--gdb/remote.c11
-rw-r--r--gdb/remote.h1
4 files changed, 22 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 0992811..953fe19 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,12 @@
+2021-04-22 Simon Marchi <simon.marchi@polymtl.ca>
+ Tom de Vries <tdevries@suse.de>
+
+ PR remote/27710
+ * remote.c (remote_target_is_non_stop_p): New function.
+ * remote.h (remote_target_is_non_stop_p): Declare.
+ * remote-notif.c (remote_async_get_pending_events_handler): Fix assert
+ to check non-stopness using notif_state->remote rather current target.
+
2021-04-22 Tom Tromey <tom@tromey.com>
* rust-parse.c (rust_parser::parse_sizeof): Remove KW_MUT code.
diff --git a/gdb/remote-notif.c b/gdb/remote-notif.c
index 5a3e139..4245015 100644
--- a/gdb/remote-notif.c
+++ b/gdb/remote-notif.c
@@ -110,7 +110,7 @@ remote_async_get_pending_events_handler (gdb_client_data data)
{
remote_notif_state *notif_state = (remote_notif_state *) data;
clear_async_event_handler (notif_state->get_pending_events_token);
- gdb_assert (target_is_non_stop_p ());
+ gdb_assert (remote_target_is_non_stop_p (notif_state->remote));
remote_notif_process (notif_state, NULL);
}
diff --git a/gdb/remote.c b/gdb/remote.c
index 7429e1a..2e365df 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -14730,6 +14730,17 @@ remote_target::store_memtags (CORE_ADDR address, size_t len,
return packet_check_result (rs->buf.data ()) == PACKET_OK;
}
+/* Return true if remote target T is non-stop. */
+
+bool
+remote_target_is_non_stop_p (remote_target *t)
+{
+ scoped_restore_current_thread restore_thread;
+ switch_to_target_no_thread (t);
+
+ return target_is_non_stop_p ();
+}
+
#if GDB_SELF_TEST
namespace selftests {
diff --git a/gdb/remote.h b/gdb/remote.h
index 18352dd..46bfa01 100644
--- a/gdb/remote.h
+++ b/gdb/remote.h
@@ -77,4 +77,5 @@ extern int remote_register_number_and_offset (struct gdbarch *gdbarch,
extern void remote_notif_get_pending_events (remote_target *remote,
struct notif_client *np);
+extern bool remote_target_is_non_stop_p (remote_target *t);
#endif