From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1625 invoked by alias); 22 Oct 2008 01:07:52 -0000 Received: (qmail 1554 invoked by uid 22791); 22 Oct 2008 01:07:49 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-outbound-1.vmware.com (HELO smtp-outbound-1.vmware.com) (65.115.85.69) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 22 Oct 2008 01:06:57 +0000 Received: from mailhost3.vmware.com (mailhost3.vmware.com [10.16.27.45]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id B04F71305F; Tue, 21 Oct 2008 18:06:53 -0700 (PDT) Received: from [10.20.92.59] (promb-2s-dhcp59.eng.vmware.com [10.20.92.59]) by mailhost3.vmware.com (Postfix) with ESMTP id A3444C9A35; Tue, 21 Oct 2008 18:06:53 -0700 (PDT) Message-ID: <48FE7B9B.3040905@vmware.com> Date: Wed, 22 Oct 2008 01:07:00 -0000 From: Michael Snyder User-Agent: Thunderbird 1.5.0.12 (X11/20080411) MIME-Version: 1.0 To: Pedro Alves , "gdb-patches@sourceware.org" Subject: [RFA] Restore leading zeros in remote_thread_alive Content-Type: multipart/mixed; boundary="------------080309030307000907060901" 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: 2008-10/txt/msg00528.txt.bz2 This is a multi-part message in MIME format. --------------080309030307000907060901 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 420 Hi Pedro, VMware has a remote target for which "info threads" stopped working after you added your remote multi-process patch in September. I've finally got around to figuring out why. The docs don't actually say whether this message should have leading zeros, but it always used to (you can check out the old sprintf spec). If there's no compelling reason for removing them, do you mind if we put them back? ;-) --------------080309030307000907060901 Content-Type: text/plain; name="remote_thread_alive.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="remote_thread_alive.txt" Content-length: 1356 2008-10-21 Michael Snyder * remote.c (write_ptid): Emit leading zeros to preserve remote protocol behavior of remote_thread_alive. Index: remote.c =================================================================== RCS file: /cvs/src/src/gdb/remote.c,v retrieving revision 1.321 diff -u -p -r1.321 remote.c --- remote.c 17 Oct 2008 19:43:47 -0000 1.321 +++ remote.c 22 Oct 2008 01:00:16 -0000 @@ -1433,15 +1433,15 @@ write_ptid (char *buf, const char *endbu { pid = ptid_get_pid (ptid); if (pid < 0) - buf += xsnprintf (buf, endbuf - buf, "p-%x.", -pid); + buf += xsnprintf (buf, endbuf - buf, "p-%08x.", -pid); else - buf += xsnprintf (buf, endbuf - buf, "p%x.", pid); + buf += xsnprintf (buf, endbuf - buf, "p%08x.", pid); } tid = ptid_get_tid (ptid); if (tid < 0) - buf += xsnprintf (buf, endbuf - buf, "-%x", -tid); + buf += xsnprintf (buf, endbuf - buf, "-%x08", -tid); else - buf += xsnprintf (buf, endbuf - buf, "%x", tid); + buf += xsnprintf (buf, endbuf - buf, "%x08", tid); return buf; } @@ -2097,6 +2097,10 @@ remote_threads_info (void) { do { + /* Skip spaces. */ + while (*bufp == ' ') + bufp++; + new_thread = read_ptid (bufp, &bufp); if (!ptid_equal (new_thread, null_ptid) && (!in_thread_list (new_thread) --------------080309030307000907060901--