From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19578 invoked by alias); 14 May 2007 16:53:41 -0000 Received: (qmail 19558 invoked by uid 22791); 14 May 2007 16:53:40 -0000 X-Spam-Check-By: sourceware.org Received: from return.false.org (HELO return.false.org) (66.207.162.98) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 14 May 2007 16:53:36 +0000 Received: from return.false.org (localhost [127.0.0.1]) by return.false.org (Postfix) with ESMTP id 3E5634B267; Mon, 14 May 2007 11:53:35 -0500 (CDT) Received: from caradoc.them.org (dsl093-172-095.pit1.dsl.speakeasy.net [66.93.172.95]) by return.false.org (Postfix) with ESMTP id 11EA44B262; Mon, 14 May 2007 11:53:34 -0500 (CDT) Received: from drow by caradoc.them.org with local (Exim 4.67) (envelope-from ) id 1Hndnh-0000xu-Vp; Mon, 14 May 2007 12:53:33 -0400 Date: Mon, 14 May 2007 16:53:00 -0000 From: Daniel Jacobowitz To: Yoriko Komatsuzaki Cc: Mark Kettenis , gdb-patches@sourceware.org Subject: Re: deal thread id as unsigned Message-ID: <20070514165333.GB27054@caradoc.them.org> Mail-Followup-To: Yoriko Komatsuzaki , Mark Kettenis , gdb-patches@sourceware.org References: <200704161410.l3GEARpW030103@brahms.sibelius.xs4all.nl> <20070416141858.GA3844@caradoc.them.org> <20070417105103.CC6E.YORIKO@sm.sony.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070417105103.CC6E.YORIKO@sm.sony.co.jp> User-Agent: Mutt/1.5.15 (2007-04-09) 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-05/txt/msg00240.txt.bz2 On Tue, Apr 17, 2007 at 11:01:43AM +0900, Yoriko Komatsuzaki wrote: > > 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. Yes, this is a good idea. Sorry for the delay; I checked in this patch, to change the output to hexadecimal. Tested on x86_64-linux. I've just realized that the test change won't work on remote debugging; I'll fix up linux-dp.exp. -- Daniel Jacobowitz CodeSourcery 2007-05-14 Daniel Jacobowitz * linux-thread-db.c (thread_db_pid_to_str): Print thread IDs as hexadecimal. * gdb.threads/linux-dp.exp: Expect hexadecimal thread IDs. * gdb.threads/print-threads.exp (test_all_threads): Allow negative and hexadecimal thread IDs. Index: linux-thread-db.c =================================================================== RCS file: /cvs/src/src/gdb/linux-thread-db.c,v retrieving revision 1.29 diff -u -p -r1.29 linux-thread-db.c --- linux-thread-db.c 11 May 2007 19:55:19 -0000 1.29 +++ linux-thread-db.c 14 May 2007 16:49:49 -0000 @@ -1013,10 +1013,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 0x%lx (LWP %ld) (Missing)", GET_THREAD (ptid), GET_LWP (ptid)); else - snprintf (buf, sizeof (buf), "Thread %ld (LWP %ld)", + snprintf (buf, sizeof (buf), "Thread 0x%lx (LWP %ld)", GET_THREAD (ptid), GET_LWP (ptid)); return buf; Index: testsuite/gdb.threads/linux-dp.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.threads/linux-dp.exp,v retrieving revision 1.15 diff -u -p -r1.15 linux-dp.exp --- testsuite/gdb.threads/linux-dp.exp 9 Jan 2007 17:59:14 -0000 1.15 +++ testsuite/gdb.threads/linux-dp.exp 14 May 2007 16:49:50 -0000 @@ -74,7 +74,7 @@ for {set i 0} {$i < 5} {incr i} { -re "info threads\r\n" { exp_continue } - -re "^. +(\[0-9\]+ Thread \[-0-9\]+) \[^\n\]*\n" { + -re "^. +(\[0-9\]+ Thread 0x\[0-9a-f\]+) \[^\n\]*\n" { verbose -log "found thread $expect_out(1,string)" 2 lappend threads_before $expect_out(1,string) exp_continue @@ -147,7 +147,7 @@ for {set i 0} {$i < 5} {incr i} { -re "info threads\r\n" { exp_continue } - -re "^. +(\[0-9\]+ Thread \[-0-9\]+) \[^\n\]*\n" { + -re "^. +(\[0-9\]+ Thread 0x\[0-9a-f\]+) \[^\n\]*\n" { set name $expect_out(1,string) for {set j 0} {$j != [llength $threads_before] } {incr j} { if {$name == [lindex $threads_before $j]} { Index: testsuite/gdb.threads/print-threads.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.threads/print-threads.exp,v retrieving revision 1.7 diff -u -p -r1.7 print-threads.exp --- testsuite/gdb.threads/print-threads.exp 9 Jan 2007 17:59:14 -0000 1.7 +++ testsuite/gdb.threads/print-threads.exp 14 May 2007 16:49:50 -0000 @@ -94,7 +94,7 @@ proc test_all_threads { name kill } { fail "all threads ran once ($name) (total $i threads ran)" } } - -re "Program received signal SIGTRAP.*(Thread \[0-9\]* \\(zombie\\)|0x00000000 in ).*$gdb_prompt $" { + -re "Program received signal SIGTRAP.*(Thread \[-0-9a-fx\]* \\(zombie\\)|0x00000000 in ).*$gdb_prompt $" { if { $kill == 1 } { kfail "gdb/1265" "Running threads ($name) (zombie thread)" } else {