Re: [RFA] Small improvements to the remote protocol manual

Pedro Alves
2016-12-02T11:59:23Z

Took me this long to get to reading this email...

On 09/14/2016 03:18 AM, Tom Tromey wrote:

> @@ -36047,10 +36053,11 @@ also the @samp{w} (@ref{thread exit event}) remote reply below.
> The process exited, and @var{AA} is the exit status. This is only
> applicable to certain targets.
>
> -The second form of the response, including the process ID of the exited
> -process, can be used only when @value{GDBN} has reported support for
> -multiprocess protocol extensions; see @ref{multiprocess extensions}.
> -The @var{pid} is formatted as a big-endian hex string.
> +The second form of the response, including the process ID of the
> +exited process, can be used only when @value{GDBN} has reported
> +support for multiprocess protocol extensions; see @ref{multiprocess
> +extensions}. Both @var{AA} and @var{pid} are formatted as big-endian
> +hex strings.

For the record, note that:

- the format of @var{AA} used to be exactly two hex chars:

/* GDB used to accept only 2 hex chars here. Stubs should
only send more if they detect GDB supports multi-process
support. */
p = unpack_varlen_hex (&buf[1], &value);

- The RSP overview states that "Except where otherwise noted all numbers
are represented in hex with leading zeros suppressed."

I've pondered before about removing all the explicit mentions of hex
encoding, in order to make the exceptions stand out. My idea would be
that if packets don't mention the formatting of numbers, then people
will naturally look for that in general packet formatting description.

But in the current state of the manual, it certainly doesn't hurt to
be explicit.

Thanks for the fixes.

Thanks,
Pedro Alves