From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4932 invoked by alias); 23 Feb 2009 14:08:24 -0000 Received: (qmail 4921 invoked by uid 22791); 23 Feb 2009 14:08:23 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 23 Feb 2009 14:08:15 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 6CB79105BE; Mon, 23 Feb 2009 14:08:13 +0000 (GMT) Received: from caradoc.them.org (209.195.188.212.nauticom.net [209.195.188.212]) by nan.false.org (Postfix) with ESMTP id 358EC105B6; Mon, 23 Feb 2009 14:08:13 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1LbbTg-0003B1-44; Mon, 23 Feb 2009 09:08:12 -0500 Date: Mon, 23 Feb 2009 16:10:00 -0000 From: Daniel Jacobowitz To: Vinay Sridhar Cc: gdb-patches@sourceware.org, luisgpm@linux.vnet.ibm.com, Pedro Alves Subject: Re: [RFC][Patch] Fix gdb failure to access tls data for parent thread Message-ID: <20090223140812.GA10946@caradoc.them.org> Mail-Followup-To: Vinay Sridhar , gdb-patches@sourceware.org, luisgpm@linux.vnet.ibm.com, Pedro Alves References: <20090211155300.GA22689@caradoc.them.org> <1234417406.6489.3.camel@localhost.localdomain> <20090215182233.GA24660@caradoc.them.org> <1234779868.4861.7.camel@localhost.localdomain> <20090216150403.GA27072@caradoc.them.org> <1234849907.4215.7.camel@localhost.localdomain> <20090217132951.GA32041@caradoc.them.org> <1235102359.4719.3.camel@localhost.localdomain> <20090222194316.GA21483@caradoc.them.org> <1235379059.10038.12.camel@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1235379059.10038.12.camel@localhost.localdomain> User-Agent: Mutt/1.5.17 (2008-05-11) X-IsSubscribed: yes 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 X-SW-Source: 2009-02/txt/msg00441.txt.bz2 On Mon, Feb 23, 2009 at 02:20:59PM +0530, Vinay Sridhar wrote: > > If they are, and they do not have private info set, what added them to > > the thread list? I missed one function; maybe they were added by > > add_thread_silent? > > > > yes, add_thread_silent () is called on the threads. Its called for the > parent from fork_inferior () and for the child threads from > add_thread_with_info () Thanks, now we're making progress. Pedro, copying you because this is related to always-a-thread. What's happening here is that we go to look up a TLS variable. We have some threads in the thread list with thread->private set, but the main thread does not have it set - thread_db never added it, fork_inferior did. So we don't really know about it. Vinay, thread_db_find_new_threads should have been called when the program started up. Was find_new_threads_callback called for the main thread during that process? If so, was ti_tid == 0? That shouldn't happen unless the program is staticly linked. -- Daniel Jacobowitz CodeSourcery