diff options
author | Joel Brobecker <brobecker@gnat.com> | 2009-05-20 18:21:20 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@gnat.com> | 2009-05-20 18:21:20 +0000 |
commit | 77f0be4ee17f3cf819634c70477e9f1db3f6dda9 (patch) | |
tree | 4eb8e22551d9845ad234a8a3fc5599fadce79cf8 /gdb | |
parent | 164e7efc2373ebd27d2f1be59b9a3aeb98f00335 (diff) | |
download | gdb-77f0be4ee17f3cf819634c70477e9f1db3f6dda9.zip gdb-77f0be4ee17f3cf819634c70477e9f1db3f6dda9.tar.gz gdb-77f0be4ee17f3cf819634c70477e9f1db3f6dda9.tar.bz2 |
* aix-thread.c (giter_count): Do not count the main thread.
(giter_accum): Do not include the main thread.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/aix-thread.c | 24 |
2 files changed, 24 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 3eb2ecd..beeb707 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2009-05-20 Joel Brobecker <brobecker@adacore.com> + + * aix-thread.c (giter_count): Do not count the main thread. + (giter_accum): Do not include the main thread. + 2009-05-19 Jan Kratochvil <jan.kratochvil@redhat.com> Remove the PROT parameter from openp. diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c index 1eeeadb..35103f5 100644 --- a/gdb/aix-thread.c +++ b/gdb/aix-thread.c @@ -570,22 +570,36 @@ pcmp (const void *p1v, const void *p2v) return p1->pthid < p2->pthid ? -1 : p1->pthid > p2->pthid; } -/* iterate_over_threads() callback for counting GDB threads. */ +/* iterate_over_threads() callback for counting GDB threads. + + Do not count the main thread (whose tid is zero). This matches + the list of threads provided by the pthreaddebug library, which + does not include that main thread either, and thus allows us + to compare the two lists. */ static int giter_count (struct thread_info *thread, void *countp) { - (*(int *) countp)++; + if (PD_TID (thread->ptid)) + (*(int *) countp)++; return 0; } -/* iterate_over_threads() callback for accumulating GDB thread pids. */ +/* iterate_over_threads() callback for accumulating GDB thread pids. + + Do not include the main thread (whose tid is zero). This matches + the list of threads provided by the pthreaddebug library, which + does not include that main thread either, and thus allows us + to compare the two lists. */ static int giter_accum (struct thread_info *thread, void *bufp) { - **(struct thread_info ***) bufp = thread; - (*(struct thread_info ***) bufp)++; + if (PD_TID (thread->ptid)) + { + **(struct thread_info ***) bufp = thread; + (*(struct thread_info ***) bufp)++; + } return 0; } |