/* Multi-thread control defs for remote server for GDB.
- Copyright (C) 1993-2014 Free Software Foundation, Inc.
+ Copyright (C) 1993-2015 Free Software Foundation, Inc.
This file is part of GDB.
#ifndef GDB_THREAD_H
#define GDB_THREAD_H
-#include "server.h"
#include "inferiors.h"
struct btrace_target_info;
+struct regcache;
struct thread_info
{
+ /* This must appear first. See inferiors.h.
+ The list iterator functions assume it. */
struct inferior_list_entry entry;
+
void *target_data;
- void *regcache_data;
+ struct regcache *regcache_data;
/* The last resume GDB requested on this thread. */
enum resume_kind last_resume_kind;
extern struct inferior_list all_threads;
void remove_thread (struct thread_info *thread);
-void add_thread (ptid_t ptid, void *target_data);
+struct thread_info *add_thread (ptid_t ptid, void *target_data);
+
+struct thread_info *get_first_thread (void);
struct thread_info *find_thread_ptid (ptid_t ptid);
+/* Find any thread of the PID process. Returns NULL if none is
+ found. */
+struct thread_info *find_any_thread_of_pid (int pid);
+
/* Get current thread ID (Linux task ID). */
-#define current_ptid ((struct inferior_list_entry *) current_inferior)->id
+#define current_ptid (current_thread->entry.id)
#endif /* GDB_THREAD_H */