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/gdbthread.h | |
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/gdbthread.h')
-rw-r--r-- | gdb/gdbthread.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h index 938a47f..b2c6baf 100644 --- a/gdb/gdbthread.h +++ b/gdb/gdbthread.h @@ -211,10 +211,10 @@ struct thread_suspend_state - If the thread is running, then this field has its value removed by calling stop_pc.reset() (see thread_info::set_executing()). - Attempting to read a gdb::optional with no value is undefined + Attempting to read a std::optional with no value is undefined behaviour and will trigger an assertion error when _GLIBCXX_DEBUG is defined, which should make error easier to track down. */ - gdb::optional<CORE_ADDR> stop_pc; + std::optional<CORE_ADDR> stop_pc; }; /* Base class for target-specific thread data. */ @@ -661,7 +661,7 @@ extern void delete_thread_silent (struct thread_info *thread); available. If SILENT, then don't inform the CLI about the exit. */ extern void set_thread_exited (thread_info *tp, - gdb::optional<ULONGEST> exit_code = {}, + std::optional<ULONGEST> exit_code = {}, bool silent = false); /* Delete a step_resume_breakpoint from the thread database. */ @@ -1058,7 +1058,7 @@ extern bool switch_to_thread_if_alive (thread_info *thr); exception if !FLAGS.SILENT and !FLAGS.CONT and CMD fails. */ extern void thread_try_catch_cmd (thread_info *thr, - gdb::optional<int> ada_task, + std::optional<int> ada_task, const char *cmd, int from_tty, const qcs_flags &flags); |