+2014-02-24 Yao Qi <yao@codesourcery.com>
+
+ * target.h (TARGET_XFER_STATUS_ERROR_P): Remove.
+ * corefile.c (read_memory): Adjusted.
+ * target.c (target_write_with_progress): Adjusted.
+
2014-02-23 Yao Qi <yao@codesourcery.com>
Revert two patches:
memaddr + xfered, len - xfered,
&xfered_len);
- if (status == TARGET_XFER_EOF)
- memory_error (TARGET_XFER_E_IO, memaddr + xfered);
+ if (status != TARGET_XFER_OK)
+ memory_error (status == TARGET_XFER_EOF ? TARGET_XFER_E_IO : status,
+ memaddr + xfered);
- if (TARGET_XFER_STATUS_ERROR_P (status))
- memory_error (status, memaddr + xfered);
-
- gdb_assert (status == TARGET_XFER_OK);
xfered += xfered_len;
QUIT;
}
offset + xfered, len - xfered,
&xfered_len);
- if (status == TARGET_XFER_EOF)
- return xfered;
- if (TARGET_XFER_STATUS_ERROR_P (status))
- return -1;
+ if (status != TARGET_XFER_OK)
+ return status == TARGET_XFER_EOF ? xfered : -1;
- gdb_assert (status == TARGET_XFER_OK);
if (progress)
(*progress) (xfered_len, baton);
/* Keep list in sync with target_xfer_error_to_string. */
};
-#define TARGET_XFER_STATUS_ERROR_P(STATUS) ((STATUS) < TARGET_XFER_EOF)
-
/* Return the string form of ERR. */
extern const char *target_xfer_status_to_string (enum target_xfer_status err);