From bad34192e56554fda247b1d0c72cfb18bc7f83bf Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Tue, 31 Mar 2009 15:23:57 +0000 Subject: * remote.c (remote_notice_new_inferior): Use ptid_is_pid. Check if the thread's ptid without a thread id field is in the list before calling thread_change_ptid. (extended_remote_attach_1): In non-stop mode, do not rely on querying the current thread, instead, query the thread list, and select the first thread of the process. * gdbthread.h (first_thread_of_process): Declare. * thread.c (first_thread_of_process): Define. --- gdb/gdbthread.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gdb/gdbthread.h') diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h index 5b4bce5..1833a9e 100644 --- a/gdb/gdbthread.h +++ b/gdb/gdbthread.h @@ -229,6 +229,10 @@ extern struct thread_info *find_thread_pid (ptid_t ptid); /* Find thread by GDB user-visible thread number. */ struct thread_info *find_thread_id (int num); +/* Finds the first thread of the inferior given by PID. If PID is -1, + returns the first thread in the list. */ +struct thread_info *first_thread_of_process (int pid); + /* Change the ptid of thread OLD_PTID to NEW_PTID. */ void thread_change_ptid (ptid_t old_ptid, ptid_t new_ptid); -- cgit v1.1