mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-27 14:39:09 +08:00
* windows-nat.c (windows_xfer_memory): Handle ERROR_PARTIAL_COPY
error code.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2013-09-02 Pierre Muller <muller@sourceware.org>
|
||||||
|
|
||||||
|
* windows-nat.c (windows_xfer_memory): Handle ERROR_PARTIAL_COPY
|
||||||
|
error code.
|
||||||
|
|
||||||
2013-09-02 Pierre Muller <muller@sourceware.org>
|
2013-09-02 Pierre Muller <muller@sourceware.org>
|
||||||
|
|
||||||
* windows-nat.c (windows_xfer_memory): Fix compilation failure
|
* windows-nat.c (windows_xfer_memory): Fix compilation failure
|
||||||
|
@ -2324,6 +2324,7 @@ windows_xfer_memory (gdb_byte *readbuf, const gdb_byte *writebuf,
|
|||||||
{
|
{
|
||||||
SIZE_T done = 0;
|
SIZE_T done = 0;
|
||||||
BOOL success;
|
BOOL success;
|
||||||
|
DWORD lasterror = 0;
|
||||||
|
|
||||||
if (writebuf != NULL)
|
if (writebuf != NULL)
|
||||||
{
|
{
|
||||||
@ -2332,6 +2333,8 @@ windows_xfer_memory (gdb_byte *readbuf, const gdb_byte *writebuf,
|
|||||||
success = WriteProcessMemory (current_process_handle,
|
success = WriteProcessMemory (current_process_handle,
|
||||||
(LPVOID) (uintptr_t) memaddr, writebuf,
|
(LPVOID) (uintptr_t) memaddr, writebuf,
|
||||||
len, &done);
|
len, &done);
|
||||||
|
if (!success)
|
||||||
|
lasterror = GetLastError ();
|
||||||
FlushInstructionCache (current_process_handle,
|
FlushInstructionCache (current_process_handle,
|
||||||
(LPCVOID) (uintptr_t) memaddr, len);
|
(LPCVOID) (uintptr_t) memaddr, len);
|
||||||
}
|
}
|
||||||
@ -2342,7 +2345,12 @@ windows_xfer_memory (gdb_byte *readbuf, const gdb_byte *writebuf,
|
|||||||
success = ReadProcessMemory (current_process_handle,
|
success = ReadProcessMemory (current_process_handle,
|
||||||
(LPCVOID) (uintptr_t) memaddr, readbuf,
|
(LPCVOID) (uintptr_t) memaddr, readbuf,
|
||||||
len, &done);
|
len, &done);
|
||||||
|
if (!success)
|
||||||
|
lasterror = GetLastError ();
|
||||||
}
|
}
|
||||||
|
if (!success && lasterror == ERROR_PARTIAL_COPY && done > 0)
|
||||||
|
return done;
|
||||||
|
else
|
||||||
return success ? done : TARGET_XFER_E_IO;
|
return success ? done : TARGET_XFER_E_IO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user