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.
* target.c (target_fileio_pwrite): Add argument.
* remote.c (remote_hostio_pwrite): Add 'self' argument.
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;
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 ();
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. */
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;
{
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)
/* 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