[patch+7.12.1 2/2] Fix TLS (such as 'errno') regression

Mark Wielaard mjw@redhat.com
Mon Oct 10 10:45:00 GMT 2016


On Sun, 2016-10-09 at 20:56 +0200, Jan Kratochvil wrote:
> 2273f0ac95a79ce29ef42025c63f90e82cf907d7 is the first bad commit
> commit 2273f0ac95a79ce29ef42025c63f90e82cf907d7
> Author: Tom Tromey <tromey@redhat.com>
> Date:   Tue Oct 15 13:28:57 2013 -0600
>     change minsyms not to be relocated at read-time
> [FYI v3 06/10] change minsyms not to be relocated at read-time
> Message-Id: <1393441273-32268-7-git-send-email-tromey@redhat.com>
> https://sourceware.org/ml/gdb-patches/2014-02/msg00798.html
> 
> mv /usr/lib/debug /usr/lib/debug-x
> echo 'int main(){}'|gcc -pthread -x c -
> ./gdb -q -ex start -ex 'set debug expr 1' -ex 'p errno' ./a.out 
> 	    0  UNOP_MEMVAL_TLS       TLS type @0x35df7e0 (__thread /* "/lib64/libc.so.6" */ <thread local variable, no debug info>)
> 	    4    OP_LONG               Type @0x35df850 (__CORE_ADDR), value 140737345728528 (0x7ffff77fb010)
> Cannot access memory at address 0xffffef7c9698
> ->
> 	    0  UNOP_MEMVAL_TLS       TLS type @0x3ad9520 (__thread /* "/lib64/libc.so.6" */ <thread local variable, no debug info>)
> 	    4    OP_LONG               Type @0x3ad9590 (__CORE_ADDR), value 16 (0x10)
> $1 = 0
> 
> With glibc debuginfo, that is without: mv /usr/lib/debug /usr/lib/debug-x
> 	    0  OP_VAR_VALUE          Block @0x3b30e70, symbol @0x3b30d10 (errno)
> $1 = 0
> So such case is unrelated to this patch and the regression is not visible with
> glibc debuginfo installed.

FYI. This issue, cause and fix look very similar to PR varobj/18564
"regression in showing __thread so extern variable".

Might there be other places that need similar adjustments for getting at
the values of tls variables?



More information about the Gdb-patches mailing list