From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28727 invoked by alias); 16 Apr 2007 02:40:05 -0000 Received: (qmail 28675 invoked by uid 22791); 16 Apr 2007 02:40:04 -0000 X-Spam-Check-By: sourceware.org Received: from MGW3.Sony.CO.JP (HELO mgw3.sony.co.jp) (137.153.0.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 16 Apr 2007 03:39:59 +0100 Received: from mail34.sony.co.jp ([43.0.1.230]) Received: from mail34.sony.co.jp (localhost [127.0.0.1]) by mail34.sony.co.jp (R8/Sony) with ESMTP id l3G2du89012450 for ; Mon, 16 Apr 2007 11:39:56 +0900 (JST) Received: from smail1.sm.sony.co.jp (smail1.sm.sony.co.jp [43.11.253.1]) by mail34.sony.co.jp (R8/Sony) with ESMTP id l3G2duSE012446 for ; Mon, 16 Apr 2007 11:39:56 +0900 (JST) Received: from imail.sm.sony.co.jp (imail.sm.sony.co.jp [43.4.191.32]) by smail1.sm.sony.co.jp (8.11.6p2/8.11.6) with ESMTP id l3G2duT28737 for ; Mon, 16 Apr 2007 11:39:56 +0900 (JST) Received: from [43.4.195.153] (yoriko2.sm.sony.co.jp [43.4.195.153]) by imail.sm.sony.co.jp (8.12.11/3.7W) with ESMTP id l3G2dtk8010449 for ; Mon, 16 Apr 2007 11:39:55 +0900 (JST) Date: Mon, 16 Apr 2007 12:02:00 -0000 From: Yoriko Komatsuzaki To: gdb-patches@sourceware.org Subject: deal thread id as unsigned Message-Id: <20070416111505.AE36.YORIKO@sm.sony.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.07.04 [ja] 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: 2007-04/txt/msg00244.txt.bz2 Hello. I would like to ask you to consider this tiny patch about thread id type. Thread id is unsigned type in Linux. Without this patch (especially about linux-thread-db.c), thread id display can be minus... # Apologies in advance if this is already-known issue. Thank you. --- gdb-6.6/gdb/defs.org.h 2007-04-10 16:04:51.000000000 +0900 +++ gdb-6.6/gdb/defs.h 2007-04-10 16:05:06.000000000 +0900 @@ -795,7 +795,7 @@ struct ptid long lwp; /* Thread id */ - long tid; + unsigned long tid; }; typedef struct ptid ptid_t; --- gdb-6.6/gdb/linux-thread-db.org.c 2007-04-10 16:55:55.000000000 +0900 +++ gdb-6.6/gdb/linux-thread-db.c 2007-04-10 16:53:30.000000000 +0900 @@ -1031,10 +1031,10 @@ thread_db_pid_to_str (ptid_t ptid) thread_info = find_thread_pid (ptid); if (thread_info == NULL) - snprintf (buf, sizeof (buf), "Thread %ld (LWP %ld) (Missing)", + snprintf (buf, sizeof (buf), "Thread %lu (LWP %ld) (Missing)", GET_THREAD (ptid), GET_LWP (ptid)); else - snprintf (buf, sizeof (buf), "Thread %ld (LWP %ld)", + snprintf (buf, sizeof (buf), "Thread %lu (LWP %ld)", GET_THREAD (ptid), GET_LWP (ptid)); return buf; --- Yoriko Komatsuzaki (yoriko@sm.sony.co.jp)