From: Yao Qi <qiyaoltc@gmail.com>
To: Philippe Waroquiers <philippe.waroquiers@skynet.be>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] PR varobj/18564 regression in showing __thread so extern variable
Date: Wed, 02 Sep 2015 13:03:00 -0000 [thread overview]
Message-ID: <86wpw9x9au.fsf@gmail.com> (raw)
In-Reply-To: <1440934487.22248.9.camel@skynet.be> (Philippe Waroquiers's message of "Sun, 30 Aug 2015 13:34:47 +0200")
Philippe Waroquiers <philippe.waroquiers@skynet.be> 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/gdb.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 <http://www.gnu.org/licenses/>. */
> +
> +# 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/testsuite/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 <stdio.h>
> +#include <pthread.h>
> +
> +extern __thread void *so_extern;
> +
> +static void *tls_ptr(void *p)
The code should comply to GNU coding standard.
> +{
> + so_extern = &so_extern;
> + printf("address is %p\n", &so_extern); /* break here to check result */
Don't have to call printf and include stdio.h.
--
Yao (齐尧)
next prev parent reply other threads:[~2015-09-02 13:03 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-30 11:34 Philippe Waroquiers
2015-09-02 13:03 ` Yao Qi [this message]
2015-09-02 21:23 ` Philippe Waroquiers
2015-09-03 9:37 ` Yao Qi
2015-09-03 22:03 ` [PATCH V2] " Philippe Waroquiers
2015-09-10 14:34 ` Pedro Alves
2015-09-15 19:15 ` Philippe Waroquiers
2015-09-10 20:14 ` Sergio Durigan Junior
2015-09-10 20:17 ` Sergio Durigan Junior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86wpw9x9au.fsf@gmail.com \
--to=qiyaoltc@gmail.com \
--cc=gdb-patches@sourceware.org \
--cc=philippe.waroquiers@skynet.be \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox