Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Metzger, Markus T" <markus.t.metzger@intel.com>
To: Tom Tromey <tom@tromey.com>
Cc: Simon Marchi <simark@simark.ca>,
	Thiago Jung Bauermann <thiago.bauermann@linaro.org>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: RE: [PATCH 1/2] gdbserver, read_ptid: handle '0' and '-1' thread ids
Date: Wed, 24 Sep 2025 08:04:23 +0000	[thread overview]
Message-ID: <DM8PR11MB5749D2C9A1C75946278BABB5DE1CA@DM8PR11MB5749.namprd11.prod.outlook.com> (raw)
In-Reply-To: <87segdc9e9.fsf@tromey.com>

Hello Tom,

>> They are more different than it first appears.  The gdbserver side
>> accepts pN.-1, for example, while the gdb side doesn't.  The gdb side
>> doesn't accept -1 at all.
>
>> When the string does not start with 'p', both fall back to the
>> respective inferior on either side, but gdb has special handling for a
>> not-yet-known process id, whereas the gdbserver side doesn't.
>
>
>I haven't been following this super closely, but there's also a bugzilla
>bug in this area:
>
>https://sourceware.org/bugzilla/show_bug.cgi?id=25111

That seems to be caused by truncating a long ptid.tid to int before
writing it out.

In general, read_ptid() and write_ptid() don't seem to care about
types and conversions; read_ptid(), for example, reads everything
into ULONGEST and then constructs a ptid without checking for
overflows.

I could add a fix to this series, but, as with the other patches, this
would be solely based on reviewing the code without an actual bug
(I cannot test this zephyr target) nor a test.

Regards,
Markus.

Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Sean Fennelly, Jeffrey Schneiderman, Tiffany Doon Silva
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928


  reply	other threads:[~2025-09-24  8:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-05  7:19 Markus Metzger
2025-08-05  7:19 ` [PATCH 2/2] gdb, remote: fix set_thread () in start_remote () Markus Metzger
2025-08-14  4:29   ` Thiago Jung Bauermann
2025-08-14 22:28     ` Simon Marchi
2025-08-15  0:29       ` Thiago Jung Bauermann
2025-08-15  5:33         ` Simon Marchi
2025-08-18  1:43           ` Thiago Jung Bauermann
2025-09-22 13:29       ` Metzger, Markus T
2025-08-14  3:36 ` [PATCH 1/2] gdbserver, read_ptid: handle '0' and '-1' thread ids Thiago Jung Bauermann
2025-08-14 20:40   ` Simon Marchi
2025-09-22 13:29     ` Metzger, Markus T
2025-09-23 18:26       ` Tom Tromey
2025-09-24  8:04         ` Metzger, Markus T [this message]
2025-09-26  6:43           ` Metzger, Markus T

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=DM8PR11MB5749D2C9A1C75946278BABB5DE1CA@DM8PR11MB5749.namprd11.prod.outlook.com \
    --to=markus.t.metzger@intel.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simark@simark.ca \
    --cc=thiago.bauermann@linaro.org \
    --cc=tom@tromey.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