aboutsummaryrefslogtreecommitdiff
path: root/gdb/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/thread.c')
-rw-r--r--gdb/thread.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/gdb/thread.c b/gdb/thread.c
index fdc13bc..f14b41f 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -51,6 +51,8 @@ static void prune_threads PARAMS ((void));
static void thread_switch PARAMS ((int pid));
+static struct thread_info * find_thread_id PARAMS ((int num));
+
void
init_thread_list ()
{
@@ -97,6 +99,32 @@ find_thread_id (num)
}
int
+valid_thread_id (num)
+ int num;
+{
+ struct thread_info *tp;
+
+ for (tp = thread_list; tp; tp = tp->next)
+ if (tp->num == num)
+ return 1;
+
+ return 0;
+}
+
+int
+pid_to_thread_id (pid)
+ int pid;
+{
+ struct thread_info *tp;
+
+ for (tp = thread_list; tp; tp = tp->next)
+ if (tp->pid == pid)
+ return tp->num;
+
+ return 0;
+}
+
+int
in_thread_list (pid)
int pid;
{