Remote protocol question: the documentation says '?' is not required, but maybe it is?

Christo Crause
Tue Jul 21 16:35:57 GMT 2020

On Tue, Jul 21, 2020 at 1:34 PM Maciej W. Rozycki <> wrote:

> On Tue, 21 Jul 2020, Reuben Thomas via Gdb wrote:
> > Also, whether or not I send T does not affect GDB's behaviour. In fact, I
> > shortened my code by changing it to send an S packet instead, which also
> > works fine, but still GDB needs me to implement '?'. The "invalid remote
> > reply" is in response to the stub sending an empty reply to "?".
>  FYI, I do believe `?' is indeed mandatory, as GDB needs to figure out the
> initial state of the remote target as it has connected to it, and there is
> no other way.  Documentation may be incomplete/incorrect here, and fallout
> from the lack of response (a protocol violation) might be better.
>   Maciej

I've tested this (empty reply for the ? packet) in gdb 8.3 and it also
results in gdb hanging, in agreement with Reuben's observations.  I
therefore think Maciej is correct, the ? packet is required and should be
marked as mandatory.

More information about the Gdb mailing list