From 0d866f62e8517512fdc0fe92e3f2e4675b2d716f Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 17 Dec 2013 21:38:34 -0700 Subject: [PATCH] Add target_ops argument to to_fileio_pwrite 2014-02-19 Tom Tromey * target.h (struct target_ops) : Add argument. * target.c (target_fileio_pwrite): Add argument. * remote.c (remote_hostio_pwrite): Add 'self' argument. (remote_file_put): Update. * inf-child.c (inf_child_fileio_pwrite): Add 'self' argument. --- gdb/ChangeLog | 8 ++++++++ gdb/inf-child.c | 3 ++- gdb/remote.c | 6 ++++-- gdb/target.c | 2 +- gdb/target.h | 3 ++- 5 files changed, 17 insertions(+), 5 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index fcbaa36eee..c041549d53 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2014-02-19 Tom Tromey + + * target.h (struct target_ops) : Add argument. + * target.c (target_fileio_pwrite): Add argument. + * remote.c (remote_hostio_pwrite): Add 'self' argument. + (remote_file_put): Update. + * inf-child.c (inf_child_fileio_pwrite): Add 'self' argument. + 2014-02-19 Tom Tromey * target.h (struct target_ops) : Add argument. diff --git a/gdb/inf-child.c b/gdb/inf-child.c index cd2aee64ab..6486b2c77f 100644 --- a/gdb/inf-child.c +++ b/gdb/inf-child.c @@ -257,7 +257,8 @@ inf_child_fileio_open (struct target_ops *self, Return the number of bytes written, or -1 if an error occurs (and set *TARGET_ERRNO). */ static int -inf_child_fileio_pwrite (int fd, const gdb_byte *write_buf, int len, +inf_child_fileio_pwrite (struct target_ops *self, + int fd, const gdb_byte *write_buf, int len, ULONGEST offset, int *target_errno) { int ret; diff --git a/gdb/remote.c b/gdb/remote.c index a01ca463de..ae8c523608 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -9683,7 +9683,8 @@ remote_hostio_open (struct target_ops *self, set *REMOTE_ERRNO). */ static int -remote_hostio_pwrite (int fd, const gdb_byte *write_buf, int len, +remote_hostio_pwrite (struct target_ops *self, + int fd, const gdb_byte *write_buf, int len, ULONGEST offset, int *remote_errno) { struct remote_state *rs = get_remote_state (); @@ -10054,7 +10055,8 @@ remote_file_put (const char *local_file, const char *remote_file, int from_tty) bytes += bytes_in_buffer; bytes_in_buffer = 0; - retcode = remote_hostio_pwrite (fd, buffer, bytes, + retcode = remote_hostio_pwrite (find_target_at (process_stratum), + fd, buffer, bytes, offset, &remote_errno); if (retcode < 0) diff --git a/gdb/target.c b/gdb/target.c index fbec3b9225..ace183387b 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -3400,7 +3400,7 @@ target_fileio_pwrite (int fd, const gdb_byte *write_buf, int len, { if (t->to_fileio_pwrite != NULL) { - int ret = t->to_fileio_pwrite (fd, write_buf, len, offset, + int ret = t->to_fileio_pwrite (t, fd, write_buf, len, offset, target_errno); if (targetdebug) diff --git a/gdb/target.h b/gdb/target.h index 68b3aeebe4..02b66d7ee6 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -723,7 +723,8 @@ struct target_ops /* Write up to LEN bytes from WRITE_BUF to FD on the target. Return the number of bytes written, or -1 if an error occurs (and set *TARGET_ERRNO). */ - int (*to_fileio_pwrite) (int fd, const gdb_byte *write_buf, int len, + int (*to_fileio_pwrite) (struct target_ops *, + int fd, const gdb_byte *write_buf, int len, ULONGEST offset, int *target_errno); /* Read up to LEN bytes FD on the target into READ_BUF. -- 2.34.1