Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* thread local storage (__thread) variables aren't working in gdb 6.5/6.6?
@ 2007-06-19 20:22 John Bates
  2007-06-19 20:28 ` Daniel Jacobowitz
  2007-06-25 23:20 ` John Bates
  0 siblings, 2 replies; 10+ messages in thread
From: John Bates @ 2007-06-19 20:22 UTC (permalink / raw)
  To: gdb

I can't find any confirmation of support or non-support of thread
local storage on the web or in the gdb documentation. I already tried
6.6 and it was the same problem. The test below seems to confirm
non-support on my fedora core 6 (kernel 2.6.18) x86 distribution with
gdb 6.5. Please let me know if I am doing something wrong for
debugging __thread global variables.

Thanks,
John


--- begin main.cpp ---
__thread int tlstest = 5;

int main()
{
	tlstest = 4; // line 5
	return 0;
}

--- begin Makefile ---
CXXFLAGS += -g
main : main.o

jbates@localhost:~/samples/tls_test$ make
g++ -g   -c -o main.o main.cpp
cc   main.o   -o main
jbates@localhost:~/samples/tls_test$ gdb main
GNU gdb Red Hat Linux (6.5-15.fc6rh)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...Using host
libthread_db library "/lib/libthread_db.so.1".

(gdb) b main.cpp:5
Breakpoint 1 at 0x8048352: file main.cpp, line 5.
(gdb) run
Starting program: /home/jbates/samples/tls_test/main

Breakpoint 1, main () at main.cpp:5
5               tlstest = 4;
(gdb) p tlstest
Cannot access memory at address 0x0
(gdb)


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-04-13 16:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-19 20:22 thread local storage (__thread) variables aren't working in gdb 6.5/6.6? John Bates
2007-06-19 20:28 ` Daniel Jacobowitz
2007-06-19 20:56   ` John Bates
2007-06-19 21:04     ` Daniel Jacobowitz
2007-06-25 23:20 ` John Bates
2007-06-26 17:06   ` Jim Blandy
2007-06-26 18:48     ` John Bates
2007-06-26 23:52       ` Jim Blandy
2009-04-09 18:48       ` ajitnayak
     [not found]         ` <20090409200657.GA22217@host0.dyn.jankratochvil.net>
     [not found]           ` <b1bfafd50904130735x32d369a0ub4005758d7d9e2c8@mail.gmail.com>
2009-04-13 19:00             ` Jan Kratochvil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox