diff options
author | Gary Benson <gbenson@redhat.com> | 2015-08-21 17:09:20 +0100 |
---|---|---|
committer | Gary Benson <gbenson@redhat.com> | 2015-08-21 17:11:36 +0100 |
commit | 4313b8c0ed5877feb5034bfff4056e1ccfe221f1 (patch) | |
tree | b5585d614337ee376a5dc247272d846254e1dc88 /gdb/gdb_bfd.c | |
parent | f36b87190aed31b1ef7787e5966be542e8abdb58 (diff) | |
download | gdb-4313b8c0ed5877feb5034bfff4056e1ccfe221f1.zip gdb-4313b8c0ed5877feb5034bfff4056e1ccfe221f1.tar.gz gdb-4313b8c0ed5877feb5034bfff4056e1ccfe221f1.tar.bz2 |
Warn when accessing binaries from remote targets
GDB provides no indicator of progress during file operations, and can
appear to have locked up during slow remote transfers. This commit
updates GDB to print a warning each time a file is accessed over RSP.
An additional message detailing how to avoid remote transfers is
printed for the first transfer only.
gdb/ChangeLog:
* target.h (struct target_ops) <to_fileio_open>: New argument
warn_if_slow. Update comment. All implementations updated.
(target_fileio_open_warn_if_slow): New declaration.
* target.c (target_fileio_open): Renamed as...
(target_fileio_open_1): ...this. New argument warn_if_slow.
Pass warn_if_slow to implementation. Update debug printing.
(target_fileio_open): New function.
(target_fileio_open_warn_if_slow): Likewise.
* gdb_bfd.c (gdb_bfd_iovec_fileio_open): Use new function
target_fileio_open_warn_if_slow.
gdb/testsuite/ChangeLog:
* gdb.trace/pending.exp: Cope with remote transfer warnings.
Diffstat (limited to 'gdb/gdb_bfd.c')
-rw-r--r-- | gdb/gdb_bfd.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gdb/gdb_bfd.c b/gdb/gdb_bfd.c index eb53766..bffe589 100644 --- a/gdb/gdb_bfd.c +++ b/gdb/gdb_bfd.c @@ -261,10 +261,11 @@ gdb_bfd_iovec_fileio_open (struct bfd *abfd, void *inferior) gdb_assert (is_target_filename (filename)); - fd = target_fileio_open ((struct inferior *) inferior, - filename + strlen (TARGET_SYSROOT_PREFIX), - FILEIO_O_RDONLY, 0, - &target_errno); + fd = target_fileio_open_warn_if_slow ((struct inferior *) inferior, + filename + + strlen (TARGET_SYSROOT_PREFIX), + FILEIO_O_RDONLY, 0, + &target_errno); if (fd == -1) { errno = fileio_errno_to_host (target_errno); |