diff options
Diffstat (limited to 'gdb/windows-nat.c')
-rw-r--r-- | gdb/windows-nat.c | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index 3ce564a..9212adf 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -2413,9 +2413,9 @@ windows_stop (ptid_t ptid) /* Helper for windows_xfer_partial that handles memory transfers. Arguments are like target_xfer_partial. */ -static LONGEST +static enum target_xfer_status windows_xfer_memory (gdb_byte *readbuf, const gdb_byte *writebuf, - ULONGEST memaddr, ULONGEST len) + ULONGEST memaddr, ULONGEST len, ULONGEST *xfered_len) { SIZE_T done = 0; BOOL success; @@ -2443,10 +2443,11 @@ windows_xfer_memory (gdb_byte *readbuf, const gdb_byte *writebuf, if (!success) lasterror = GetLastError (); } + *xfered_len = (ULONGEST) done; if (!success && lasterror == ERROR_PARTIAL_COPY && done > 0) - return done; + return TARGET_XFER_OK; else - return success ? done : TARGET_XFER_E_IO; + return success ? TARGET_XFER_OK : TARGET_XFER_E_IO; } static void @@ -2502,11 +2503,12 @@ windows_pid_to_str (struct target_ops *ops, ptid_t ptid) return normal_pid_to_str (ptid); } -static LONGEST +static enum target_xfer_status windows_xfer_shared_libraries (struct target_ops *ops, - enum target_object object, const char *annex, - gdb_byte *readbuf, const gdb_byte *writebuf, - ULONGEST offset, ULONGEST len) + enum target_object object, const char *annex, + gdb_byte *readbuf, const gdb_byte *writebuf, + ULONGEST offset, ULONGEST len, + ULONGEST *xfered_len) { struct obstack obstack; const char *buf; @@ -2536,27 +2538,30 @@ windows_xfer_shared_libraries (struct target_ops *ops, } obstack_free (&obstack, NULL); - return len; + *xfered_len = (ULONGEST) len; + return TARGET_XFER_OK; } -static LONGEST +static enum target_xfer_status windows_xfer_partial (struct target_ops *ops, enum target_object object, - const char *annex, gdb_byte *readbuf, - const gdb_byte *writebuf, ULONGEST offset, ULONGEST len) + const char *annex, gdb_byte *readbuf, + const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, + ULONGEST *xfered_len) { switch (object) { case TARGET_OBJECT_MEMORY: - return windows_xfer_memory (readbuf, writebuf, offset, len); + return windows_xfer_memory (readbuf, writebuf, offset, len, xfered_len); case TARGET_OBJECT_LIBRARIES: return windows_xfer_shared_libraries (ops, object, annex, readbuf, - writebuf, offset, len); + writebuf, offset, len, xfered_len); default: if (ops->beneath != NULL) return ops->beneath->to_xfer_partial (ops->beneath, object, annex, - readbuf, writebuf, offset, len); + readbuf, writebuf, offset, len, + xfered_len); return TARGET_XFER_E_IO; } } |