This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patchv4] Workaround gdbserver<7.7 for setfs


On 04/06/2016 02:49 PM, Jan Kratochvil wrote:

>> > Try qMustReplyEmpty or something like that instead.
> With these requirements on this workaround I have followed the gdbserver-7.6
> sources and the bug was in function handle_notif_ack which is called only from
> handle_v_requests, therefore for any packets /^v/.

Ah.

> OK to check in this one?

OK with a change.

> diff --git a/gdb/remote.c b/gdb/remote.c
> index 5c407b6..a88f4cd 100644
> --- a/gdb/remote.c
> +++ b/gdb/remote.c
> @@ -1496,6 +1496,15 @@ enum {
>  
>  static struct packet_config remote_protocol_packets[PACKET_MAX];
>  
> +/* gdbserver < 7.7 (before its fix from 2013-12-11) did reply to any
> +   unknown 'v' packet with string "OK".  "OK" gets interpreted by GDB
> +   as a reply to known packet.  For packet "vFile:setfs:" it is an
> +   invalid reply and GDB would return error in
> +   remote_hostio_set_filesystem, making remote files access impossible.
> +   If this variable is non-zero it means the remote gdbserver is buggy
> +   and any not yet detected packets are assumed as unsupported.  */
> +static int unknown_v_replies_ok;

This comment looks great now, thanks.  It helps the reader understand
exactly what is being worked around, and it'll help us decide what to
do in the future if this ever gets in the way.

Please make this new variable a field of 'struct remote_state' instead
of a global.

OK with that change.

Thanks,
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]