mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-01-24 12:35:55 +08:00
Add target_ops argument to to_fileio_pread
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.
This commit is contained in:
parent
0d866f62e8
commit
a3be983cee
@ -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.
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user