This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug varobj/18564] regression in showing __thread so extern variable
- From: "mjw at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Wed, 26 Aug 2015 21:20:34 +0000
- Subject: [Bug varobj/18564] regression in showing __thread so extern variable
- Auto-submitted: auto-generated
- References: <bug-18564-4717 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=18564
--- Comment #3 from Mark Wielaard <mjw at redhat dot com> ---
Somewhat random attempt at a fix based on the observation of Philippe that in
the patch, elfread.c, there is one mention of 'non-TLS' and in that case the
offset was added previously.
diff --git a/gdb/findvar.c b/gdb/findvar.c
index a2a7bb7..e153989 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -582,7 +582,14 @@ default_read_var_value (struct symbol *var, struct
frame_info *frame)
obj_section = MSYMBOL_OBJ_SECTION (lookup_data.result.objfile, msym);
if (obj_section
&& (obj_section->the_bfd_section->flags & SEC_THREAD_LOCAL) != 0)
- addr = target_translate_tls_address (obj_section->objfile, addr);
+ {
+ CORE_ADDR offset;
+ struct objfile *objfile = obj_section->objfile;
+ offset = ANOFFSET (objfile->section_offsets,
+ gdb_bfd_section_index (objfile->obfd,
+ obj_section));
+ addr = target_translate_tls_address (objfile, addr - offset);
+ }
}
break;
With this the testcase passes again.
--
You are receiving this mail because:
You are on the CC list for the bug.