From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23668 invoked by alias); 12 Jan 2016 19:07:09 -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 23650 invoked by uid 89); 12 Jan 2016 19:07:09 -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_PASS autolearn=ham version=3.3.2 spammy=PTID, Hx-languages-length:1687, gcore, singlethreaded X-Spam-User: qpsmtpd, 2 recipients X-HELO: ausc60pc101.us.dell.com Received: from ausc60pc101.us.dell.com (HELO ausc60pc101.us.dell.com) (143.166.85.206) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Tue, 12 Jan 2016 19:07:08 +0000 X-LoopCount0: from 10.170.28.39 From: To: CC: , Subject: Re: [PATCH 0/6] Support kernel-backed user threads on FreeBSD Date: Tue, 12 Jan 2016 19:07:00 -0000 Message-ID: <8465FE3C-92E3-4B33-820E-311526677F37@dell.com> References: <10958096.fTGshuKdL7@ralph.baldwin.cx> <5157941.xsGge3HdBb@ralph.baldwin.cx> In-Reply-To: <5157941.xsGge3HdBb@ralph.baldwin.cx> Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-IsSubscribed: yes X-SW-Source: 2016-01/txt/msg00233.txt.bz2 > On Jan 12, 2016, at 1:55 PM, John Baldwin wrote: >=20 > On Monday, January 11, 2016 10:53:50 AM John Baldwin wrote: >> This set of patches adds support for examining kernel-backed user thread= s on >> FreeBSD. There is more history in a comment in fbsd-nat.c, but this tar= get >> uses ptrace directly (instead of libthread_db) to support the current >> threading library (libthr) on FreeBSD which uses a kernel thread for each >> user thread. Support for thread names in both core dumps (via FreeBSD's >> OS-specific NT_THRMISC core note) and live is supported as is scheduler >> locking. gcore generates register notes for each thread as well. >>=20 >> The first two patches are to binutils to support FreeBSD-specific core >> notes. The last four are to GDB. >=20 > (Apologies for fubar'ing the threading on the patches in this series.) >=20 > 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 po= int 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 PTI= D 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. paul