From: Tom Tromey <tom@tromey.com>
To: Andrew Burgess <aburgess@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 2/3] gdbserver: add support for p/P packets and flag to disable g/G packets
Date: Mon, 09 Nov 2026 10:16:53 -0700 [thread overview]
Message-ID: <87a4nhvsai.fsf@tromey.com> (raw)
In-Reply-To: <56997cef31b53dbd71d0a1cfa5d163aee6e9f422.1794238395.git.aburgess@redhat.com> (Andrew Burgess's message of "Mon, 9 Nov 2026 15:35:51 +0000")
>>>>> "Andrew" == Andrew Burgess <aburgess@redhat.com> writes:
Andrew> I understand that gdbserver is a real tool, so we should not be
Andrew> overloading it with "testing" features, but supporting the 'p' and 'P'
Andrew> packets doesn't cost that much, and this would allow for greater
Andrew> testing of GDB.
I'm actually more supportive of this approach in general. While
gdbserver is a real tool, I think it's also important for testing that
gdb conforms to the protocol as documented. Features like this play a
role there.
So I think this kind of change is a positive on the whole, and the
biggest issue is to make sure that the defaults are good.
I suppose maybe if there was a very invasive proposal along these lines,
we would want to have a discussion. But I don't really anticipate it.
Andrew> Annoyingly there was one fix needed in GDB itself. The 'g' packet
Andrew> handling in remote_target::send_g_packet (gdb/remote.c) has a rather
Andrew> nasty loop which tries to "resync" with gdbserver by resending the 'g'
Andrew> packet if the response doesn't look right.
I thought I had seen a bug report about this but all I could readily
find is:
https://sourceware.org/bugzilla/show_bug.cgi?id=8318
which is like tangentially related but not really on point.
The docs do say that g/G are required, so maybe it just really hasn't
come up.
Maybe supporting p/P is an optimization and these actually should be
enabled by default? To be clear I don't think that has to be decided in
this series.
Andrew> And compare the results to those of running without the disable-packet
Andrew> option. The only issues I saw were in trace related tests, the
Andrew> function remote_target::get_trace_status relies on sizeof_g_packet to
Andrew> define the trace register block. For a target without 'g' packet
Andrew> support the sizeof_g_packet becomes 0, which means the trace file
Andrew> records a register block size of 0, which breaks all the trace related
Andrew> tests. This is a pre-existing issue, and not something I plan to
Andrew> address in this commit.
I'm not sure how much we care about this but perhaps it's worth a
follow-up bug report. My sense is that tracing isn't really used but of
course it's hard to know for sure.
I'd be comfortable saying that a server that supports tracing also has
to support the g packet.
Andrew> +bool disable_packet_gG;
I think this one can be static.
Anyway this looks good to me. Thank you.
Approved-By: Tom Tromey <tom@tromey.com>
Tom
next prev parent reply other threads:[~2026-11-09 17:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-09 15:35 [PATCH 0/3] gdb/remote: improve packet buffer checks for p packet Andrew Burgess
2026-11-09 15:35 ` [PATCH 1/3] gdbsupport: update comment on hex2bin Andrew Burgess
2026-11-09 16:49 ` Tom Tromey
2026-11-09 15:35 ` [PATCH 2/3] gdbserver: add support for p/P packets and flag to disable g/G packets Andrew Burgess
2026-11-09 17:16 ` Tom Tromey [this message]
2026-11-09 15:35 ` [PATCH 3/3] gdb/remote: improve error checking for 'p' packet reply Andrew Burgess
2026-11-09 17:27 ` Tom Tromey
2026-11-23 16:44 ` Andrew Burgess
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=87a4nhvsai.fsf@tromey.com \
--to=tom@tromey.com \
--cc=aburgess@redhat.com \
--cc=gdb-patches@sourceware.org \
/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