aboutsummaryrefslogtreecommitdiff
path: root/gdb/disasm.c
diff options
context:
space:
mode:
authorLancelot Six <lancelot.six@amd.com>2023-10-13 09:27:48 +0000
committerLancelot Six <lancelot.six@amd.com>2023-11-21 11:52:35 +0000
commit6b09f1342cf2d8e2b13a0d634acc3bcf2852a73b (patch)
tree07259601270022a6cbeb89826560262f015e1589 /gdb/disasm.c
parent6b62451ad08056f0ba02e192ec34ef67c4294ef4 (diff)
downloadbinutils-6b09f1342cf2d8e2b13a0d634acc3bcf2852a73b.zip
binutils-6b09f1342cf2d8e2b13a0d634acc3bcf2852a73b.tar.gz
binutils-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/disasm.c')
-rw-r--r--gdb/disasm.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/gdb/disasm.c b/gdb/disasm.c
index 2e866f6..82b7e99 100644
--- a/gdb/disasm.c
+++ b/gdb/disasm.c
@@ -29,7 +29,7 @@
#include "source.h"
#include "gdbsupport/gdb-safe-ctype.h"
#include <algorithm>
-#include "gdbsupport/gdb_optional.h"
+#include <optional>
#include "valprint.h"
#include "cli/cli-style.h"
#include "objfiles.h"
@@ -653,8 +653,8 @@ do_mixed_source_and_assembly_deprecated
ui_out_emit_list asm_insns_list (uiout, "asm_insns");
- gdb::optional<ui_out_emit_tuple> outer_tuple_emitter;
- gdb::optional<ui_out_emit_list> inner_list_emitter;
+ std::optional<ui_out_emit_tuple> outer_tuple_emitter;
+ std::optional<ui_out_emit_list> inner_list_emitter;
for (i = 0; i < newlines; i++)
{
@@ -810,8 +810,8 @@ do_mixed_source_and_assembly (struct gdbarch *gdbarch,
ui_out_emit_list asm_insns_emitter (uiout, "asm_insns");
- gdb::optional<ui_out_emit_tuple> tuple_emitter;
- gdb::optional<ui_out_emit_list> list_emitter;
+ std::optional<ui_out_emit_tuple> tuple_emitter;
+ std::optional<ui_out_emit_list> list_emitter;
last_symtab = NULL;
last_line = 0;
@@ -1093,7 +1093,7 @@ gdb_print_insn_1 (struct gdbarch *gdbarch, CORE_ADDR vma,
struct disassemble_info *info)
{
/* Call into the extension languages to do the disassembly. */
- gdb::optional<int> length = ext_lang_print_insn (gdbarch, vma, info);
+ std::optional<int> length = ext_lang_print_insn (gdbarch, vma, info);
if (length.has_value ())
return *length;
@@ -1125,7 +1125,7 @@ gdb_disassembler::print_insn (CORE_ADDR memaddr,
this output. */
if (length > 0 && use_ext_lang_for_styling ())
{
- gdb::optional<std::string> ext_contents;
+ std::optional<std::string> ext_contents;
ext_contents = ext_lang_colorize_disasm (m_buffer.string (), arch ());
if (ext_contents.has_value ())
m_buffer = std::move (*ext_contents);