This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 0/6] Support kernel-backed user threads on FreeBSD
- From: John Baldwin <jhb at freebsd dot org>
- To: gdb-patches at sourceware dot org
- Cc: Pedro Alves <palves at redhat dot com>, Paul_Koning at dell dot com, binutils at sourceware dot org
- Date: Tue, 12 Jan 2016 13:08:42 -0800
- Subject: Re: [PATCH 0/6] Support kernel-backed user threads on FreeBSD
- Authentication-results: sourceware.org; auth=none
- References: <10958096 dot fTGshuKdL7 at ralph dot baldwin dot cx> <8465FE3C-92E3-4B33-820E-311526677F37 at dell dot com> <569552FD dot 6080304 at redhat dot com>
On Tuesday, January 12, 2016 07:24:45 PM Pedro Alves wrote:
> On 01/12/2016 07:06 PM, Paul_Koning@Dell.com wrote:
> >
> >> On Jan 12, 2016, at 1:55 PM, John Baldwin <jhb@freebsd.org> wrote:
> >>
> >> On Monday, January 11, 2016 10:53:50 AM John Baldwin wrote:
>
> >> One other note I forgot to mention is that currently I leave the ptid for
> >> single-threaded processes as (pid, 0, 0) (i.e. I only use LWPs in PTIDs
> >> when there is more than one thread). What is the best practice? Should
> >> I always use LWPs in ptids instead?
> >
> > I would say always use the LWP.
> >
> > For one thing, the process might start out single-threaded, then at some point midway through the debug session start more threads. If you always use the LWP, the main thread doesn't change identity. But if you fake the PTID to (pid,0,0) then that ID no longer applies once the new thread starts. You'd end up with the confusion of apparently seeing a thread disappear and a new one appear in its place, when in reality that's just the main thread continuing in existence.
>
> We have thread_change_ptid to handle that scenario, but it's indeed best
> to avoid it if possible.
Yes, I use that now. However, I will update it to switch to LWPs always
and re-post (with --threaded this time).
--
John Baldwin