aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2008-09-08 21:37:01 +0000
committerPedro Alves <palves@redhat.com>2008-09-08 21:37:01 +0000
commit757f359dd1a926e78902b65e2b19e4c9bb96844a (patch)
treeb71b52e13a04161bc88c3c421b47fc422117cfaf
parent0de3b513a4e23127727d27eb0a1d8804ac9f3c3e (diff)
downloadgdb-757f359dd1a926e78902b65e2b19e4c9bb96844a.zip
gdb-757f359dd1a926e78902b65e2b19e4c9bb96844a.tar.gz
gdb-757f359dd1a926e78902b65e2b19e4c9bb96844a.tar.bz2
* bsd-uthread.c (bsd_uthread_find_new_threads): Claim the main
thread.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/bsd-uthread.c10
2 files changed, 14 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 4001707..ce292c8 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2008-09-08 Pedro Alves <pedro@codesourcery.com>
+ * bsd-uthread.c (bsd_uthread_find_new_threads): Claim the main
+ thread.
+
+2008-09-08 Pedro Alves <pedro@codesourcery.com>
+
* corelow.c (add_to_thread_list): If this is the first time we
hear about thread info, update inferior_ptid.
(core_open): Clear the thread list and set inferior_ptid before
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);