From 6b09f1342cf2d8e2b13a0d634acc3bcf2852a73b Mon Sep 17 00:00:00 2001 From: Lancelot Six Date: Fri, 13 Oct 2023 09:27:48 +0000 Subject: 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 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 Approved-By: Pedro Alves --- gdb/breakpoint.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'gdb/breakpoint.c') diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index cd8f36f..af395fd 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -82,7 +82,7 @@ #include #include "progspace-and-thread.h" #include "gdbsupport/array-view.h" -#include "gdbsupport/gdb_optional.h" +#include #include "gdbsupport/common-utils.h" /* Prototypes for local functions. */ @@ -2067,7 +2067,7 @@ update_watchpoint (struct watchpoint *b, bool reparse) if (b->disposition == disp_del_at_next_stop) return; - gdb::optional restore_frame; + std::optional restore_frame; /* Determine if the watchpoint is within scope. */ if (b->exp_valid_block == NULL) @@ -3365,7 +3365,7 @@ remove_breakpoints (void) static void remove_threaded_breakpoints (thread_info *tp, - gdb::optional /* exit_code */, + std::optional /* exit_code */, int /* silent */) { for (breakpoint &b : all_breakpoints_safe ()) @@ -6776,8 +6776,8 @@ print_one_breakpoint_location (struct breakpoint *b, (uiout->test_flags (fix_breakpoint_script_output) || fix_breakpoint_script_output_globally); - gdb::optional tuple_emitter; - gdb::optional list_emitter; + std::optional tuple_emitter; + std::optional list_emitter; if (use_fixed_output) list_emitter.emplace (uiout, "script"); @@ -6850,7 +6850,8 @@ print_one_breakpoint (breakpoint *b, const bp_location **last_loc, int allflag) = (uiout->test_flags (fix_multi_location_breakpoint_output) || fix_multi_location_breakpoint_output_globally); - gdb::optional bkpt_tuple_emitter (gdb::in_place, uiout, "bkpt"); + std::optional bkpt_tuple_emitter (std::in_place, uiout, + "bkpt"); bool printed = print_one_breakpoint_location (b, NULL, 0, last_loc, allflag, false); @@ -6885,7 +6886,7 @@ print_one_breakpoint (breakpoint *b, const bp_location **last_loc, int allflag) || !b->first_loc ().enabled || b->first_loc ().disabled_by_cond)))) { - gdb::optional locations_list; + std::optional locations_list; /* For MI version <= 2, keep the behavior where GDB outputs an invalid MI record. For later versions, place breakpoint locations in a @@ -9950,7 +9951,7 @@ watchpoint::print_it (const bpstat *bs) const string_file stb; - gdb::optional tuple_emitter; + std::optional tuple_emitter; switch (this->type) { case bp_watchpoint: @@ -10928,7 +10929,7 @@ until_break_command (const char *arg, int from_tty, int anywhere) std::vector breakpoints; - gdb::optional lj_deleter; + std::optional lj_deleter; if (frame_id_p (caller_frame_id)) { -- cgit v1.1