aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdb_bfd.c
diff options
context:
space:
mode:
authorGary Benson <gbenson@redhat.com>2015-06-10 14:28:43 +0100
committerGary Benson <gbenson@redhat.com>2015-06-10 14:28:43 +0100
commit07c138c8ae2b11d417c9799202363a95a2d06881 (patch)
treef9e4e351dd13738a439fbf69f75c06b5e9c38dc3 /gdb/gdb_bfd.c
parent12e2a5fdccfc6857c57d2e0a1c1e5fd136a94025 (diff)
downloadfsf-binutils-gdb-07c138c8ae2b11d417c9799202363a95a2d06881.zip
fsf-binutils-gdb-07c138c8ae2b11d417c9799202363a95a2d06881.tar.gz
fsf-binutils-gdb-07c138c8ae2b11d417c9799202363a95a2d06881.tar.bz2
Add "inferior" argument to some target_fileio functions
This commit adds a new argument to all target_fileio functions with filename arguments to allow the desired inferior to be specified. This allows GDB to support systems where processes do not necessarily share a common filesystem. gdb/ChangeLog: * target.h (struct inferior): New forward declaration. (struct target_ops) <to_filesystem_is_local>: Update comment. (struct target_ops) <to_fileio_open>: New argument inf. Update comment. All implementations updated. (struct target_ops) <to_fileio_unlink>: Likewise. (struct target_ops) <to_fileio_readlink>: Likewise. (target_filesystem_is_local): Update comment. (target_fileio_open): New argument inf. Update comment. (target_fileio_unlink): Likewise. (target_fileio_readlink): Likewise. (target_fileio_read_alloc): Likewise. (target_fileio_read_stralloc): Likewise. * target.c (target_fileio_open): New argument inf. Pass inf to implementation. Update debug printing. (target_fileio_unlink): Likewise. (target_fileio_readlink): Likewise. (target_fileio_read_alloc_1): New argument inf. Pass inf to target_fileio_open. (target_fileio_read_alloc): New argument inf. Pass inf to target_fileio_read_alloc_1. (target_fileio_read_stralloc): Likewise. * gdb_bfd.c (inferior.h): New include. (gdb_bfd_iovec_fileio_open): Replace unused "open_closure" argument with new argument "inferior". Pass inferior to target_fileio_open. (gdb_bfd_open): Supply inferior argument to gdb_bfd_iovec_fileio_open. * linux-tdep.c (linux_info_proc): Supply inf argument to relevant target_fileio calls. (linux_find_memory_regions_full): Likewise. (linux_fill_prpsinfo): Likewise. * remote.c (remote_filesystem_is_local): Supply inf argument to remote_hostio_open. (remote_file_put): Likewise. (remote_file_get): Likewise. (remote_file_delete): Supply inf argument to remote_hostio_unlink.
Diffstat (limited to 'gdb/gdb_bfd.c')
-rw-r--r--gdb/gdb_bfd.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gdb/gdb_bfd.c b/gdb/gdb_bfd.c
index 2cd91ef..1781d80 100644
--- a/gdb/gdb_bfd.c
+++ b/gdb/gdb_bfd.c
@@ -32,6 +32,7 @@
#endif
#include "target.h"
#include "gdb/fileio.h"
+#include "inferior.h"
typedef bfd *bfdp;
DEF_VEC_P (bfdp);
@@ -213,7 +214,7 @@ fileio_errno_to_host (int errnum)
OPEN_CLOSURE is unused. */
static void *
-gdb_bfd_iovec_fileio_open (struct bfd *abfd, void *open_closure)
+gdb_bfd_iovec_fileio_open (struct bfd *abfd, void *inferior)
{
const char *filename = bfd_get_filename (abfd);
int fd, target_errno;
@@ -221,7 +222,8 @@ gdb_bfd_iovec_fileio_open (struct bfd *abfd, void *open_closure)
gdb_assert (is_target_filename (filename));
- fd = target_fileio_open (filename + strlen (TARGET_SYSROOT_PREFIX),
+ fd = target_fileio_open ((struct inferior *) inferior,
+ filename + strlen (TARGET_SYSROOT_PREFIX),
FILEIO_O_RDONLY, 0,
&target_errno);
if (fd == -1)
@@ -327,7 +329,8 @@ gdb_bfd_open (const char *name, const char *target, int fd)
gdb_assert (fd == -1);
return gdb_bfd_openr_iovec (name, target,
- gdb_bfd_iovec_fileio_open, NULL,
+ gdb_bfd_iovec_fileio_open,
+ current_inferior (),
gdb_bfd_iovec_fileio_pread,
gdb_bfd_iovec_fileio_close,
gdb_bfd_iovec_fileio_fstat);