diff options
author | Pedro Alves <pedro@codesourcery.com> | 2008-09-08 21:37:01 +0000 |
---|---|---|
committer | Pedro Alves <pedro@codesourcery.com> | 2008-09-08 21:37:01 +0000 |
commit | 409c3e592a4e1775bed9518f08217936ca2e07b1 (patch) | |
tree | 000a00470dcaf3c0f1a859f442a2778f4d09bf48 /gdb/bsd-uthread.c | |
parent | 85d1e5e3e7b30ec60024acf2976b22c2da5c4c43 (diff) | |
download | gdb-409c3e592a4e1775bed9518f08217936ca2e07b1.tar.gz |
* bsd-uthread.c (bsd_uthread_find_new_threads): Claim the main
thread.
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 b6a18f0144f..93198d3e224 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); |