This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Accessing tls variables across files causes a bug


On 12/02/08 14:52:33, Ulrich Weigand wrote:
> > 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

If anyone ports this patch to 6.8 or can share what's
needed to implement the patch in 6.8, I'd appreciate
learning about that.  I quickly tried it, and it seems
that this part of the fix runs into difficulties:

diff -r1.4 findvar.c
36a37
> #include "objfiles.h"
580a582
>       struct obj_section *obj_section;
589a592,596
> 
>       obj_section = SYMBOL_OBJ_SECTION (msym);
>       if (obj_section
>           && (obj_section->the_bfd_section->flags & SEC_THREAD_LOCAL) != 0)
>         addr = target_translate_tls_address (obj_section->objfile, addr);


with related difficulties in printcmd.c.

SYMBOL_OBJ_SECTION was introduced in this mod to symtab.h

revision 1.131
date: 2008/09/05 11:37:17;  author: uweigand;  state: Exp;  lines: +17 -15
        * breakpoint.h (struct bp_location): Change type of section
        member to "struct obj_section *".
        * tracepoint.h (struct tracepoint): Likewise.
        * symtab.h (struct general_symbol_info): Replace bfd_section
        member with obj_section.
        (struct symtab_and_line): Change type of section member to
        "struct obj_section *".
        (SYMBOL_BFD_SECTION): Remove macro, replace by ...
        (SYMBOL_OBJ_SECTION): ... this.


thanks,
- Gary


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]