This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 03/18] attach + target always in non-stop mode: stop all threads
- From: Pedro Alves <palves at redhat dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 23 Nov 2015 18:15:13 +0000
- Subject: Re: [PATCH 03/18] attach + target always in non-stop mode: stop all threads
- Authentication-results: sourceware.org; auth=none
- References: <1444836486-25679-1-git-send-email-palves at redhat dot com> <1444836486-25679-4-git-send-email-palves at redhat dot com> <86r3ki0vzy dot fsf at gmail dot com>
On 10/26/2015 10:22 AM, Yao Qi wrote:
> Pedro Alves <palves@redhat.com> writes:
>
>> In addition, it's not defined whith thread manages to report the
>
> s/whith/which
>
>> initial attach stop, so always pick the lowest one (otherwise
>> multi-attach.exp regresses).
>
> Shouldn't GDB pick the main thread rather than the lowest one?
It actually ends up being the same, and bit more generic to go with
lowest, because target_attach should always adds the main thread first.
Otherwise, there's no such concept of "main" thread in the common code.
"The thread with pid == lwpid" holds true for NTPL/Linux, but not everywhere,
and even then the leader thread may have exited already. I'll update
the comment.
Thanks,
Pedro Alves