From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15111 invoked by alias); 16 Sep 2011 23:01:07 -0000 Received: (qmail 15077 invoked by uid 22791); 16 Sep 2011 23:01:02 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 16 Sep 2011 23:00:48 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=EU1-MAIL.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1R4hOo-0004Qb-O7 from pedro_alves@mentor.com ; Fri, 16 Sep 2011 16:00:46 -0700 Received: from scottsdale.localnet ([172.16.63.104]) by EU1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.1830); Sat, 17 Sep 2011 00:00:44 +0100 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: wrong assumptions about pthread_t being numeric Date: Fri, 16 Sep 2011 23:16:00 -0000 User-Agent: KMail/1.13.6 (Linux/2.6.38-11-generic; KDE/4.7.0; x86_64; ; ) Cc: John Spencer References: <4E73D06F.603@barfooze.de> In-Reply-To: <4E73D06F.603@barfooze.de> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201109170000.43306.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-09/txt/msg00330.txt.bz2 On Friday 16 September 2011 23:40:47, John Spencer wrote: > i basically wanted to fix my compile error and send a patch, but i think > this should be discussed first. > $ grep ti_tid `find gdb-7.3.1 -name '*.c'` > gdb-7.3.1/gdb/sol-thread.c: return BUILD_THREAD (ti.ti_tid, PIDGET (lwp)); > gdb-7.3.1/gdb/sol-thread.c: ptid = BUILD_THREAD (ti.ti_tid, PIDGET > (inferior_ptid)); > gdb-7.3.1/gdb/sol-thread.c: ti.ti_tid, ti.ti_lid); > gdb-7.3.1/gdb/aix-thread.c: return thrinf.ti_tid; These are only built natively on solaris and aix respectively, so let's just leave them alone. > thread-db.c: In function 'find_one_thread': > thread-db.c:295:7: error: format '%ld' expects type 'long int', but > argument 3 has type 'thread_t' > thread-db.c: In function 'attach_thread': > thread-db.c:335:7: error: format '%ld' expects type 'long int', but > argument 3 has type 'thread_t' > thread-db.c:341:9: error: format '%ld' expects type 'long int', but > argument 2 has type 'thread_t' So just cast it to long, and you're done. > gdb-7.3.1/gdb/linux-thread-db.c: gdb_assert (ti_p->ti_tid != 0); > gdb-7.3.1/gdb/linux-thread-db.c: private->tid = ti_p->ti_tid; > gdb-7.3.1/gdb/linux-thread-db.c: if (ti.ti_tid == 0 && > target_has_execution) > gdb-7.3.1/gdb/gdbserver/thread-db.c: ti.ti_tid, ti.ti_lid); > gdb-7.3.1/gdb/gdbserver/thread-db.c: if (ti.ti_tid == 0) > gdb-7.3.1/gdb/gdbserver/thread-db.c: ti_p->ti_tid, ti_p->ti_lid); > gdb-7.3.1/gdb/gdbserver/thread-db.c: ti_p->ti_tid, ti_p->ti_lid); Does your libc actually have a libthread_db.so? -- Pedro Alves