From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23268 invoked by alias); 2 Dec 2008 13:54:36 -0000 Received: (qmail 23260 invoked by uid 22791); 2 Dec 2008 13:54:36 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate6.de.ibm.com (HELO mtagate6.de.ibm.com) (195.212.29.155) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 02 Dec 2008 13:53:52 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate6.de.ibm.com (8.13.8/8.13.8) with ESMTP id mB2DqY6o320940 for ; Tue, 2 Dec 2008 13:52:34 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id mB2DqYmh3674186 for ; Tue, 2 Dec 2008 14:52:34 +0100 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id mB2DqXRP015990 for ; Tue, 2 Dec 2008 14:52:34 +0100 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id mB2DqXqT015979; Tue, 2 Dec 2008 14:52:33 +0100 Message-Id: <200812021352.mB2DqXqT015979@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Tue, 2 Dec 2008 14:52:33 +0100 Subject: Re: [patch] Accessing tls variables across files causes a bug To: jan.kratochvil@redhat.com (Jan Kratochvil) Date: Tue, 02 Dec 2008 13:54:00 -0000 From: "Ulrich Weigand" Cc: vinay@linux.vnet.ibm.com (Vinay Sridhar), gdb-patches@sources.redhat.com, drow@false.org (Daniel Jacobowitz), luisgpm@linux.vnet.ibm.com, gary@intrepid.com (Gary Funck) In-Reply-To: <20081201215236.GA17136@host0.dyn.jankratochvil.net> from "Jan Kratochvil" at Dec 01, 2008 10:52:36 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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: 2008-12/txt/msg00034.txt.bz2 Jan Kratochvil wrote: > > I'm not sure I understand this comment -- the translated address of > > a thread-local variable obviously depends on the thread in which it > > is evaluated, so how should a single location like SYMBOL_VALUE_ADDRESS > > be able to hold that value for all threads? > > SYMBOL_VALUE_ADDRESS is used many times across GDB code and I assumed in most > of such cases it would be more appropriate to return the absolute address > valid for current inferior_ptid. > > But I now briefly checked all these points and found out in fact all of them > work with SYMBOL_VALUE_ADDRESS referring to function symbols - PC values (just > except value_static_field() but that is also not in use with TLS symbols). > Sure PC values are never TLS-translated. Agreed. > > In the LOC_COMPUTED case, we'd output something like "at offset ... > > in the thread-local storage for ...". For consistency reasons, I'd > > prefer to have the same output in the LOC_UNDEFINED case as well. > > While I copied the message from the LOC_COMPUTED case I agree it should be > consistent and if I wish the absolute address there it should be printed even > in the LOC_COMPUTED case which would be more a scope of a different patch. OK, thanks. > 2008-12-01 Jan Kratochvil > > Fix resolving external references to TLS variables. > * findvar.c: Include `objfiles.h'. > (read_var_value ): New variable `obj_section'. Handle > SEC_THREAD_LOCAL variables. > * printcmd.c (address_info ): Handle SEC_THREAD_LOCAL > variables. > > 2008-12-01 Jan Kratochvil > > Test resolving external references to TLS variables. > * gdb.threads/tls.exp: New tests to examine A_THREAD_LOCAL and > FILE2_THREAD_LOCAL. > (testfile2, srcfile2): New variables. > * gdb.threads/tls.c (file2_thread_local) > (function_referencing_file2_thread_local): New. > * gdb.threads/tls2.c: New file. This is OK. Thanks, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com