+2017-11-14 Paul Carroll <pcarroll@codesourcery.com>
+
+ PR gdb/22388
+ * remote.c (remote_write_bytes_aux, remote_read_bytes_1,
+ remote_read_bytes, remote_write_qxfer, remote_xfer_partial):
+ Return TARGET_XFER_EOF if size of returned data is 0.
+
2017-11-14 Simon Marchi <simon.marchi@ericsson.com>
* Makefile.in (SUBDIR_UNITTESTS_SRCS): Add
/* Return UNITS_WRITTEN, not TODO_UNITS, in case escape chars caused us to
send fewer units than we'd planned. */
*xfered_len_units = (ULONGEST) units_written;
- return TARGET_XFER_OK;
+ return (*xfered_len_units != 0) ? TARGET_XFER_OK : TARGET_XFER_EOF;
}
/* Write memory data directly to the remote machine.
decoded_bytes = hex2bin (p, myaddr, todo_units * unit_size);
/* Return what we have. Let higher layers handle partial reads. */
*xfered_len_units = (ULONGEST) (decoded_bytes / unit_size);
- return TARGET_XFER_OK;
+ return (*xfered_len_units != 0) ? TARGET_XFER_OK : TARGET_XFER_EOF;
}
/* Using the set of read-only target sections of remote, read live
/* No use trying further, we know some memory starting
at MEMADDR isn't available. */
*xfered_len = len;
- return TARGET_XFER_UNAVAILABLE;
+ return (*xfered_len != 0) ?
+ TARGET_XFER_UNAVAILABLE : TARGET_XFER_EOF;
}
}
unpack_varlen_hex (rs->buf, &n);
*xfered_len = n;
- return TARGET_XFER_OK;
+ return (*xfered_len != 0) ? TARGET_XFER_OK : TARGET_XFER_EOF;
}
/* Read OBJECT_NAME/ANNEX from the remote target using a qXfer packet.
strcpy ((char *) readbuf, rs->buf);
*xfered_len = strlen ((char *) readbuf);
- return TARGET_XFER_OK;
+ return (*xfered_len != 0) ? TARGET_XFER_OK : TARGET_XFER_EOF;
}
/* Implementation of to_get_memory_xfer_limit. */