[PATCH 35/46] gdb, ze: on a whole process stop, mark all threads as not_resumed

Tankut Baris Aktemur tankut.baris.aktemur@intel.com
Tue Jul 2 11:43:06 GMT 2024


From: Klaus Gerlicher <klaus.gerlicher@intel.com>

In non-stop mode, when gdbserver sends a unavailable notification via a
library load stop-reply, set all non-exited threads to non_resumed
state in case it's a whole process stop-reply.
---
 gdb/remote.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/gdb/remote.c b/gdb/remote.c
index 0864eeb3295..ce048c40a57 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -8630,11 +8630,18 @@ remote_target::process_stop_reply (stop_reply_up stop_reply,
 	    }
 	}
 
-      if (!target_is_non_stop_p ())
+      if (!target_is_non_stop_p () || ptid.is_pid ())
 	{
 	  /* If the target works in all-stop mode, a stop-reply indicates that
-	     all the target's threads stopped.  */
-	  for (thread_info *tp : all_non_exited_threads (this))
+	     all the target's threads stopped.
+
+	     In non-stop mode, a process-wide stop-reply indicates that
+	     all the threads of that process stopped.  */
+	  ptid_t filter_ptid = (!target_is_non_stop_p ()
+				? minus_one_ptid
+				: ptid);
+
+	  for (thread_info *tp : all_non_exited_threads (this, filter_ptid))
 	    get_remote_thread_info (tp)->set_not_resumed ();
 	}
     }
-- 
2.34.1

Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Sean Fennelly, Jeffrey Schneiderman, Tiffany Doon Silva
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928



More information about the Gdb-patches mailing list