From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21062 invoked by alias); 18 Aug 2010 14:17:45 -0000 Received: (qmail 21050 invoked by uid 22791); 18 Aug 2010 14:17:44 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 18 Aug 2010 14:17:39 +0000 Received: (qmail 14708 invoked from network); 18 Aug 2010 14:17:38 -0000 Received: from unknown (HELO orlando.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 18 Aug 2010 14:17:38 -0000 From: Pedro Alves To: gdb@sourceware.org Subject: Re: pthread_t ids of threads not showed by "thread info" Date: Wed, 18 Aug 2010 14:17:00 -0000 User-Agent: KMail/1.13.2 (Linux/2.6.33-29-realtime; KDE/4.4.2; x86_64; ; ) Cc: Stefano Sabatini References: <20100422151855.GA3128@geppetto> In-Reply-To: <20100422151855.GA3128@geppetto> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201008181517.35676.pedro@codesourcery.com> 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: 2010-08/txt/msg00115.txt.bz2 Hi, On Thursday 22 April 2010 16:18:55, Stefano Sabatini wrote: > Hi all, > > $ gdb --version > GNU gdb (GDB) 7.1 > > (gdb) info threads > * 9 Thread 25919 0x0040cc7d in PSafeObject::LockReadOnly (this=0xb6d3d1d8) > at ../common/safecoll.cxx:144 > 8 Thread 25920 0x00885402 in __kernel_vsyscall () > 7 Thread 25921 0x00885402 in __kernel_vsyscall () > 6 Thread 25922 0x00885402 in __kernel_vsyscall () > 5 Thread 25927 0x00885402 in __kernel_vsyscall () > 4 Thread 25928 0x00885402 in __kernel_vsyscall () > 3 Thread 16215 0x00885402 in __kernel_vsyscall () > 2 Thread 16216 0x00885402 in __kernel_vsyscall () > 1 Thread 25917 0x00885402 in __kernel_vsyscall () > (gdb) help info thread > IDs of currently known threads. > > This shows the gdb thread number, the process ID and I don't know > what's contained in the fourth column, but that's for sure cannot be > the same as the pthread_t id as it is the same for all the threads. > > On another machine I get this output: > 3 Thread 0xb7642b70 (LWP 3334) (running) > 2 Thread 0xb7e43b70 (LWP 3333) (running) > * 1 Thread 0xb7e446c0 (LWP 3327) 0xb7fe1424 in __kernel_vsyscall () > > Can you explain the differences, and why are there in the first place? > > Also in the first scenario I cannot get the pthread_t information, which > is shown in the third column of the second scenario. > > To me this sounds like a real puzzle, I'll be grateful to whom will > help me to figure it out, also a pointer to the location in the gdb > sources where the "info thread" command is executed would be welcome. Just to put closure on this thread: this is now fixed on CVS mainline (future 7.3). "info threads" when debugging a core file now has the same output as when debugging the process when it was live, and, you can now inspect TLS variables when debugging a core file. This should Just Work when debugging core files generated on the same machine you are debugging. When moving cores between machines, you may need to point gdb at the correct libthread_db.so with "(gdb) set libthread-db-search-path". See the manual for more details on that command. -- Pedro Alves