From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24937 invoked by alias); 7 Jun 2005 18:19:39 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 24928 invoked by uid 22791); 7 Jun 2005 18:19:33 -0000 Received: from e31.co.us.ibm.com (HELO e31.co.us.ibm.com) (32.97.110.129) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Tue, 07 Jun 2005 18:19:33 +0000 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e31.co.us.ibm.com (8.12.10/8.12.9) with ESMTP id j57IJPua184088 for ; Tue, 7 Jun 2005 14:19:25 -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 j57IJP67171478 for ; Tue, 7 Jun 2005 12:19:25 -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 j57IJPqs021961 for ; Tue, 7 Jun 2005 12:19:25 -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 j57IJO53021913 for ; Tue, 7 Jun 2005 12:19:24 -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 j57IJOeQ109212 for ; Tue, 7 Jun 2005 13:19:24 -0500 Date: Tue, 07 Jun 2005 18:19:00 -0000 From: Manoj Iyer X-X-Sender: manjo@lazy To: gdb-patches@sources.redhat.com Subject: [RFC] Print thread id in hex. Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2005-06/txt/msg00057.txt.bz2 >From the earlier discussion sub: "debugging threaded apps. thread ID missing in corefile." I wrote this patch to print the thread ids in HEX (%#lx) instead of decimal (%ld). 2005-06-07 Manoj Iyer * linux-thread-db.c (thread_db_pid_to_str): Print thread id in hex. -------------------------------------------------------------------------- --- ./old/src/gdb/linux-thread-db.c 2005-06-07 12:52:32.000000000 -0500 +++ ./new/src/gdb/linux-thread-db.c 2005-06-07 12:55:11.000000000 -0500 @@ -1211,12 +1211,12 @@ thread_db_pid_to_str (ptid_t ptid) if (ti_p->ti_state == TD_THR_ACTIVE && ti_p->ti_lid != 0) { - snprintf (buf, sizeof (buf), "Thread %ld (LWP %d)", + snprintf (buf, sizeof (buf), "Thread %#lx (LWP %d)", (long) ti_p->ti_tid, ti_p->ti_lid); } else { - snprintf (buf, sizeof (buf), "Thread %ld (%s)", + snprintf (buf, sizeof (buf), "Thread %#lx (%s)", (long) ti_p->ti_tid, thread_db_state_str (ti_p->ti_state)); } Thanks ----- manjo +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + Cogito ergo sum + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++