Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Tom Tromey <tromey@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Do not write negative PID or TID in remote protocol
Date: Fri, 12 Jun 2026 09:23:15 -0600	[thread overview]
Message-ID: <87v7bndbq4.fsf@tromey.com> (raw)
In-Reply-To: <20260430175904.1342455-1-tromey@adacore.com> (Tom Tromey's message of "Thu, 30 Apr 2026 11:59:04 -0600")

>>>>> "Tom" == Tom Tromey <tromey@adacore.com> writes:

Ping for this patch.

I guess at some point I'll just put it in.
Note below...

Tom> Currently both gdb and gdbserver can write a negative number for the
Tom> PID or TID.  However, the only negative value that really makes sense
Tom> is the special case of "-1" -- in other cases if the PID or TID has
Tom> the high bit set, it should still be written as a positive number.

Tom> This patch attempts to fix the bug.

Tom> v2 of this patch combines the implementations and moves them to
Tom> gdbsupport.  I tried making these standalone functions in rsp-low.cc,
Tom> but that runs afoul of libipa.  So, I made them methods of ptid_t.

Tom> The new unit tests pointed out that round-tripping a sign-extended
Tom> number didn't really work, because the checks were done via ULONGEST.
Tom> It's kind of unfortunate that the PID and LWP are host-dependent
Tom> types.  This should probably be fixed, but I haven't done so here.

Maybe this should be done.

Also at some point I should update the RSP docs, though the exact update
depends on the outcome of whether or not we decide to widen the types.

Tom

  reply	other threads:[~2026-06-12 15:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-30 17:59 Tom Tromey
2026-06-12 15:23 ` Tom Tromey [this message]
2026-07-01 17:47   ` Tom Tromey
2026-07-02 10:18 ` Mark Wielaard
2026-07-02 18:29   ` Tom Tromey
  -- strict thread matches above, loose matches on Subject: below --
2026-03-11 20:21 Tom Tromey
2026-03-12 19:42 ` Kevin Buettner
2026-04-30 17:33   ` Tom Tromey

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=87v7bndbq4.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@adacore.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