Re: [PATCH v3 5/8] gdbserver: Transmit target description ID in thread list and stop reply

Eli Zaretskii via Gdb-patches
2023-01-30T12:52:35Z

> Cc: Thiago Jung Bauermann <thiago.bauermann@linaro.org>,
> Simon Marchi <simon.marchi@efficios.com>
> Date: Mon, 30 Jan 2023 04:45:15 +0000
> From: Thiago Jung Bauermann via Gdb-patches <gdb-patches@sourceware.org>
>
> Now that an inferior thread can have a different target description than
> its process, there needs to be a way to communicate this target
> description to GDB. So add the concept of a target description ID to the
> remote protocol, which is used to reference them and allows them to be
> transferred only once over the wire.
>
> The ID is an unsigned integer, and is sent in the 'T AA n1:r1;n2:r2;...'
> stop reply packet as a new 'n:r' pair, where n is "tdesc" and "r" is an
> unsigned integer containing the ID.
>
> It is also sent in the threads list XML in the response of a
> qXfer:threads:read request. The ID is sent as a new "tdesc" attribute of
> the <thread> node.
>
> To request the target description XML of a given ID, GDB sends the
> qXfer:features:read request with "target-id-%u.xml" as the annex, where %u
> is the target description ID.
>
> Suggested-By: Simon Marchi <simon.marchi@efficios.com>
> ---
> gdb/doc/gdb.texinfo | 27 ++++++++++++++++---
> gdbserver/remote-utils.cc | 57 +++++++++++++++++++++++++++++++++++++++
> gdbserver/remote-utils.h | 9 +++++++
> gdbserver/server.cc | 17 ++++++++++--
> gdbserver/server.h | 4 +++
> 5 files changed, 109 insertions(+), 5 deletions(-)

Thanks.

> +If target description IDs are being used (@pxref{Target Description ID}),
> +@value{GDBN} can retrieve a target description with a given ID by using
> +@samp{target-id-ID.xml} as the @var{annex}, where @var{ID} is the
^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^
@file{target-id-@var{id}.xml} @var{id}

The arguments of @var should be in lower-case, as that looks better in
the printed and HTML versions of the manual.

The documentation part is OK with these problems fixed.