From: Pedro Alves <pedro@codesourcery.com>
To: Michael Snyder <msnyder@vmware.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [RFA] Restore leading zeros in remote_thread_alive
Date: Wed, 22 Oct 2008 13:19:00 -0000 [thread overview]
Message-ID: <200810221418.22409.pedro@codesourcery.com> (raw)
In-Reply-To: <48FE7B9B.3040905@vmware.com>
On Wednesday 22 October 2008 02:02:19, Michael Snyder wrote:
> --- 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;
( Now that I've slept a bit, :-) ) I've gone through an old version of the code
and documentation looking for places we use write_ptid now that used to
output %08x vs places we used to output "-1" or %x. Indeed, I can only see
that in remote_thread_alive. The change above can possibly lead to other
stubs out there (with similar assumptions to yours) not parsing e.g., Hg-000000001
correctly, because they were expecting Hg-1, or e.g., misparsing vCont, because
used to be "vCont;c:%x". Also, we don't really need to use %08 when multi-process
is in effect. There should be no multi-process stubs around that depend
on leading 0's.
I guess this means we get to add a new parameter to write_ptid
(leading_zeros ?), and pass 1 where needed... Give me a sec to cook
something up.
--
Pedro Alves
next prev parent reply other threads:[~2008-10-22 13:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-22 1:07 Michael Snyder
2008-10-22 1:10 ` Michael Snyder
2008-10-22 1:14 ` Pedro Alves
2008-10-22 2:53 ` Daniel Jacobowitz
2008-10-22 17:43 ` Michael Snyder
2008-10-22 13:19 ` Pedro Alves [this message]
2008-10-22 14:17 ` Pedro Alves
2008-10-22 18:10 ` Michael Snyder
2008-10-23 15:39 ` Pedro Alves
2008-10-23 19:56 ` Michael Snyder
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200810221418.22409.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=msnyder@vmware.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox