Re: [PATCH] gdb/remote: Don't use vKill if multi-process features are disabled

Pedro Alves
2016-03-17T22:21:13Z

On 03/17/2016 10:02 PM, Andrew Burgess wrote:
> The below was tested using native gdbserver on x86-64 Fedora Linux
> with no regressions.
>
> ---
>
> The gdb remote protocol documentation is clear that the vKill command
> should not be used unless the multi-process feature is reported as
> supported by the remote target.
>
> Currently within gdb we check to see if the vKill packet is enabled or
> not before using the vKill command, however, the only way to disable
> vKill is from the gdb console, the result is that vKill will be sent to
> targets that don't support it, and never claimed to support it.

Why was that a problem?

>
> After this commit I guard use of vKill with a check to see if the
> multi-process feature is enabled or not. I have removed the ability to
> disable vkill specifically from the console, the user must now disable
> the whole multi-process feature set as one.
>
> I did consider leaving the separate vKill control switch in addition to
> the multi-process control switch, but this seemed unnecessary, and I
> worried that in the future another bug could be introduced where
> PACKET_vKill was used to guard sending a vKill.

Please leave the control switch in. It's useful for testing, to emulate
targets that don't support the packet.

Thanks,
Pedro Alves