2014-02-19 Tom Tromey <tromey@redhat.com>
+ * target.h (struct target_ops) <to_fileio_open>: Add argument.
+ * target.c (target_fileio_open): Add argument.
+ * remote.c (remote_hostio_open): Add 'self' argument.
+ (remote_bfd_iovec_open): Add 'self' argument.
+ (remote_file_put): Add 'self' argument.
+ (remote_file_get): Add 'self' argument.
+ * inf-child.c (inf_child_fileio_open): Add 'self' argument.
+
+2014-02-19 Tom Tromey <tromey@redhat.com>
+
* target.h (struct target_ops) <to_can_run_breakpoint_commands>:
Add argument.
(target_can_run_breakpoint_commands): Add argument.
target file descriptor, or -1 if an error occurs (and set
*TARGET_ERRNO). */
static int
-inf_child_fileio_open (const char *filename, int flags, int mode,
+inf_child_fileio_open (struct target_ops *self,
+ const char *filename, int flags, int mode,
int *target_errno)
{
int nat_flags;
*REMOTE_ERRNO). */
static int
-remote_hostio_open (const char *filename, int flags, int mode,
+remote_hostio_open (struct target_ops *self,
+ const char *filename, int flags, int mode,
int *remote_errno)
{
struct remote_state *rs = get_remote_state ();
gdb_assert (remote_filename_p (filename));
- fd = remote_hostio_open (filename + 7, FILEIO_O_RDONLY, 0, &remote_errno);
+ fd = remote_hostio_open (find_target_at (process_stratum),
+ filename + 7, FILEIO_O_RDONLY, 0, &remote_errno);
if (fd == -1)
{
errno = remote_fileio_errno_to_host (remote_errno);
perror_with_name (local_file);
back_to = make_cleanup_fclose (file);
- fd = remote_hostio_open (remote_file, (FILEIO_O_WRONLY | FILEIO_O_CREAT
+ fd = remote_hostio_open (find_target_at (process_stratum),
+ remote_file, (FILEIO_O_WRONLY | FILEIO_O_CREAT
| FILEIO_O_TRUNC),
0700, &remote_errno);
if (fd == -1)
if (!rs->remote_desc)
error (_("command can only be used with remote target"));
- fd = remote_hostio_open (remote_file, FILEIO_O_RDONLY, 0, &remote_errno);
+ fd = remote_hostio_open (find_target_at (process_stratum),
+ remote_file, FILEIO_O_RDONLY, 0, &remote_errno);
if (fd == -1)
remote_hostio_error (remote_errno);
{
if (t->to_fileio_open != NULL)
{
- int fd = t->to_fileio_open (filename, flags, mode, target_errno);
+ int fd = t->to_fileio_open (t, filename, flags, mode, target_errno);
if (targetdebug)
fprintf_unfiltered (gdb_stdlog,
/* Open FILENAME on the target, using FLAGS and MODE. Return a
target file descriptor, or -1 if an error occurs (and set
*TARGET_ERRNO). */
- int (*to_fileio_open) (const char *filename, int flags, int mode,
+ int (*to_fileio_open) (struct target_ops *,
+ const char *filename, int flags, int mode,
int *target_errno);
/* Write up to LEN bytes from WRITE_BUF to FD on the target.