aboutsummaryrefslogtreecommitdiff
path: root/gdb/printcmd.c
diff options
context:
space:
mode:
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>2015-09-15 21:02:15 +0200
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>2015-09-15 21:12:39 +0200
commit5382cfab6110741b8ba36965b30334c00d8f9409 (patch)
tree957171c8f248954789ffbd0ec8539e3bef008d48 /gdb/printcmd.c
parente68fa6f07666ec4726cfef59f641a81244cc2e00 (diff)
downloadgdb-5382cfab6110741b8ba36965b30334c00d8f9409.zip
gdb-5382cfab6110741b8ba36965b30334c00d8f9409.tar.gz
gdb-5382cfab6110741b8ba36965b30334c00d8f9409.tar.bz2
Fix PR/18564 - regression in showing __thread so extern variable
Ensure tls variable address is not relocated, as the msym addr is an offset in the thread local storage of the shared library/object.
Diffstat (limited to 'gdb/printcmd.c')
-rw-r--r--gdb/printcmd.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index 5729b24..823f27b 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -1376,16 +1376,19 @@ address_info (char *exp, int from_tty)
else
{
section = MSYMBOL_OBJ_SECTION (msym.objfile, msym.minsym);
- load_addr = BMSYMBOL_VALUE_ADDRESS (msym);
if (section
&& (section->the_bfd_section->flags & SEC_THREAD_LOCAL) != 0)
- printf_filtered (_("a thread-local variable at offset %s "
- "in the thread-local storage for `%s'"),
- paddress (gdbarch, load_addr),
- objfile_name (section->objfile));
+ {
+ load_addr = MSYMBOL_VALUE_RAW_ADDRESS (msym.minsym);
+ printf_filtered (_("a thread-local variable at offset %s "
+ "in the thread-local storage for `%s'"),
+ paddress (gdbarch, load_addr),
+ objfile_name (section->objfile));
+ }
else
{
+ load_addr = BMSYMBOL_VALUE_ADDRESS (msym);
printf_filtered (_("static storage at address "));
fputs_filtered (paddress (gdbarch, load_addr), gdb_stdout);
if (section_is_overlay (section))