From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11399 invoked by alias); 6 Jun 2005 22:42:13 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 11363 invoked by uid 22791); 6 Jun 2005 22:42:08 -0000 Received: from e33.co.us.ibm.com (HELO e33.co.us.ibm.com) (32.97.110.131) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 06 Jun 2005 22:42:08 +0000 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e33.co.us.ibm.com (8.12.10/8.12.9) with ESMTP id j56Mg0mD545904 for ; Mon, 6 Jun 2005 18:42:00 -0400 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j56MfxXR180424 for ; Mon, 6 Jun 2005 16:42:00 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11/8.13.3) with ESMTP id j56MfwI1013908 for ; Mon, 6 Jun 2005 16:41:58 -0600 Received: from austin.ibm.com (netmail2.austin.ibm.com [9.41.248.176]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j56MfwWw013573 for ; Mon, 6 Jun 2005 16:41:58 -0600 Received: from lazy.austin.ibm.com (lazy.austin.ibm.com [9.53.94.97]) by austin.ibm.com (8.12.10/8.12.10) with ESMTP id j56MfleQ132558 for ; Mon, 6 Jun 2005 17:41:48 -0500 Date: Mon, 06 Jun 2005 22:42:00 -0000 From: Manoj Iyer X-X-Sender: manjo@lazy To: gdb@sources.redhat.com Subject: debugging threaded apps. thread ID missing in corefile. In-Reply-To: <200506061929.47871.abeach@deepvision.ca> Message-ID: References: <200506061929.47871.abeach@deepvision.ca> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2005-06/txt/msg00051.txt.bz2 Regarding debugging threaded apps, gdb does not display the pthread id (ID returned by pthread_self() ) when reading information from a corefile. GNU gdb 6.3.50.20050504-cvs Copyright 2004 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 "powerpc64-unknown-linux-gnu"...Using host libthread_ db library "/lib/tls/libthread_db.so.1". Core was generated by `./test'. Program terminated with signal 11, Segmentation fault. Reading symbols from /lib/tls/libpthread.so.0...done. Loaded symbols for /lib/tls/libpthread.so.0 Reading symbols from /lib/tls/libc.so.6...done. Loaded symbols for /lib/tls/libc.so.6 Reading symbols from /lib/ld.so.1...done. Loaded symbols for /lib/ld.so.1 #0 0x100007c4 in whackthestack () at test.c:76 76 *(int*)0xdeaddead = 0; /* uncomment to test signal handler * / (gdb) thread [Current thread is 1 (process 9623)] (gdb) thread 2 [Switching to thread 2 (process 9628)]#0 0x0ff15a64 in __nanosleep_nocancel () from /lib/tls/libc.so.6 (gdb) Where as when debugging the program live it is able to display the pthread id (I dont know why the ID is a negative number, could be a bug?). GNU gdb 6.3.50.20050504-cvs Copyright 2004 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 "powerpc64-unknown-linux-gnu"...Using host libthread_db library "/lib/tls/libthread_db.so.1". (gdb) br callme Breakpoint 1 at 0x10000838: file test.c, line 83. (gdb) r Starting program: /home/manjo/projects/zlinux/test64 [Thread debugging using libthread_db enabled] [New Thread -134270944 (LWP 10491)] [New Thread -134273824 (LWP 10494)] [Switching to Thread -134273824 (LWP 10494)] Breakpoint 1, callme (me=0, i=0) at test.c:83 83 tid = pthread_self(); (gdb) thread 2 [Switching to thread 2 (Thread -134273824 (LWP 10494))]#0 callme (me=0, i=0) at test.c:83 83 tid = pthread_self(); So the question really is, is GDB not reading the thread id from core or the kernel not dumping r2/r13 (ppc) (address of the struct pthread) to the core? Thanks ----- manjo +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + Cogito ergo sum + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ On Mon, 6 Jun 2005, Alvin Beach wrote: > Hello all, > > I don't know why or how, but after I installed gdb-debuginfo-6.3-14 I can now > debug threaded applications. > > I thought I'd send this out in case someone else has run into the same problem > I did. > > Alvin > > -- > Please reply to the list. >