+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.
+ (remote_file_put): Update.
+ * inf-child.c (inf_child_fileio_pwrite): Add 'self' argument.
+
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_fileio_open>: Add argument.
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;
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 ();
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)
{
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)
/* 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.