mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-21 02:24:17 +08:00
* win32-low.c (child_xfer_memory): Check if ReadProcessMemory
or WriteProcessMemory complete successfully and handle ERROR_PARTIAL_COPY error.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2013-09-02 Pierre Muller <muller@sourceware.org>
|
||||||
|
|
||||||
|
* win32-low.c (child_xfer_memory): Check if ReadProcessMemory
|
||||||
|
or WriteProcessMemory complete successfully and handle
|
||||||
|
ERROR_PARTIAL_COPY error.
|
||||||
|
|
||||||
2013-09-02 Pedro Alves <palves@redhat.com>
|
2013-09-02 Pedro Alves <palves@redhat.com>
|
||||||
|
|
||||||
* server.c (gdb_read_memory): Return -1 on traceframe memory read
|
* server.c (gdb_read_memory): Return -1 on traceframe memory read
|
||||||
|
@ -278,21 +278,30 @@ static int
|
|||||||
child_xfer_memory (CORE_ADDR memaddr, char *our, int len,
|
child_xfer_memory (CORE_ADDR memaddr, char *our, int len,
|
||||||
int write, struct target_ops *target)
|
int write, struct target_ops *target)
|
||||||
{
|
{
|
||||||
SIZE_T done;
|
BOOL success;
|
||||||
|
SIZE_T done = 0;
|
||||||
|
DWORD lasterror = 0;
|
||||||
uintptr_t addr = (uintptr_t) memaddr;
|
uintptr_t addr = (uintptr_t) memaddr;
|
||||||
|
|
||||||
if (write)
|
if (write)
|
||||||
{
|
{
|
||||||
WriteProcessMemory (current_process_handle, (LPVOID) addr,
|
success = WriteProcessMemory (current_process_handle, (LPVOID) addr,
|
||||||
(LPCVOID) our, len, &done);
|
(LPCVOID) our, len, &done);
|
||||||
|
if (!success)
|
||||||
|
lasterror = GetLastError ();
|
||||||
FlushInstructionCache (current_process_handle, (LPCVOID) addr, len);
|
FlushInstructionCache (current_process_handle, (LPCVOID) addr, len);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ReadProcessMemory (current_process_handle, (LPCVOID) addr, (LPVOID) our,
|
success = ReadProcessMemory (current_process_handle, (LPCVOID) addr,
|
||||||
len, &done);
|
(LPVOID) our, len, &done);
|
||||||
|
if (!success)
|
||||||
|
lasterror = GetLastError ();
|
||||||
}
|
}
|
||||||
|
if (!success && lasterror == ERROR_PARTIAL_COPY && done > 0)
|
||||||
return done;
|
return done;
|
||||||
|
else
|
||||||
|
return success ? done : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Clear out any old thread list and reinitialize it to a pristine
|
/* Clear out any old thread list and reinitialize it to a pristine
|
||||||
|
Reference in New Issue
Block a user