aboutsummaryrefslogtreecommitdiff
path: root/gdb/breakpoint.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/breakpoint.c
parent6b62451ad08056f0ba02e192ec34ef67c4294ef4 (diff)
downloadfsf-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/breakpoint.c')
-rw-r--r--gdb/breakpoint.c19
1 files changed, 10 insertions, 9 deletions
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 <algorithm>
#include "progspace-and-thread.h"
#include "gdbsupport/array-view.h"
-#include "gdbsupport/gdb_optional.h"
+#include <optional>
#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<scoped_restore_selected_frame> restore_frame;
+ std::optional<scoped_restore_selected_frame> 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<ULONGEST> /* exit_code */,
+ std::optional<ULONGEST> /* 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<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;
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<ui_out_emit_tuple> bkpt_tuple_emitter (gdb::in_place, uiout, "bkpt");
+ std::optional<ui_out_emit_tuple> 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<ui_out_emit_list> locations_list;
+ std::optional<ui_out_emit_list> 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<ui_out_emit_tuple> tuple_emitter;
+ std::optional<ui_out_emit_tuple> 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<breakpoint_up> breakpoints;
- gdb::optional<delete_longjmp_breakpoint_cleanup> lj_deleter;
+ std::optional<delete_longjmp_breakpoint_cleanup> lj_deleter;
if (frame_id_p (caller_frame_id))
{