2008-08-11 Pedro Alves * bsd-uthread.c (bsd_uthread_find_new_threads): Claim a main thread. --- gdb/bsd-uthread.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) Index: src/gdb/bsd-uthread.c =================================================================== --- src.orig/gdb/bsd-uthread.c 2008-08-11 13:23:53.000000000 +0100 +++ src/gdb/bsd-uthread.c 2008-08-11 13:25:14.000000000 +0100 @@ -422,7 +422,15 @@ bsd_uthread_find_new_threads (void) ptid_t ptid = ptid_build (pid, 0, addr); if (!in_thread_list (ptid) || is_exited (ptid)) - add_thread (ptid); + { + /* If INFERIOR_PTID doesn't have a tid member yet, then ptid + is still the initial thread of the process. Notify GDB + core about it. */ + if (ptid_get_tid (inferior_ptid) == 0) + thread_change_ptid (inferior_ptid, ptid); + else + add_thread (ptid); + } addr = read_memory_typed_address (addr + offset, builtin_type_void_data_ptr);