diff options
author | Pedro Alves <palves@redhat.com> | 2020-05-19 18:36:24 +0100 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2020-05-19 18:36:51 +0100 |
commit | 4111f652f955028e8219fad2d60af1fd22aa29ee (patch) | |
tree | d50f5be0ada132550b4096402f2afbf560f17430 /gdb/target.c | |
parent | ad80db5b9f7c95105c78d3ab439678184d1b7177 (diff) | |
download | binutils-4111f652f955028e8219fad2d60af1fd22aa29ee.zip binutils-4111f652f955028e8219fad2d60af1fd22aa29ee.tar.gz binutils-4111f652f955028e8219fad2d60af1fd22aa29ee.tar.bz2 |
Eliminate target_fileio_open_warn_if_slow
This basically makes target_fileio_open_1 extern, renamed to
target_fileio_open, and eliminates the current
target_fileio_open_warn_if_slow and target_fileio_open.
A following parameter will want to change gdb_bfd_iovec_fileio_open,
the only caller of target_fileio_open_warn_if_slow, to pass down
"warn_if_slow" true/false from the caller, instead of hardcoding
"warn_if_slow" true.
gdb/ChangeLog:
2020-05-19 Pedro Alves <palves@redhat.com>
* gdb_bfd.c (gdb_bfd_iovec_fileio_open): Adjust.
* target.c (target_fileio_open_1): Rename to target_fileio_open
and make extern. Use bool.
(target_fileio_open, target_fileio_open_warn_if_slow): Delete.
(target_fileio_read_alloc_1): Adjust.
* target.h (target_fileio_open): Add 'warn_if_slow' parameter.
(target_fileio_open_warn_if_slow): Delete declaration.
Diffstat (limited to 'gdb/target.c')
-rw-r--r-- | gdb/target.c | 33 |
1 files changed, 5 insertions, 28 deletions
diff --git a/gdb/target.c b/gdb/target.c index 6982a80..82c405a8 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -2775,13 +2775,11 @@ target_ops::fileio_readlink (struct inferior *inf, const char *filename, return {}; } -/* Helper for target_fileio_open and - target_fileio_open_warn_if_slow. */ +/* See target.h. */ -static int -target_fileio_open_1 (struct inferior *inf, const char *filename, - int flags, int mode, int warn_if_slow, - int *target_errno) +int +target_fileio_open (struct inferior *inf, const char *filename, + int flags, int mode, bool warn_if_slow, int *target_errno) { for (target_ops *t = default_fileio_target (); t != NULL; t = t->beneath ()) { @@ -2814,27 +2812,6 @@ target_fileio_open_1 (struct inferior *inf, const char *filename, /* See target.h. */ int -target_fileio_open (struct inferior *inf, const char *filename, - int flags, int mode, int *target_errno) -{ - return target_fileio_open_1 (inf, filename, flags, mode, 0, - target_errno); -} - -/* See target.h. */ - -int -target_fileio_open_warn_if_slow (struct inferior *inf, - const char *filename, - int flags, int mode, int *target_errno) -{ - return target_fileio_open_1 (inf, filename, flags, mode, 1, - target_errno); -} - -/* See target.h. */ - -int target_fileio_pwrite (int fd, const gdb_byte *write_buf, int len, ULONGEST offset, int *target_errno) { @@ -3036,7 +3013,7 @@ target_fileio_read_alloc_1 (struct inferior *inf, const char *filename, int target_errno; scoped_target_fd fd (target_fileio_open (inf, filename, FILEIO_O_RDONLY, - 0700, &target_errno)); + 0700, false, &target_errno)); if (fd.get () == -1) return -1; |