From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19410 invoked by alias); 4 Aug 2008 19:36:33 -0000 Received: (qmail 19401 invoked by uid 22791); 4 Aug 2008 19:36:32 -0000 X-Spam-Check-By: sourceware.org Received: from igw3.br.ibm.com (HELO igw3.br.ibm.com) (32.104.18.26) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 04 Aug 2008 19:35:39 +0000 Received: from mailhub3.br.ibm.com (unknown [9.18.232.110]) by igw3.br.ibm.com (Postfix) with ESMTP id 7DCF83900A6 for ; Mon, 4 Aug 2008 16:16:19 -0300 (BRST) Received: from d24av01.br.ibm.com (d24av01.br.ibm.com [9.18.232.46]) by mailhub3.br.ibm.com (8.13.8/8.13.8/NCO v8.7) with ESMTP id m74JHFp41040582 for ; Mon, 4 Aug 2008 16:17:23 -0300 Received: from d24av01.br.ibm.com (loopback [127.0.0.1]) by d24av01.br.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m74JH9nP024835 for ; Mon, 4 Aug 2008 16:17:10 -0300 Received: from [9.18.200.131] ([9.18.200.131]) by d24av01.br.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id m74JH8n7024781 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 4 Aug 2008 16:17:09 -0300 Subject: Re: [patch] Re: Accessing tls variables across files causes a bug From: Luis Machado Reply-To: luisgpm@linux.vnet.ibm.com To: Jan Kratochvil Cc: Vinay Sridhar , gdb-patches@sources.redhat.com In-Reply-To: <20080802171807.GA2755@host0.dyn.jankratochvil.net> References: <1217480020.4755.1.camel@vinaysridhar.in.ibm.com> <20080802171807.GA2755@host0.dyn.jankratochvil.net> Content-Type: text/plain Date: Mon, 04 Aug 2008 19:36:00 -0000 Message-Id: <1217877435.29334.98.camel@gargoyle> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 7bit 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: 2008-08/txt/msg00061.txt.bz2 Thanks for working on this. Just a few cosmetic comments. On Sat, 2008-08-02 at 19:18 +0200, Jan Kratochvil wrote: > block = BLOCKVECTOR_BLOCK (bv, block_index); > sym = lookup_block_symbol (block, name, linkage_name, domain); > - if (sym) > + if (sym != NULL) Shouldn't we just leave it as "if (sym)"? > { > - block_found = block; > - return fixup_symbol_section (sym, objfile); > + sym_best = sym; > + if (SYMBOL_CLASS (sym) != LOC_UNRESOLVED > + && SYMBOL_CLASS (sym) != LOC_OPTIMIZED_OUT) > + break; > } > } > --- /dev/null 1 Jan 1970 00:00:00 -0000 > +++ ./gdb/testsuite/gdb.threads/tls2.c 2 Aug 2008 17:05:40 -0000 > @@ -0,0 +1,28 @@ > +/* This testcase is part of GDB, the GNU debugger. > + > + Copyright 2008 Free Software Foundation, Inc. > + > + This program is free software; you can redistribute it and/or > modify > + it under the terms of the GNU General Public License as published > by > + the Free Software Foundation; either version 3 of the License, or > + (at your option) any later version. > + > + This program is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + GNU General Public License for more details. > + > + You should have received a copy of the GNU General Public License > + along with this program. If not, see > . > + > + Please email any bugs, comments, and/or additions to this file to: > + bug-gdb@prep.ai.mit.edu */ This header is probably very old. Newer testcases have a more up-to-date header. For example, gdb.opt/clobbered-registers-O2.c. The patch works for me, getting rid of the memory access error when trying to inspect the extern tls variable. Regards, Luis