From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11648 invoked by alias); 17 Apr 2007 02:02:01 -0000 Received: (qmail 11627 invoked by uid 22791); 17 Apr 2007 02:01:58 -0000 X-Spam-Check-By: sourceware.org Received: from MGW2.Sony.CO.JP (HELO mgw2.sony.co.jp) (137.153.0.14) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 17 Apr 2007 03:01:49 +0100 Received: from mail36.sony.co.jp ([43.0.1.232]) Received: from mail36.sony.co.jp (localhost [127.0.0.1]) by mail36.sony.co.jp (R8/Sony) with ESMTP id l3H21jJ2020395; Tue, 17 Apr 2007 11:01:45 +0900 (JST) Received: from smail1.sm.sony.co.jp (smail1.sm.sony.co.jp [43.11.253.1]) by mail36.sony.co.jp (R8/Sony) with ESMTP id l3H21jYH020388; Tue, 17 Apr 2007 11:01:45 +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 l3H21iT28954; Tue, 17 Apr 2007 11:01:44 +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 l3H21hkN027536; Tue, 17 Apr 2007 11:01:43 +0900 (JST) Date: Tue, 17 Apr 2007 14:50:00 -0000 From: Yoriko Komatsuzaki To: Daniel Jacobowitz , Mark Kettenis , gdb-patches@sourceware.org Subject: Re: deal thread id as unsigned In-Reply-To: <20070416141858.GA3844@caradoc.them.org> References: <200704161410.l3GEARpW030103@brahms.sibelius.xs4all.nl> <20070416141858.GA3844@caradoc.them.org> Message-Id: <20070417105103.CC6E.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/msg00253.txt.bz2 Thank you for your reply and suggestion. I get my mind around no modification of defs.h because of the care for other os'es. Concerning to thread id printing, I would appreciate it if you could consider to print it by hexadecimal notation. Thank you. --- Yoriko Komatsuzaki yoriko@sm.sony.co.jp >> This suggests that >> it should really be printed as an (unsigned) hexadecimal number. >> Doing so doesn't need any changes to defs.h and therefore wouldn't >> affect any other platforms at all. > On Mon, Apr 16, 2007 at 04:10:27PM +0200, Mark Kettenis wrote: > > > Date: Mon, 16 Apr 2007 11:39:55 +0900 > > > From: Yoriko Komatsuzaki > > > > > > Hello. > > > > > > I would like to ask you to consider this tiny patch about thread id type. > > > Thread id is unsigned type in Linux. > > > > I believe it used to be a signed type in Linux. Anyway, you can't > > really change it, since on other OS'es the type defenitely is signed. > > Well, it used to be an int, but it would never be negative (always > small and positive). > > > You'll only really notice this when the msb is set anyway. I think > > this happens on the Linux threads implementation of today the thread > > id isn't an integer at all, but a pointer instead. This suggests that > > it should really be printed as an (unsigned) hexadecimal number. > > Doing so doesn't need any changes to defs.h and therefore wouldn't > > affect any other platforms at all. > > Right. I think printing it as hex is fine even for LinuxThreads, > where 0x4000 is not substantially less clear than "16384" (which was > always the thread ID of the first thread, no relation to PIDs). > > -- > Daniel Jacobowitz > CodeSourcery