[PowerPC] Consolidate linux vector regset sizes
[deliverable/binutils-gdb.git] / gdb / gdbserver / gdbthread.h
index 8ace051036d4b1e3a3502e110090757bc95fb25d..0edf870c56f4c9acc12cbe8fbe6b185a396830d4 100644 (file)
@@ -1,5 +1,5 @@
 /* Multi-thread control defs for remote server for GDB.
-   Copyright (C) 1993-2017 Free Software Foundation, Inc.
+   Copyright (C) 1993-2018 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -111,6 +111,30 @@ find_thread (Func func)
   return NULL;
 }
 
+/* Like the above, but only consider threads with pid PID.  */
+
+template <typename Func>
+static thread_info *
+find_thread (int pid, Func func)
+{
+  return find_thread ([&] (thread_info *thread)
+    {
+      return thread->id.pid () == pid && func (thread);
+    });
+}
+
+/* Find the first thread that matches FILTER for which FUNC returns true.
+   Return NULL if no thread satisfying these conditions is found.  */
+
+template <typename Func>
+static thread_info *
+find_thread (ptid_t filter, Func func)
+{
+  return find_thread ([&] (thread_info *thread) {
+    return thread->id.matches (filter) && func (thread);
+  });
+}
+
 /* Invoke FUNC for each thread.  */
 
 template <typename Func>
@@ -128,6 +152,19 @@ for_each_thread (Func func)
     }
 }
 
+/* Like the above, but only consider threads with pid PID.  */
+
+template <typename Func>
+static void
+for_each_thread (int pid, Func func)
+{
+  for_each_thread ([&] (thread_info *thread)
+    {
+      if (pid == thread->id.pid ())
+       func (thread);
+    });
+}
+
 /* Find the a random thread for which FUNC (THREAD) returns true.  If
    no entry is found then return NULL.  */
 
@@ -187,7 +224,4 @@ lwpid_of (const thread_info *thread)
   return thread->id.lwp ();
 }
 
-/* Create a cleanup to restore current_thread.  */
-struct cleanup *make_cleanup_restore_current_thread (void);
-
 #endif /* GDB_THREAD_H */
This page took 0.024976 seconds and 4 git commands to generate.