From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7152 invoked by alias); 26 Apr 2010 09:04:10 -0000 Received: (qmail 6964 invoked by uid 22791); 26 Apr 2010 09:04:08 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 26 Apr 2010 09:04:02 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o3Q941ie008490 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 26 Apr 2010 05:04:01 -0400 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o3Q93wLj026544 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 26 Apr 2010 05:04:00 -0400 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id o3Q93wfx028273; Mon, 26 Apr 2010 11:03:58 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id o3Q93vnL028272; Mon, 26 Apr 2010 11:03:57 +0200 Date: Mon, 26 Apr 2010 09:04:00 -0000 From: Jan Kratochvil To: gdb Mailing List Cc: Stefano Sabatini Subject: Re: pthread_t ids of threads not showed by "thread info" Message-ID: <20100426090357.GA27874@host0.dyn.jankratochvil.net> References: <20100422151855.GA3128@geppetto> <20100422154404.GB3128@geppetto> <20100422165924.GA1109@host0.dyn.jankratochvil.net> <20100423075135.GA3297@geppetto> <20100423102506.GA21618@host0.dyn.jankratochvil.net> <20100423142115.GA4538@geppetto> <20100423142511.GA6385@host0.dyn.jankratochvil.net> <20100423153554.GB4719@geppetto> <20100423154629.GA10463@host0.dyn.jankratochvil.net> <20100426083809.GA5767@geppetto> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100426083809.GA5767@geppetto> User-Agent: Mutt/1.5.20 (2009-08-17) 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-04/txt/msg00137.txt.bz2 On Mon, 26 Apr 2010 10:38:09 +0200, Stefano Sabatini wrote: > $ cd /usr/lib/debug/lib > $ cd > $ nm -S libpthread-2.10.2.so | grep __stack_user > 00017160 00000008 b __GI___stack_user > 00017160 00000008 b __stack_user > $ nm -S libpthread-2.10.2.so | grep stack_used > 0001511c 00000008 d stack_used You should have DWARFs symbols. The ELF symbols are not enough for structures derefencing. readelf -wi /usr/lib/debug/lib64/libpthread.so.0.debug [ formatted a bit ] <1><9304>: Abbrev Number: 111 (DW_TAG_variable) <9305> DW_AT_name : (indirect string, offset: 0x300b): __stack_user <930f> DW_AT_type : <0x461b> <9313> DW_AT_external : 1 <9314> DW_AT_location : 9 byte block: 3 80 b2 21 0 0 0 0 0 (DW_OP_addr: 21b280) <1><461b>: Abbrev Number: 3 (DW_TAG_typedef) <461c> DW_AT_name : (indirect string, offset: 0x7f8): list_t <4622> DW_AT_type : <0x45f0> <1><45f0>: Abbrev Number: 14 (DW_TAG_structure_type) <45f1> DW_AT_name : (indirect string, offset: 0x2469): list_head <45f5> DW_AT_byte_size : 16 <2><45fc>: Abbrev Number: 11 (DW_TAG_member) <45fd> DW_AT_name : (indirect string, offset: 0x169d): next <4603> DW_AT_type : <0x4615> <4607> DW_AT_data_member_location: 0 <2><4608>: Abbrev Number: 11 (DW_TAG_member) <4609> DW_AT_name : (indirect string, offset: 0x1303): prev <460f> DW_AT_type : <0x4615> <4613> DW_AT_data_member_location: 8 Anyway these symbols are not required for the right way of traversing this list. For that purpose (as being used for native non-core `info threads') GDB just calls functions provided by /lib64/libthread_db.so.1 . You can check glibc sources for nptl_db/td_ta_thr_iter.c . nptl_db uses simple ELF symbols not requiring the debuginfo files, like this one: $ gdb -q -ex 'p *(int *)_thread_db_pthread_list' -ex q /lib64/libpthread.so.0 $1 = 128 > I'm currently stucked with this, I really cannot say if it is a > problem with what I'm doing or with some debian specific issue. If Debian GDB cannot find the symbols guessing Debian probably has more light (smaller) debug info packages. Regards, Jan