diff options
Diffstat (limited to 'gdb/bsd-uthread.c')
-rw-r--r-- | gdb/bsd-uthread.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gdb/bsd-uthread.c b/gdb/bsd-uthread.c index b6a18f0..93198d3 100644 --- a/gdb/bsd-uthread.c +++ b/gdb/bsd-uthread.c @@ -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); |