aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-12-17 21:39:11 -0700
committerTom Tromey <tromey@redhat.com>2014-02-19 07:46:13 -0700
commitdbbca37d38772f0f75296b01b757225278eb51fc (patch)
tree558564b53947b27dcc91244d0e4b9e044063b485 /gdb
parentdf39ea259cf099cb2de3d26905078dddf47832cd (diff)
downloadgdb-dbbca37d38772f0f75296b01b757225278eb51fc.zip
gdb-dbbca37d38772f0f75296b01b757225278eb51fc.tar.gz
gdb-dbbca37d38772f0f75296b01b757225278eb51fc.tar.bz2
Add target_ops argument to to_fileio_unlink
2014-02-19 Tom Tromey <tromey@redhat.com> * target.h (struct target_ops) <to_fileio_unlink>: Add argument. * target.c (target_fileio_unlink): Add argument. * remote.c (remote_hostio_unlink): Add 'self' argument. (remote_file_delete): Update. * inf-child.c (inf_child_fileio_unlink): Add 'self' argument.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/inf-child.c3
-rw-r--r--gdb/remote.c6
-rw-r--r--gdb/target.c2
-rw-r--r--gdb/target.h3
5 files changed, 17 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index fb75b1a..24d3b34 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,13 @@
2014-02-19 Tom Tromey <tromey@redhat.com>
+ * target.h (struct target_ops) <to_fileio_unlink>: Add argument.
+ * target.c (target_fileio_unlink): Add argument.
+ * remote.c (remote_hostio_unlink): Add 'self' argument.
+ (remote_file_delete): Update.
+ * inf-child.c (inf_child_fileio_unlink): Add 'self' argument.
+
+2014-02-19 Tom Tromey <tromey@redhat.com>
+
* target.h (struct target_ops) <to_fileio_close>: Add argument.
* target.c (target_fileio_close): Add argument.
* remote.c (remote_hostio_close): Add 'self' argument.
diff --git a/gdb/inf-child.c b/gdb/inf-child.c
index 01bf1af..eb7550a 100644
--- a/gdb/inf-child.c
+++ b/gdb/inf-child.c
@@ -328,7 +328,8 @@ inf_child_fileio_close (struct target_ops *self, int fd, int *target_errno)
/* Unlink FILENAME on the target. Return 0, or -1 if an error
occurs (and set *TARGET_ERRNO). */
static int
-inf_child_fileio_unlink (const char *filename, int *target_errno)
+inf_child_fileio_unlink (struct target_ops *self,
+ const char *filename, int *target_errno)
{
int ret;
diff --git a/gdb/remote.c b/gdb/remote.c
index 19bef54..cf8870e 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -9770,7 +9770,8 @@ remote_hostio_close (struct target_ops *self, int fd, int *remote_errno)
occurs (and set *REMOTE_ERRNO). */
static int
-remote_hostio_unlink (const char *filename, int *remote_errno)
+remote_hostio_unlink (struct target_ops *self,
+ const char *filename, int *remote_errno)
{
struct remote_state *rs = get_remote_state ();
char *p = rs->buf;
@@ -10152,7 +10153,8 @@ remote_file_delete (const char *remote_file, int from_tty)
if (!rs->remote_desc)
error (_("command can only be used with remote target"));
- retcode = remote_hostio_unlink (remote_file, &remote_errno);
+ retcode = remote_hostio_unlink (find_target_at (process_stratum),
+ remote_file, &remote_errno);
if (retcode == -1)
remote_hostio_error (remote_errno);
diff --git a/gdb/target.c b/gdb/target.c
index 8767b57..2c4b6b6 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -3483,7 +3483,7 @@ target_fileio_unlink (const char *filename, int *target_errno)
{
if (t->to_fileio_unlink != NULL)
{
- int ret = t->to_fileio_unlink (filename, target_errno);
+ int ret = t->to_fileio_unlink (t, filename, target_errno);
if (targetdebug)
fprintf_unfiltered (gdb_stdlog,
diff --git a/gdb/target.h b/gdb/target.h
index e2dddc7..5d5802e 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -740,7 +740,8 @@ struct target_ops
/* Unlink FILENAME on the target. Return 0, or -1 if an error
occurs (and set *TARGET_ERRNO). */
- int (*to_fileio_unlink) (const char *filename, int *target_errno);
+ int (*to_fileio_unlink) (struct target_ops *,
+ const char *filename, int *target_errno);
/* Read value of symbolic link FILENAME on the target. Return a
null-terminated string allocated via xmalloc, or NULL if an error