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/linux-nat.c | |
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/linux-nat.c')
-rw-r--r-- | gdb/linux-nat.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index d3e9560..7b0562c 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -1295,7 +1295,7 @@ get_detach_signal (struct lwp_info *lp) /* If LP has a pending fork/vfork/clone status, return it. */ -static gdb::optional<target_waitstatus> +static std::optional<target_waitstatus> get_pending_child_status (lwp_info *lp) { LINUX_NAT_SCOPED_DEBUG_ENTER_EXIT; @@ -1369,7 +1369,7 @@ detach_one_lwp (struct lwp_info *lp, int *signo_p) event, there is a process/thread GDB is attached to that the core of GDB doesn't know about. Detach from it. */ - gdb::optional<target_waitstatus> ws = get_pending_child_status (lp); + std::optional<target_waitstatus> ws = get_pending_child_status (lp); if (ws.has_value ()) detach_one_pid (ws->child_ptid ().lwp (), 0); @@ -3616,7 +3616,7 @@ kill_wait_callback (struct lwp_info *lp) static int kill_unfollowed_child_callback (lwp_info *lp) { - gdb::optional<target_waitstatus> ws = get_pending_child_status (lp); + std::optional<target_waitstatus> ws = get_pending_child_status (lp); if (ws.has_value ()) { ptid_t child_ptid = ws->child_ptid (); @@ -4074,7 +4074,7 @@ linux_proc_xfer_memory_partial (int pid, gdb_byte *readbuf, static bool proc_mem_file_is_writable () { - static gdb::optional<bool> writable; + static std::optional<bool> writable; if (writable.has_value ()) return *writable; @@ -4463,7 +4463,7 @@ linux_nat_target::fileio_open (struct inferior *inf, const char *filename, /* Implementation of to_fileio_readlink. */ -gdb::optional<std::string> +std::optional<std::string> linux_nat_target::fileio_readlink (struct inferior *inf, const char *filename, fileio_error *target_errno) { |