From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25264 invoked by alias); 19 Jun 2007 20:22:10 -0000 Received: (qmail 25255 invoked by uid 22791); 19 Jun 2007 20:22:09 -0000 X-Spam-Check-By: sourceware.org Received: from mu-out-0910.google.com (HELO mu-out-0910.google.com) (209.85.134.188) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 19 Jun 2007 20:22:07 +0000 Received: by mu-out-0910.google.com with SMTP id g7so2307480muf for ; Tue, 19 Jun 2007 13:22:04 -0700 (PDT) Received: by 10.82.116.15 with SMTP id o15mr14398862buc.1182284524372; Tue, 19 Jun 2007 13:22:04 -0700 (PDT) Received: by 10.82.136.19 with HTTP; Tue, 19 Jun 2007 13:22:04 -0700 (PDT) Message-ID: Date: Tue, 19 Jun 2007 20:22:00 -0000 From: "John Bates" To: gdb@sourceware.org Subject: thread local storage (__thread) variables aren't working in gdb 6.5/6.6? MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-06/txt/msg00162.txt.bz2 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)