From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 45557 invoked by alias); 12 Jan 2016 19:24:49 -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 45539 invoked by uid 89); 12 Jan 2016 19:24:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=singlethreaded X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 12 Jan 2016 19:24:48 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 0AB2F8E75B; Tue, 12 Jan 2016 19:24:46 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u0CJOj4X023144; Tue, 12 Jan 2016 14:24:45 -0500 Message-ID: <569552FD.6080304@redhat.com> Date: Tue, 12 Jan 2016 19:24:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Paul_Koning@Dell.com, jhb@freebsd.org CC: gdb-patches@sourceware.org, binutils@sourceware.org Subject: Re: [PATCH 0/6] Support kernel-backed user threads on FreeBSD References: <10958096.fTGshuKdL7@ralph.baldwin.cx> <5157941.xsGge3HdBb@ralph.baldwin.cx> <8465FE3C-92E3-4B33-820E-311526677F37@dell.com> In-Reply-To: <8465FE3C-92E3-4B33-820E-311526677F37@dell.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-01/txt/msg00237.txt.bz2 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. Thanks, Pedro Alves