summaryrefslogtreecommitdiff
path: root/gdb/linux-thread-db.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2011-04-17 19:11:06 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2011-04-17 19:11:06 +0000
commit77a09311dcf970abae1acbeb8f15649beec610d7 (patch)
treeadeb23c18fc513dd0aa34f906e1e7c4549cfd9e6 /gdb/linux-thread-db.c
parenta9423f26c7ee312d70f3f50a37ab40c0eccd6508 (diff)
downloadgdb-77a09311dcf970abae1acbeb8f15649beec610d7.tar.gz
gdb/
* linux-thread-db.c (find_new_threads_callback): Exit on zero TI_TID even if !TARGET_HAS_EXECUTION. gdb/testsuite/ * gdb.threads/gcore-thread.exp ($core0file): New variable. (clear __stack_user.next, clear stack_used.next) (save a zeroed-threads corefile): New test. Call core_load for $core0file. (zeroed-threads cannot be listed): New test.
Diffstat (limited to 'gdb/linux-thread-db.c')
-rw-r--r--gdb/linux-thread-db.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c
index 005a34a60b1..2700a65865e 100644
--- a/gdb/linux-thread-db.c
+++ b/gdb/linux-thread-db.c
@@ -1335,7 +1335,7 @@ find_new_threads_callback (const td_thrhandle_t *th_p, void *data)
if (ti.ti_state == TD_THR_UNKNOWN || ti.ti_state == TD_THR_ZOMBIE)
return 0; /* A zombie -- ignore. */
- if (ti.ti_tid == 0 && target_has_execution)
+ if (ti.ti_tid == 0)
{
/* A thread ID of zero means that this is the main thread, but
glibc has not yet initialized thread-local storage and the
@@ -1347,10 +1347,13 @@ find_new_threads_callback (const td_thrhandle_t *th_p, void *data)
need this glibc bug workaround. */
info->need_stale_parent_threads_check = 0;
- err = info->td_thr_event_enable_p (th_p, 1);
- if (err != TD_OK)
- error (_("Cannot enable thread event reporting for LWP %d: %s"),
- (int) ti.ti_lid, thread_db_err_str (err));
+ if (target_has_execution)
+ {
+ err = info->td_thr_event_enable_p (th_p, 1);
+ if (err != TD_OK)
+ error (_("Cannot enable thread event reporting for LWP %d: %s"),
+ (int) ti.ti_lid, thread_db_err_str (err));
+ }
return 0;
}