From owner-p4-projects@FreeBSD.ORG Mon Jun 28 05:49:33 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A692616A4D0; Mon, 28 Jun 2004 05:49:32 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 83C4716A4CE for ; Mon, 28 Jun 2004 05:49:32 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7CE6443D2F for ; Mon, 28 Jun 2004 05:49:32 +0000 (GMT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i5S5nWWu036474 for ; Mon, 28 Jun 2004 05:49:32 GMT (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i5S5nWMI036471 for perforce@freebsd.org; Mon, 28 Jun 2004 05:49:32 GMT (envelope-from marcel@freebsd.org) Date: Mon, 28 Jun 2004 05:49:32 GMT Message-Id: <200406280549.i5S5nWMI036471@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 55982 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jun 2004 05:49:33 -0000 http://perforce.freebsd.org/chv.cgi?CH=55982 Change 55982 by marcel@marcel_nfs on 2004/06/28 05:48:53 Give the initial thread uniqueid 1 and save the lwpid of the process for consumption by thread_db.so. Note that we probably want to support RELENG_4 when we're ready with all this and have support contributed back to GDB. For this we cannot change libc_r, so we need to find a way (eventually) to make this work on 4.x. I'm not going to worry about this now. Affected files ... .. //depot/projects/gdb/lib/libc_r/uthread/pthread_private.h#4 edit .. //depot/projects/gdb/lib/libc_r/uthread/uthread_init.c#2 edit Differences ... ==== //depot/projects/gdb/lib/libc_r/uthread/pthread_private.h#4 (text+ko) ==== @@ -1189,6 +1189,12 @@ #endif ; +SCLASS int _libc_r_lwpid +#ifdef GLOBAL_PTHREAD_PRIVATE += 0 +#endif +; + /* Undefine the storage class specifier: */ #undef SCLASS ==== //depot/projects/gdb/lib/libc_r/uthread/uthread_init.c#2 (text+ko) ==== @@ -337,6 +337,7 @@ memset(&_thread_kern_thread, 0, sizeof(struct pthread)); _thread_kern_thread.flags = PTHREAD_FLAGS_PRIVATE; memset(_thread_initial, 0, sizeof(struct pthread)); + _thread_initial->uniqueid = 1; /* Initialize the waiting and work queues: */ TAILQ_INIT(&_waitingq); @@ -345,6 +346,9 @@ /* Initialize the scheduling switch hook routine: */ _sched_switch_hook = NULL; + /* Save the lwpid of the one LWP this process has. */ + _libc_r_lwpid = getlwpid(); + /* Give this thread default attributes: */ memcpy((void *) &_thread_initial->attr, &_pthread_attr_default, sizeof(struct pthread_attr));