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

Thiago Jung Bauermann via Gdb-patches
2023-01-30T14:06:11Z

Hello Eli,

Eli Zaretskii <eliz@gnu.org> writes:

>> 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.

Thank you for the quick review!

>> +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.

Ah, nice to know that I can nest tags like that. Thank you for the
explanation as well.

> The documentation part is OK with these problems fixed.

Fixed locally.

--
Thiago