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

Reuben Thomas rrt@sc3d.org
Tue Jul 21 20:26:30 GMT 2020


On Tue, 21 Jul 2020 at 21:24, Reuben Thomas <rrt@sc3d.org> wrote:

> On Tue, 21 Jul 2020 at 20:34, Maciej W. Rozycki <macro@wdc.com> wrote:
>
>> On Tue, 21 Jul 2020, Reuben Thomas wrote:
>>
>> > >  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.
>> >
>> > It seems to be more complicated than that. In principle, '?' isn't
>> needed
>> > in principle to figure out the initial state: the T packet, or in my
>> > current case, the S packet tells GDB the signal, and yet GDB still asks
>> for
>> > it again with '?'. The signal that caused the remote to halt is not
>> going
>> > to change until the next 'c', so there's no need for GDB to ask for it
>> > again; and yet it does.
>>
>
As I mentioned earlier, gdb discards this first 'T' packet, so that
explains why it needs to send '?', even in principle. But that doesn't seem
to be relevant, as gdb always sends '?' at the start of a conversation.


More information about the Gdb mailing list