aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-12-17 21:38:21 -0700
committerTom Tromey <tromey@redhat.com>2014-02-19 07:46:10 -0700
commitcd897586764fedd7c5dec6266fcda7b1699015d1 (patch)
tree64a03b8dd9a45c82d6d9bb45c5319f3e5ed0e965 /gdb
parent78eff0ec9d736c4a96bbd18c9bcd643d2a1edcea (diff)
downloadgdb-cd897586764fedd7c5dec6266fcda7b1699015d1.zip
gdb-cd897586764fedd7c5dec6266fcda7b1699015d1.tar.gz
gdb-cd897586764fedd7c5dec6266fcda7b1699015d1.tar.bz2
Add target_ops argument to to_fileio_open
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.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog10
-rw-r--r--gdb/inf-child.c3
-rw-r--r--gdb/remote.c12
-rw-r--r--gdb/target.c2
-rw-r--r--gdb/target.h3
5 files changed, 23 insertions, 7 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 8b262fa..fcbaa36 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,15 @@
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.
diff --git a/gdb/inf-child.c b/gdb/inf-child.c
index e047636..cd2aee6 100644
--- a/gdb/inf-child.c
+++ b/gdb/inf-child.c
@@ -231,7 +231,8 @@ inf_child_errno_to_fileio_error (int errnum)
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;
diff --git a/gdb/remote.c b/gdb/remote.c
index b62b5f2..a01ca46 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -9655,7 +9655,8 @@ remote_hostio_send_command (int command_bytes, int which_packet,
*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 ();
@@ -9901,7 +9902,8 @@ remote_bfd_iovec_open (struct bfd *abfd, void *open_closure)
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);
@@ -10007,7 +10009,8 @@ remote_file_put (const char *local_file, const char *remote_file, int from_tty)
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)
@@ -10091,7 +10094,8 @@ remote_file_get (const char *remote_file, const char *local_file, int from_tty)
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);
diff --git a/gdb/target.c b/gdb/target.c
index bf4a513..fbec3b9 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -3372,7 +3372,7 @@ target_fileio_open (const char *filename, int flags, int mode,
{
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,
diff --git a/gdb/target.h b/gdb/target.h
index c809c1b..68b3aee 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -716,7 +716,8 @@ struct target_ops
/* 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.