From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 48177 invoked by alias); 12 Jan 2016 21:08:57 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 48157 invoked by uid 89); 12 Jan 2016 21:08:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.0 required=5.0 tests=AWL,BAYES_05,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=no version=3.3.2 spammy=HX-Greylist:succeeded, HX-Greylist:SMTP, HX-Greylist:AUTH, HX-Greylist:Tue X-Spam-User: qpsmtpd, 2 recipients X-HELO: bigwig.baldwin.cx Received: from bigwig.baldwin.cx (HELO bigwig.baldwin.cx) (96.47.65.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Tue, 12 Jan 2016 21:08:55 +0000 Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id F214CB946; Tue, 12 Jan 2016 16:08:52 -0500 (EST) From: John Baldwin To: gdb-patches@sourceware.org Cc: Pedro Alves , Paul_Koning@dell.com, binutils@sourceware.org Subject: Re: [PATCH 0/6] Support kernel-backed user threads on FreeBSD Date: Tue, 12 Jan 2016 21:08:00 -0000 Message-ID: <2188756.HMZ3O5MULv@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <569552FD.6080304@redhat.com> References: <10958096.fTGshuKdL7@ralph.baldwin.cx> <8465FE3C-92E3-4B33-820E-311526677F37@dell.com> <569552FD.6080304@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-IsSubscribed: yes X-SW-Source: 2016-01/txt/msg00240.txt.bz2 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 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