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/extension.c | |
parent | 6b62451ad08056f0ba02e192ec34ef67c4294ef4 (diff) | |
download | gdb-6b09f1342cf2d8e2b13a0d634acc3bcf2852a73b.zip gdb-6b09f1342cf2d8e2b13a0d634acc3bcf2852a73b.tar.gz 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/extension.c')
-rw-r--r-- | gdb/extension.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gdb/extension.c b/gdb/extension.c index 9cb393e..2d7a381 100644 --- a/gdb/extension.c +++ b/gdb/extension.c @@ -939,10 +939,10 @@ xmethod_worker::get_result_type (value *object, gdb::array_view<value *> args) /* See extension.h. */ -gdb::optional<std::string> +std::optional<std::string> ext_lang_colorize (const std::string &filename, const std::string &contents) { - gdb::optional<std::string> result; + std::optional<std::string> result; for (const struct extension_language_defn *extlang : extension_languages) { @@ -959,10 +959,10 @@ ext_lang_colorize (const std::string &filename, const std::string &contents) /* See extension.h. */ -gdb::optional<std::string> +std::optional<std::string> ext_lang_colorize_disasm (const std::string &content, gdbarch *gdbarch) { - gdb::optional<std::string> result; + std::optional<std::string> result; for (const struct extension_language_defn *extlang : extension_languages) { @@ -979,7 +979,7 @@ ext_lang_colorize_disasm (const std::string &content, gdbarch *gdbarch) /* See extension.h. */ -gdb::optional<int> +std::optional<int> ext_lang_print_insn (struct gdbarch *gdbarch, CORE_ADDR address, struct disassemble_info *info) { @@ -988,7 +988,7 @@ ext_lang_print_insn (struct gdbarch *gdbarch, CORE_ADDR address, if (extlang->ops == nullptr || extlang->ops->print_insn == nullptr) continue; - gdb::optional<int> length + std::optional<int> length = extlang->ops->print_insn (gdbarch, address, info); if (length.has_value ()) return length; |