Message ID | 20150826190157.EE3D939FA@oc7340732750.ibm.com |
---|---|
State | New |
Headers | show |
On 08/26/2015 08:01 PM, Ulrich Weigand wrote: > Pedro Alves wrote: >> (Sounds like the testsuite could be improved to better detect this.) > > Yes, I think I'll at least set the test case to UNRESOLVED if > something unexpected happens while attempting to detect whether > we have Cell/B.E. hardware. Sounds good to me. > This is where it triggers for me: > Thanks, I see. >> find_one_thread makes use of td_ta_map_lwp2thr for the >> mapping we're after. >> On the GDB side, the equivalent is linux-thread-db.c:thread_from_lwp. > > Ah, indeed that works for me. The attached patch also fixes the > problem for me. > LGTM. Thanks, Pedro Alves
Index: binutils-gdb/gdb/linux-thread-db.c =================================================================== --- binutils-gdb.orig/gdb/linux-thread-db.c +++ binutils-gdb/gdb/linux-thread-db.c @@ -1851,13 +1851,16 @@ thread_db_get_thread_local_address (stru struct thread_info *thread_info; struct target_ops *beneath; - /* If we have not discovered any threads yet, check now. */ - if (!have_threads (ptid)) - thread_db_find_new_threads_1 (ptid); - /* Find the matching thread. */ thread_info = find_thread_ptid (ptid); + /* We may not have discovered the thread yet. */ + if (thread_info != NULL && thread_info->priv == NULL) + { + thread_from_lwp (ptid); + thread_info = find_thread_ptid (ptid); + } + if (thread_info != NULL && thread_info->priv != NULL) { td_err_e err;