diff options
author | Lancelot Six <lancelot.six@amd.com> | 2023-10-13 09:27:48 +0000 |
---|---|---|
committer | Lancelot Six <lancelot.six@amd.com> | 2023-11-21 11:52:35 +0000 |
commit | 6b09f1342cf2d8e2b13a0d634acc3bcf2852a73b (patch) | |
tree | 07259601270022a6cbeb89826560262f015e1589 /gdb/target.h | |
parent | 6b62451ad08056f0ba02e192ec34ef67c4294ef4 (diff) | |
download | fsf-binutils-gdb-6b09f1342cf2d8e2b13a0d634acc3bcf2852a73b.zip fsf-binutils-gdb-6b09f1342cf2d8e2b13a0d634acc3bcf2852a73b.tar.gz fsf-binutils-gdb-6b09f1342cf2d8e2b13a0d634acc3bcf2852a73b.tar.bz2 |
gdb: Replace gdb::optional with std::optional
Since GDB now requires C++17, we don't need the internally maintained
gdb::optional implementation. This patch does the following replacing:
- gdb::optional -> std::optional
- gdb::in_place -> std::in_place
- #include "gdbsupport/gdb_optional.h" -> #include <optional>
This change has mostly been done automatically. One exception is
gdbsupport/thread-pool.* which did not use the gdb:: prefix as it
already lives in the gdb namespace.
Change-Id: I19a92fa03e89637bab136c72e34fd351524f65e9
Approved-By: Tom Tromey <tom@tromey.com>
Approved-By: Pedro Alves <pedro@palves.net>
Diffstat (limited to 'gdb/target.h')
-rw-r--r-- | gdb/target.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gdb/target.h b/gdb/target.h index fca0bbb..c54bd28 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -345,7 +345,7 @@ LONGEST target_write_with_progress (struct target_ops *ops, size is known in advance. Don't try to read TARGET_OBJECT_MEMORY through this function. */ -extern gdb::optional<gdb::byte_vector> target_read_alloc +extern std::optional<gdb::byte_vector> target_read_alloc (struct target_ops *ops, enum target_object object, const char *annex); /* Read OBJECT/ANNEX using OPS. The result is a NUL-terminated character vector @@ -355,7 +355,7 @@ extern gdb::optional<gdb::byte_vector> target_read_alloc the returned vector is guaranteed to have at least one element. A warning is issued if the result contains any embedded NUL bytes. */ -extern gdb::optional<gdb::char_vector> target_read_stralloc +extern std::optional<gdb::char_vector> target_read_stralloc (struct target_ops *ops, enum target_object object, const char *annex); /* See target_ops->to_xfer_partial. */ @@ -1001,7 +1001,7 @@ struct target_ops seen by the debugger (GDB or, for remote targets, the remote stub). Return a string, or an empty optional if an error occurs (and set *TARGET_ERRNO). */ - virtual gdb::optional<std::string> fileio_readlink (struct inferior *inf, + virtual std::optional<std::string> fileio_readlink (struct inferior *inf, const char *filename, fileio_error *target_errno); @@ -2206,7 +2206,7 @@ extern int target_fileio_unlink (struct inferior *inf, by the debugger (GDB or, for remote targets, the remote stub). Return a null-terminated string allocated via xmalloc, or NULL if an error occurs (and set *TARGET_ERRNO). */ -extern gdb::optional<std::string> target_fileio_readlink +extern std::optional<std::string> target_fileio_readlink (struct inferior *inf, const char *filename, fileio_error *target_errno); /* Read target file FILENAME, in the filesystem as seen by INF. If @@ -2469,7 +2469,7 @@ struct target_ops *find_target_at (enum strata stratum); /* Read OS data object of type TYPE from the target, and return it in XML format. The return value follows the same rules as target_read_stralloc. */ -extern gdb::optional<gdb::char_vector> target_get_osdata (const char *type); +extern std::optional<gdb::char_vector> target_get_osdata (const char *type); /* Stuff that should be shared among the various remote targets. */ |