gdb ignoring vCont supported commands

Pedro Alves
Tue Oct 9 18:30:00 GMT 2018

On 10/09/2018 02:42 PM, Bill Morgan wrote:
> I tell gdb that I support only vCont c and C, so it sends me s. Why is it
> sending s when I don't support that?
> (gdb) s
> Sending packet:
> $QPassSignals:e;10;14;17;1a;1b;1c;21;24;25;2c;4c;97;#0a...Ack
> Packet received: OK
> Sending packet: $vCont?#49...Ack
> Packet received: vCont;c;C
> Packet vCont (verbose-resume) is supported
> Sending packet: $vCont;s:13;c#f4...Ack
> Packet received: E01
> warning: Remote failure reply: E01

That's historical behavior, and GDB cannot change it, unfortunately.
But the good news is that in more recent GDBs there is a protocol
extension to tell GDB to trust the set of reported supported
vCont actions.

Copying what I said here:

GDB can't trust "vCont;c;C" alone, because for a long
while GDBserver would send "vCont;c;s;C;S" even if the target
did not support hardware stepping.  So what a stub needs to do

Return "vCont;c;C" to "vCont?" _AND_ include "vContSupported"
in the reported "qSupported" features.  The latter tells GDB
to trust that the actions included in "vCont?" are really the
supported ones.  (I wish we had implemented this a little bit
differently, but that ship has sailed, and although a bit
cumbersome, it works.)

Pedro Alves

More information about the Gdb mailing list