From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21145 invoked by alias); 25 Aug 2006 13:43:51 -0000 Received: (qmail 21102 invoked by uid 22791); 25 Aug 2006 13:43:33 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Fri, 25 Aug 2006 13:43:19 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1GGbxs-0001W8-6x; Fri, 25 Aug 2006 09:43:16 -0400 Date: Fri, 25 Aug 2006 20:02:00 -0000 From: Daniel Jacobowitz To: Jan Kratochvil Cc: gdb-patches@sourceware.org Subject: Re: RFC: Access TLS symbols without DWARF debuginfo Message-ID: <20060825134315.GA4994@nevyn.them.org> Mail-Followup-To: Jan Kratochvil , gdb-patches@sourceware.org References: <20060825021304.GA30225@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060825021304.GA30225@host0.dyn.jankratochvil.net> User-Agent: Mutt/1.5.11+cvs20060403 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-08/txt/msg00192.txt.bz2 On Fri, Aug 25, 2006 at 04:13:04AM +0200, Jan Kratochvil wrote: > Hi, > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=185337 > > currently if you have threaded (-lpthread) program compiled without debuginfo > "-g" and you try to access TLS symbol you will get: > (gdb) print thread_local > Cannot access memory at address 0x0 > > as gdb tries to resolve TLS-offset as absolute memory reference. > > In fact it occurs if you try to access "errno" on -lpthread program with > debuginfo lower than -ggdb3. > > Attached patch implements accessing them without the debuginfo suggestions as > not always such associatet debuginfo is available. It checks for > SYMBOL_BFD_SECTION (msymbol)->flags & SEC_THREAD_LOCAL > symbols, implements for them new `UNOP_MEMVAL_TLS' and reuses for them former > `dwarf_expr_tls_address'. Thanks for doing this. It's a good idea, and the first step to not needing libthread_db to do this - in most cases the gdbarch vector should have enough knowledge. And overall the patch looks very nice. The same general comments apply as to your other patch, e.g. about a ChangeLog. Could you explain why you added a new kind of value for this? I'd have thought that when we wanted the address of the symbol, we should be able to resolve it. So instead of value_at_lazy_tls, we would resolve the address using the target. Expressions persist between threads and executions, but values shouldn't. That should simplify the code a little. -- Daniel Jacobowitz CodeSourcery