This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit] Handle remote protocol continue errors better
- From: Daniel Jacobowitz <drow at false dot org>
- To: gdb-patches at sourceware dot org
- Date: Wed, 27 Feb 2008 16:01:34 -0500
- Subject: [commit] Handle remote protocol continue errors better
This is part of a patch that I posted to gdb@ in response to a bug
report last year, and then forgot about. The rest of the patch
was committed as part of my target extended-remote work. It's
self-explanatory.
--
Daniel Jacobowitz
CodeSourcery
2008-02-27 Daniel Jacobowitz <dan@codesourcery.com>
* remote.c (remote_wait, remote_async_wait): Stop if we receive
an error.
Index: remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.280
diff -u -p -r1.280 remote.c
--- remote.c 25 Feb 2008 09:59:06 -0000 1.280
+++ remote.c 27 Feb 2008 20:57:53 -0000
@@ -3403,8 +3403,12 @@ remote_wait (ptid_t ptid, struct target_
switch (buf[0])
{
case 'E': /* Error of some sort. */
+ /* We're out of sync with the target now. Did it continue or not?
+ Not is more likely, so report a stop. */
warning (_("Remote failure reply: %s"), buf);
- continue;
+ status->kind = TARGET_WAITKIND_STOPPED;
+ status->value.sig = TARGET_SIGNAL_0;
+ goto got_status;
case 'F': /* File-I/O request. */
remote_fileio_request (buf);
continue;
@@ -3631,8 +3635,12 @@ remote_async_wait (ptid_t ptid, struct t
switch (buf[0])
{
case 'E': /* Error of some sort. */
+ /* We're out of sync with the target now. Did it continue or not?
+ Not is more likely, so report a stop. */
warning (_("Remote failure reply: %s"), buf);
- continue;
+ status->kind = TARGET_WAITKIND_STOPPED;
+ status->value.sig = TARGET_SIGNAL_0;
+ goto got_status;
case 'F': /* File-I/O request. */
remote_fileio_request (buf);
continue;