Add target_ops argument to to_fileio_pread
authorTom Tromey <tromey@redhat.com>
Wed, 18 Dec 2013 04:38:46 +0000 (21:38 -0700)
committerTom Tromey <tromey@redhat.com>
Wed, 19 Feb 2014 14:46:12 +0000 (07:46 -0700)
2014-02-19  Tom Tromey  <tromey@redhat.com>

* target.h (struct target_ops) <to_fileio_pread>: Add argument.
* target.c (target_fileio_pread): Add argument.
* remote.c (remote_hostio_pread): Add 'self' argument.
(remote_bfd_iovec_pread, remote_file_get): Update.
* inf-child.c (inf_child_fileio_pread): Add 'self' argument.

gdb/ChangeLog
gdb/inf-child.c
gdb/remote.c
gdb/target.c
gdb/target.h

index c041549d53bf4179eb3001f43c7570089d71dd3d..aa018e8a0ca882759ebd8e662cd5d1f09fba4bf9 100644 (file)
@@ -1,3 +1,11 @@
+2014-02-19  Tom Tromey  <tromey@redhat.com>
+
+       * target.h (struct target_ops) <to_fileio_pread>: Add argument.
+       * target.c (target_fileio_pread): Add argument.
+       * remote.c (remote_hostio_pread): Add 'self' argument.
+       (remote_bfd_iovec_pread, remote_file_get): Update.
+       * inf-child.c (inf_child_fileio_pread): Add 'self' argument.
+
 2014-02-19  Tom Tromey  <tromey@redhat.com>
 
        * target.h (struct target_ops) <to_fileio_pwrite>: Add argument.
index 6486b2c77f8ef582f05df6c18d53bef7c96e51d6..8837fd8c331d2360de6747d0055096b8587c03cc 100644 (file)
@@ -286,7 +286,8 @@ inf_child_fileio_pwrite (struct target_ops *self,
    Return the number of bytes read, or -1 if an error occurs
    (and set *TARGET_ERRNO).  */
 static int
-inf_child_fileio_pread (int fd, gdb_byte *read_buf, int len,
+inf_child_fileio_pread (struct target_ops *self,
+                       int fd, gdb_byte *read_buf, int len,
                        ULONGEST offset, int *target_errno)
 {
   int ret;
index ae8c5236085eff03eb3625b07be07f3ee83b2ac7..814f945f8c1d54f15b62e5e4c7dd03a77e19f97c 100644 (file)
@@ -9712,7 +9712,8 @@ remote_hostio_pwrite (struct target_ops *self,
    set *REMOTE_ERRNO).  */
 
 static int
-remote_hostio_pread (int fd, gdb_byte *read_buf, int len,
+remote_hostio_pread (struct target_ops *self,
+                    int fd, gdb_byte *read_buf, int len,
                     ULONGEST offset, int *remote_errno)
 {
   struct remote_state *rs = get_remote_state ();
@@ -9944,7 +9945,8 @@ remote_bfd_iovec_pread (struct bfd *abfd, void *stream, void *buf,
   pos = 0;
   while (nbytes > pos)
     {
-      bytes = remote_hostio_pread (fd, (gdb_byte *) buf + pos, nbytes - pos,
+      bytes = remote_hostio_pread (find_target_at (process_stratum),
+                                  fd, (gdb_byte *) buf + pos, nbytes - pos,
                                   offset + pos, &remote_errno);
       if (bytes == 0)
         /* Success, but no bytes, means end-of-file.  */
@@ -10117,7 +10119,8 @@ remote_file_get (const char *remote_file, const char *local_file, int from_tty)
   offset = 0;
   while (1)
     {
-      bytes = remote_hostio_pread (fd, buffer, io_size, offset, &remote_errno);
+      bytes = remote_hostio_pread (find_target_at (process_stratum),
+                                  fd, buffer, io_size, offset, &remote_errno);
       if (bytes == 0)
        /* Success, but no bytes, means end-of-file.  */
        break;
index ace183387bc333a606b97b53369ff68f380629d1..00083c22a0d0f7619eb5e90f05b105ecb61f7bd7 100644 (file)
@@ -3430,7 +3430,7 @@ target_fileio_pread (int fd, gdb_byte *read_buf, int len,
     {
       if (t->to_fileio_pread != NULL)
        {
-         int ret = t->to_fileio_pread (fd, read_buf, len, offset,
+         int ret = t->to_fileio_pread (t, fd, read_buf, len, offset,
                                        target_errno);
 
          if (targetdebug)
index 02b66d7ee671348444c285cddb5707b8987fcb4b..eb83cb95cd6d9dfca43a2e74f129fce87b8dfc39 100644 (file)
@@ -730,7 +730,8 @@ struct target_ops
     /* Read up to LEN bytes FD on the target into READ_BUF.
        Return the number of bytes read, or -1 if an error occurs
        (and set *TARGET_ERRNO).  */
-    int (*to_fileio_pread) (int fd, gdb_byte *read_buf, int len,
+    int (*to_fileio_pread) (struct target_ops *,
+                           int fd, gdb_byte *read_buf, int len,
                            ULONGEST offset, int *target_errno);
 
     /* Close FD on the target.  Return 0, or -1 if an error occurs
This page took 0.111826 seconds and 4 git commands to generate.