aboutsummaryrefslogtreecommitdiff
path: root/gdb/thread.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/thread.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/thread.c')
-rw-r--r--gdb/thread.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/gdb/thread.c b/gdb/thread.c
index 810fdae..c0ed64e 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -46,7 +46,7 @@
#include "thread-fsm.h"
#include "tid-parse.h"
#include <algorithm>
-#include "gdbsupport/gdb_optional.h"
+#include <optional>
#include "inline-frame.h"
#include "stack.h"
#include "interps.h"
@@ -194,7 +194,7 @@ clear_thread_inferior_resources (struct thread_info *tp)
/* Notify interpreters and observers that thread T has exited. */
static void
-notify_thread_exited (thread_info *t, gdb::optional<ULONGEST> exit_code,
+notify_thread_exited (thread_info *t, std::optional<ULONGEST> exit_code,
int silent)
{
if (!silent && print_thread_events)
@@ -215,7 +215,7 @@ notify_thread_exited (thread_info *t, gdb::optional<ULONGEST> exit_code,
/* See gdbthread.h. */
void
-set_thread_exited (thread_info *tp, gdb::optional<ULONGEST> exit_code,
+set_thread_exited (thread_info *tp, std::optional<ULONGEST> exit_code,
bool silent)
{
/* Dead threads don't need to step-over. Remove from chain. */
@@ -504,7 +504,7 @@ global_thread_step_over_chain_remove (struct thread_info *tp)
/* Helper for the different delete_thread variants. */
static void
-delete_thread_1 (thread_info *thr, gdb::optional<ULONGEST> exit_code,
+delete_thread_1 (thread_info *thr, std::optional<ULONGEST> exit_code,
bool silent)
{
gdb_assert (thr != nullptr);
@@ -1112,8 +1112,8 @@ print_thread_info_1 (struct ui_out *uiout, const char *requested_threads,
/* For backward compatibility, we make a list for MI. A table is
preferable for the CLI, though, because it shows table
headers. */
- gdb::optional<ui_out_emit_list> list_emitter;
- gdb::optional<ui_out_emit_table> table_emitter;
+ std::optional<ui_out_emit_list> list_emitter;
+ std::optional<ui_out_emit_table> table_emitter;
/* We'll be switching threads temporarily below. */
scoped_restore_current_thread restore_thread;
@@ -1543,7 +1543,7 @@ tp_array_compar_descending (const thread_info_ref &a, const thread_info_ref &b)
/* See gdbthread.h. */
void
-thread_try_catch_cmd (thread_info *thr, gdb::optional<int> ada_task,
+thread_try_catch_cmd (thread_info *thr, std::optional<int> ada_task,
const char *cmd, int from_tty,
const qcs_flags &flags)
{