From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 70678 invoked by alias); 2 Sep 2015 13:03:57 -0000 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 Received: (qmail 70126 invoked by uid 89); 2 Sep 2015 13:03:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f44.google.com Received: from mail-pa0-f44.google.com (HELO mail-pa0-f44.google.com) (209.85.220.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 02 Sep 2015 13:03:54 +0000 Received: by pacfv12 with SMTP id fv12so11435181pac.2 for ; Wed, 02 Sep 2015 06:03:52 -0700 (PDT) X-Received: by 10.66.136.237 with SMTP id qd13mr56466224pab.84.1441199030920; Wed, 02 Sep 2015 06:03:50 -0700 (PDT) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id a2sm21892810pas.47.2015.09.02.06.03.48 (version=TLS1_2 cipher=AES128-SHA256 bits=128/128); Wed, 02 Sep 2015 06:03:50 -0700 (PDT) From: Yao Qi To: Philippe Waroquiers Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] PR varobj/18564 regression in showing __thread so extern variable References: <1440934487.22248.9.camel@skynet.be> Date: Wed, 02 Sep 2015 13:03:00 -0000 In-Reply-To: <1440934487.22248.9.camel@skynet.be> (Philippe Waroquiers's message of "Sun, 30 Aug 2015 13:34:47 +0200") Message-ID: <86wpw9x9au.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2015-09/txt/msg00036.txt.bz2 Philippe Waroquiers writes: Hi Philippe, I am not an expert on symbol stuff, but I can only review test case. Some one else may review the rest of the patch later. > diff --git a/gdb/testsuite/gdb.threads/tls-so_extern.c b/gdb/testsuite/gd= b.threads/tls-so_extern.c > new file mode 100644 > index 0000000..1559de2 > --- /dev/null > +++ b/gdb/testsuite/gdb.threads/tls-so_extern.c > @@ -0,0 +1 @@ > +__thread void *so_extern; We need a copy right header. > diff --git a/gdb/testsuite/gdb.threads/tls-so_extern.exp b/gdb/testsuite/= gdb.threads/tls-so_extern.exp > new file mode 100644 > index 0000000..c4acb21 > --- /dev/null > +++ b/gdb/testsuite/gdb.threads/tls-so_extern.exp > @@ -0,0 +1,70 @@ > +# Copyright 2015-2015 Free Software Foundation, Inc. Either 2014-2015 or 2015. > + > +# 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 . = */ > + > +# tls-so_extern.exp -- Expect script to test thread local storage in gdb= , with > +# a variable defined in a shared library. > + > +standard_testfile tls-so_extern_main.c > +set libfile tls-so_extern > +set srcfile_lib ${libfile}.c > +set binfile_lib [standard_output_file ${libfile}.so] > + > +remote_exec build "rm -f ${binfile}" > + Don't need to remove binfile. > diff --git a/gdb/testsuite/gdb.threads/tls-so_extern_main.c b/gdb/testsui= te/gdb.threads/tls-so_extern_main.c > new file mode 100644 > index 0000000..5531fda > --- /dev/null > +++ b/gdb/testsuite/gdb.threads/tls-so_extern_main.c > @@ -0,0 +1,21 @@ Copy right header is needed. > +#include > +#include > + > +extern __thread void *so_extern; > + > +static void *tls_ptr(void *p) The code should comply to GNU coding standard. > +{ > + so_extern =3D &so_extern; > + printf("address is %p\n", &so_extern); /* break here to check result = */ Don't have to call printf and include stdio.h. --=20 Yao (=E9=BD=90=E5=B0=A7)