summaryrefslogtreecommitdiff
path: root/gdb/gdbserver/gdbthread.h
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/gdbserver/gdbthread.h')
-rw-r--r--gdb/gdbserver/gdbthread.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/gdb/gdbserver/gdbthread.h b/gdb/gdbserver/gdbthread.h
index a864f958848..93688a36e4f 100644
--- a/gdb/gdbserver/gdbthread.h
+++ b/gdb/gdbserver/gdbthread.h
@@ -88,6 +88,30 @@ struct thread_info *find_any_thread_of_pid (int pid);
/* Get current thread ID (Linux task ID). */
#define current_ptid (current_thread->entry.id)
+/* Get the ptid of THREAD. */
+
+static inline ptid_t
+ptid_of (const thread_info *thread)
+{
+ return thread->entry.id;
+}
+
+/* Get the pid of THREAD. */
+
+static inline int
+pid_of (const thread_info *thread)
+{
+ return thread->entry.id.pid ();
+}
+
+/* Get the lwp of THREAD. */
+
+static inline long
+lwpid_of (const thread_info *thread)
+{
+ return thread->entry.id.lwp ();
+}
+
/* Create a cleanup to restore current_thread. */
struct cleanup *make_cleanup_restore_current_thread (void);