Correct logical error in NetBSD's read_memory and write_memory
authorKamil Rytarowski <n54@gmx.com>
Wed, 7 Oct 2020 13:12:59 +0000 (15:12 +0200)
committerKamil Rytarowski <n54@gmx.com>
Wed, 7 Oct 2020 13:15:54 +0000 (15:15 +0200)
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.

gdb/ChangeLog
gdb/nat/netbsd-nat.c

index 4dc729c69bc099c202386c946aa3eaeb06651b8b..300bf139b7ff735cd9b368eeb7a1ac162c8cf030 100644 (file)
@@ -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>
 
        * nat/netbsd-nat.c (write_memory, read_memory): Add.
index cae9cc2fc2c550c507a66b37fdfde6ee57372716..e0b61cd4b2493e03764aaff3f48d020887ea534e 100644 (file)
@@ -238,7 +238,7 @@ write_memory (pid_t pid, unsigned const char *writebuf, CORE_ADDR offset,
              return errno;
            }
          if (io.piod_len == 0)
-           return 0;
+           break;
 
          bytes_written += io.piod_len;
          io.piod_len = len - bytes_written;
@@ -276,7 +276,7 @@ read_memory (pid_t pid, unsigned char *readbuf, CORE_ADDR offset,
          if (rv == -1)
            return errno;
          if (io.piod_len == 0)
-           return 0;
+           break;
 
          bytes_read += io.piod_len;
          io.piod_len = len - bytes_read;