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/remote.c | |
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/remote.c')
-rw-r--r-- | gdb/remote.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gdb/remote.c b/gdb/remote.c index 5012700..1bc5992 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -930,7 +930,7 @@ public: const char *filename, fileio_error *target_errno) override; - gdb::optional<std::string> + std::optional<std::string> fileio_readlink (struct inferior *inf, const char *filename, fileio_error *target_errno) override; @@ -4091,7 +4091,7 @@ remote_target::remote_get_threads_with_qxfer (threads_listing_context *context) #if defined(HAVE_LIBEXPAT) if (m_features.packet_support (PACKET_qXfer_threads) == PACKET_ENABLE) { - gdb::optional<gdb::char_vector> xml + std::optional<gdb::char_vector> xml = target_read_stralloc (this, TARGET_OBJECT_THREADS, NULL); if (xml && (*xml)[0] != '\0') @@ -11913,7 +11913,7 @@ std::vector<mem_region> remote_target::memory_map () { std::vector<mem_region> result; - gdb::optional<gdb::char_vector> text + std::optional<gdb::char_vector> text = target_read_stralloc (current_inferior ()->top_target (), TARGET_OBJECT_MEMORY_MAP, NULL); @@ -12878,7 +12878,7 @@ remote_target::fileio_unlink (struct inferior *inf, const char *filename, /* Implementation of to_fileio_readlink. */ -gdb::optional<std::string> +std::optional<std::string> remote_target::fileio_readlink (struct inferior *inf, const char *filename, fileio_error *remote_errno) { @@ -14145,7 +14145,7 @@ remote_target::set_circular_trace_buffer (int val) traceframe_info_up remote_target::traceframe_info () { - gdb::optional<gdb::char_vector> text + std::optional<gdb::char_vector> text = target_read_stralloc (current_inferior ()->top_target (), TARGET_OBJECT_TRACEFRAME_INFO, NULL); @@ -14686,7 +14686,7 @@ btrace_read_config (thread_info *tp, btrace_config *conf) scoped_restore_current_thread restore_thread; switch_to_thread (tp); - gdb::optional<gdb::char_vector> xml + std::optional<gdb::char_vector> xml = target_read_stralloc (current_inferior ()->top_target (), TARGET_OBJECT_BTRACE_CONF, ""); if (xml) @@ -14886,7 +14886,7 @@ remote_target::read_btrace (struct btrace_data *btrace, (unsigned int) type); } - gdb::optional<gdb::char_vector> xml + std::optional<gdb::char_vector> xml = target_read_stralloc (current_inferior ()->top_target (), TARGET_OBJECT_BTRACE, annex); if (!xml) @@ -14926,7 +14926,7 @@ remote_target::load (const char *name, int from_tty) const char * remote_target::pid_to_exec_file (int pid) { - static gdb::optional<gdb::char_vector> filename; + static std::optional<gdb::char_vector> filename; char *annex = NULL; if (m_features.packet_support (PACKET_qXfer_exec_file) != PACKET_ENABLE) |