From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24199 invoked by alias); 7 Mar 2002 21:39:37 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 23910 invoked from network); 7 Mar 2002 21:39:32 -0000 Received: from unknown (HELO rwcrmhc53.attbi.com) (204.127.198.39) by sources.redhat.com with SMTP; 7 Mar 2002 21:39:32 -0000 Received: from ocean.lucon.org ([12.234.143.38]) by rwcrmhc53.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20020307213932.QKGY2951.rwcrmhc53.attbi.com@ocean.lucon.org> for ; Thu, 7 Mar 2002 21:39:32 +0000 Received: by ocean.lucon.org (Postfix, from userid 1000) id 2F2B5125C3; Thu, 7 Mar 2002 13:39:28 -0800 (PST) Date: Thu, 07 Mar 2002 13:39:00 -0000 From: "H . J . Lu" To: GDB Subject: Re: Does gdb 5.2 work with statically linked thread application under Linux? Message-ID: <20020307133928.A12672@lucon.org> References: <20020306233050.A31848@lucon.org> <20020307024841.A24509@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20020307024841.A24509@nevyn.them.org>; from drow@mvista.com on Thu, Mar 07, 2002 at 02:48:41AM -0500 X-SW-Source: 2002-03/txt/msg00062.txt.bz2 On Thu, Mar 07, 2002 at 02:48:41AM -0500, Daniel Jacobowitz wrote: > On Wed, Mar 06, 2002 at 11:30:50PM -0800, H . J . Lu wrote: > > Does gdb 5.2 work with statically linked thread application under > > Linux? It doesn't work for me at all. It doesn't know any thread. > > I have a patch which works for gdb 5.1. Now it doesn't work for 5.2 > > anymore. > > My fault, I think. > > The problem is that in a dynamically linked binary > thread_db_new_objfile will be called for every library is loaded. At > this point current_target is "child", so target_has_execution is true. > But with a static binary, the first time the function is called objfile > is NULL, and the second time current_target is "exec" (which has > target_has_execution set false). > > Perhaps target_has_execution was not the right check after all, if > "exec" has it set false (which makes fairly little sense to me...) or > perhaps we need to call the hook again later. Michael, any idea? > What is the problem if "|| !target_has_execution" is removed? I removed it. Gdb now works on statically linked thread application as well as core file. Did I miss soemthing? H.J.