mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-23 03:29:47 +08:00
Correct logical error in NetBSD's read_memory and write_memory
In case of repeated ptrace PT_IO call and returning the value of transferred bytes equal to 0, do not return without setting xfered_len. gdb/ChangeLog: * nat/netbsd-nat.c (write_memory, read_memory): Update.
This commit is contained in:
@ -1,3 +1,7 @@
|
|||||||
|
2020-10-07 Kamil Rytarowski <n54@gmx.com>
|
||||||
|
|
||||||
|
* nat/netbsd-nat.c (write_memory, read_memory): Update.
|
||||||
|
|
||||||
2020-10-07 Kamil Rytarowski <n54@gmx.com>
|
2020-10-07 Kamil Rytarowski <n54@gmx.com>
|
||||||
|
|
||||||
* nat/netbsd-nat.c (write_memory, read_memory): Add.
|
* nat/netbsd-nat.c (write_memory, read_memory): Add.
|
||||||
|
@ -238,7 +238,7 @@ write_memory (pid_t pid, unsigned const char *writebuf, CORE_ADDR offset,
|
|||||||
return errno;
|
return errno;
|
||||||
}
|
}
|
||||||
if (io.piod_len == 0)
|
if (io.piod_len == 0)
|
||||||
return 0;
|
break;
|
||||||
|
|
||||||
bytes_written += io.piod_len;
|
bytes_written += io.piod_len;
|
||||||
io.piod_len = len - bytes_written;
|
io.piod_len = len - bytes_written;
|
||||||
@ -276,7 +276,7 @@ read_memory (pid_t pid, unsigned char *readbuf, CORE_ADDR offset,
|
|||||||
if (rv == -1)
|
if (rv == -1)
|
||||||
return errno;
|
return errno;
|
||||||
if (io.piod_len == 0)
|
if (io.piod_len == 0)
|
||||||
return 0;
|
break;
|
||||||
|
|
||||||
bytes_read += io.piod_len;
|
bytes_read += io.piod_len;
|
||||||
io.piod_len = len - bytes_read;
|
io.piod_len = len - bytes_read;
|
||||||
|
Reference in New Issue
Block a user