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-tdep.c | |
parent | 6b62451ad08056f0ba02e192ec34ef67c4294ef4 (diff) | |
download | fsf-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/linux-tdep.c')
-rw-r--r-- | gdb/linux-tdep.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c index eff7a0c..db29b03 100644 --- a/gdb/linux-tdep.c +++ b/gdb/linux-tdep.c @@ -38,7 +38,7 @@ #include "gdbcmd.h" #include "gdbsupport/gdb_regex.h" #include "gdbsupport/enum-flags.h" -#include "gdbsupport/gdb_optional.h" +#include <optional> #include "gcore.h" #include "gcore-elf.h" #include "solib-svr4.h" @@ -229,7 +229,7 @@ struct linux_info int vsyscall_range_p = 0; /* Inferior's displaced step buffers. */ - gdb::optional<displaced_step_buffers> disp_step_bufs; + std::optional<displaced_step_buffers> disp_step_bufs; }; /* Per-inferior data key. */ @@ -589,7 +589,7 @@ struct mapping_regexes static int mapping_is_anonymous_p (const char *filename) { - static gdb::optional<mapping_regexes> regexes; + static std::optional<mapping_regexes> regexes; static int init_regex_p = 0; if (!init_regex_p) @@ -873,7 +873,7 @@ linux_info_proc (struct gdbarch *gdbarch, const char *args, if (cwd_f) { xsnprintf (filename, sizeof filename, "/proc/%ld/cwd", pid); - gdb::optional<std::string> contents + std::optional<std::string> contents = target_fileio_readlink (NULL, filename, &target_errno); if (contents.has_value ()) gdb_printf ("cwd = '%s'\n", contents->c_str ()); @@ -883,7 +883,7 @@ linux_info_proc (struct gdbarch *gdbarch, const char *args, if (exe_f) { xsnprintf (filename, sizeof filename, "/proc/%ld/exe", pid); - gdb::optional<std::string> contents + std::optional<std::string> contents = target_fileio_readlink (NULL, filename, &target_errno); if (contents.has_value ()) gdb_printf ("exe = '%s'\n", contents->c_str ()); @@ -2108,7 +2108,7 @@ linux_make_corefile_notes (struct gdbarch *gdbarch, bfd *obfd, int *note_size) return NULL; /* Auxillary vector. */ - gdb::optional<gdb::byte_vector> auxv = + std::optional<gdb::byte_vector> auxv = target_read_alloc (current_inferior ()->top_target (), TARGET_OBJECT_AUXV, NULL); if (auxv && !auxv->empty ()) @@ -2675,7 +2675,7 @@ linux_displaced_step_restore_all_in_ptid (inferior *parent_inf, ptid_t ptid) /* Helper for linux_get_hwcap and linux_get_hwcap2. */ static CORE_ADDR -linux_get_hwcap_helper (const gdb::optional<gdb::byte_vector> &auxv, +linux_get_hwcap_helper (const std::optional<gdb::byte_vector> &auxv, target_ops *target, gdbarch *gdbarch, CORE_ADDR match) { CORE_ADDR field; @@ -2688,7 +2688,7 @@ linux_get_hwcap_helper (const gdb::optional<gdb::byte_vector> &auxv, /* See linux-tdep.h. */ CORE_ADDR -linux_get_hwcap (const gdb::optional<gdb::byte_vector> &auxv, +linux_get_hwcap (const std::optional<gdb::byte_vector> &auxv, target_ops *target, gdbarch *gdbarch) { return linux_get_hwcap_helper (auxv, target, gdbarch, AT_HWCAP); @@ -2707,7 +2707,7 @@ linux_get_hwcap () /* See linux-tdep.h. */ CORE_ADDR -linux_get_hwcap2 (const gdb::optional<gdb::byte_vector> &auxv, +linux_get_hwcap2 (const std::optional<gdb::byte_vector> &auxv, target_ops *target, gdbarch *gdbarch) { return linux_get_hwcap_helper (auxv, target, gdbarch, AT_HWCAP2); |