summaryrefslogtreecommitdiff
path: root/gdb/gdb_bfd.c
diff options
context:
space:
mode:
authorGary Benson <gbenson@redhat.com>2015-06-05 16:08:05 +0100
committerGary Benson <gbenson@redhat.com>2015-06-05 16:08:05 +0100
commite3dd7556ad89bf00c2a92f76079ae1c53dc130a8 (patch)
tree79bf7fdb88953c5a9aaefc0cded72b96d94518ad /gdb/gdb_bfd.c
parentf8b447819b3d65c3bea65dee860110aa198c081e (diff)
downloadbinutils-gdb-e3dd7556ad89bf00c2a92f76079ae1c53dc130a8.tar.gz
Move vgdb special case into remote_filesystem_is_local
Valgrind GDB (vgdb) presents itself as a remote target but works on the local filesystem. gdb_bfd_open contained a special case to make vgdb work with "target:" sysroots, but the implementation meant that GDB would fall back to the local filesystem if *any* to_fileio_open method failed with ENOSYS for *any* reason. This commit moves the vgdb special case to remote_filesystem_is_local to allow the fallback to be restricted only to the specific case that remote file transfer is unsupported. This commit also adds a warning which is displayed the first time the fallback is used. gdb/ChangeLog: * gdb_bfd.c (gdb_bfd_open): Move vgdb special case to... * remote.c (remote_filesystem_is_local): ...here.
Diffstat (limited to 'gdb/gdb_bfd.c')
-rw-r--r--gdb/gdb_bfd.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/gdb/gdb_bfd.c b/gdb/gdb_bfd.c
index 3d5d23f7cb8..2cd91ef96b1 100644
--- a/gdb/gdb_bfd.c
+++ b/gdb/gdb_bfd.c
@@ -326,25 +326,11 @@ gdb_bfd_open (const char *name, const char *target, int fd)
{
gdb_assert (fd == -1);
- abfd = gdb_bfd_openr_iovec (name, target,
+ return gdb_bfd_openr_iovec (name, target,
gdb_bfd_iovec_fileio_open, NULL,
gdb_bfd_iovec_fileio_pread,
gdb_bfd_iovec_fileio_close,
gdb_bfd_iovec_fileio_fstat);
-
- if (abfd != NULL || errno != ENOSYS)
- return abfd;
-
- /* gdb_bfd_iovec_fileio_open failed with ENOSYS. This can
- happen, for example, with vgdb (Valgrind GDB), which
- presents itself as a remote target but works on the local
- filesystem: it does not implement remote get and users
- are not expected to set gdb_sysroot. To handle this case
- we fall back to trying the local filesystem iff
- gdb_sysroot is exactly TARGET_SYSROOT_PREFIX. */
- if (gdb_sysroot == NULL
- || strcmp (gdb_sysroot, TARGET_SYSROOT_PREFIX) != 0)
- return NULL;
}
name += strlen (TARGET_SYSROOT_PREFIX);