This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patchv2 2/2] Workaround gdbserver<7.7 for setfs
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: gdb-patches at sourceware dot org, Gary Benson <gbenson at redhat dot com>
- Date: Thu, 24 Mar 2016 23:32:41 +0100
- Subject: [patchv2 2/2] Workaround gdbserver<7.7 for setfs
- Authentication-results: sourceware.org; auth=none
- References: <20160319201842 dot GA16540 at host1 dot jankratochvil dot net> <56F13963 dot 9040204 at redhat dot com> <20160322131604 dot GA24312 at host1 dot jankratochvil dot net> <56F14F1E dot 5010606 at redhat dot com> <20160323211547 dot GA17400 at host1 dot jankratochvil dot net> <20160324220933 dot GA27445 at host1 dot jankratochvil dot net>
There was a bug in patchv1.
gdb/ChangeLog
2016-03-24 Jan Kratochvil <jan.kratochvil@redhat.com>
* remote.c (packet_ok): Add workaround for PACKET_vFile_setfs.
diff --git a/gdb/remote.c b/gdb/remote.c
index bb027cf..f80fee8 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -1453,7 +1453,15 @@ packet_ok (const char *buf, struct packet_config *config)
internal_error (__FILE__, __LINE__,
_("packet_ok: attempt to use a disabled packet"));
- result = packet_check_result (buf);
+ if (config == &remote_protocol_packets[PACKET_vFile_setfs]
+ && strcmp (buf, "OK") == 0)
+ {
+ /* Workaround gdbserver < 7.7 before its fix from 2013-12-11. */
+ result = PACKET_UNKNOWN;
+ }
+ else
+ result = packet_check_result (buf);
+
switch (result)
{
case PACKET_OK: