Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: jan.kratochvil@redhat.com (Jan Kratochvil)
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)
Subject: Re: [patch] Accessing tls variables across files causes a bug
Date: Tue, 02 Dec 2008 13:54:00 -0000	[thread overview]
Message-ID: <200812021352.mB2DqXqT015979@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <20081201215236.GA17136@host0.dyn.jankratochvil.net> from "Jan Kratochvil" at Dec 01, 2008 10:52:36 PM

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  <jan.kratochvil@redhat.com>
> 
> 	Fix resolving external references to TLS variables.
> 	* findvar.c: Include `objfiles.h'.
> 	(read_var_value <LOC_UNRESOLVED>): New variable `obj_section'.  Handle
> 	SEC_THREAD_LOCAL variables.
> 	* printcmd.c (address_info <LOC_UNRESOLVED>): Handle SEC_THREAD_LOCAL
> 	variables.
> 
> 2008-12-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
> 
> 	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


  reply	other threads:[~2008-12-02 13:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-10  4:24 [Fwd: Re: [patch] Re: Accessing tls variables across files causes a bug] Vinay Sridhar
2008-11-27 15:01 ` [patch] Accessing tls variables across files causes a bug Gary Funck
2008-11-27 17:07   ` Jan Kratochvil
2008-12-01 14:15     ` Jan Kratochvil
2008-12-01 18:30       ` Ulrich Weigand
     [not found]     ` <20081201182931.GA18248@intrepid.com>
2008-12-01 21:54       ` Jan Kratochvil
2008-12-02 13:54         ` Ulrich Weigand [this message]
2008-12-02 14:53           ` Gary Funck
2008-12-02 15:13             ` Jan Kratochvil
2008-12-02 15:40               ` Gary Funck

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=200812021352.mB2DqXqT015979@d12av02.megacenter.de.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=drow@false.org \
    --cc=gary@intrepid.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=jan.kratochvil@redhat.com \
    --cc=luisgpm@linux.vnet.ibm.com \
    --cc=vinay@linux.vnet.ibm.com \
    /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