aboutsummaryrefslogtreecommitdiff
path: root/gdb/probe.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/probe.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/probe.c')
-rw-r--r--gdb/probe.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/gdb/probe.c b/gdb/probe.c
index 13e95bc..d9079be 100644
--- a/gdb/probe.c
+++ b/gdb/probe.c
@@ -36,7 +36,7 @@
#include "location.h"
#include <ctype.h>
#include <algorithm>
-#include "gdbsupport/gdb_optional.h"
+#include <optional>
/* Class that implements the static probe methods for "any" probe. */
@@ -280,7 +280,7 @@ collect_probes (const std::string &objname, const std::string &provider,
const std::string &probe_name, const static_probe_ops *spops)
{
std::vector<bound_probe> result;
- gdb::optional<compiled_regex> obj_pat, prov_pat, probe_pat;
+ std::optional<compiled_regex> obj_pat, prov_pat, probe_pat;
if (!provider.empty ())
prov_pat.emplace (provider.c_str (), REG_NOSUB,
@@ -683,9 +683,9 @@ disable_probes_command (const char *arg, int from_tty)
static bool ignore_probes_p = false;
static bool ignore_probes_idx = 0;
static bool ignore_probes_verbose_p;
-static gdb::optional<compiled_regex> ignore_probes_prov_pat[2];
-static gdb::optional<compiled_regex> ignore_probes_name_pat[2];
-static gdb::optional<compiled_regex> ignore_probes_obj_pat[2];
+static std::optional<compiled_regex> ignore_probes_prov_pat[2];
+static std::optional<compiled_regex> ignore_probes_name_pat[2];
+static std::optional<compiled_regex> ignore_probes_obj_pat[2];
/* See comments in probe.h. */
@@ -696,11 +696,11 @@ ignore_probe_p (const char *provider, const char *name,
if (!ignore_probes_p)
return false;
- gdb::optional<compiled_regex> &re_prov
+ std::optional<compiled_regex> &re_prov
= ignore_probes_prov_pat[ignore_probes_idx];
- gdb::optional<compiled_regex> &re_name
+ std::optional<compiled_regex> &re_name
= ignore_probes_name_pat[ignore_probes_idx];
- gdb::optional<compiled_regex> &re_obj
+ std::optional<compiled_regex> &re_obj
= ignore_probes_obj_pat[ignore_probes_idx];
bool res
@@ -755,11 +755,11 @@ ignore_probes_command (const char *arg, int from_tty)
/* Parse the regular expressions, making sure that the old regular
expressions are still valid if an exception is throw. */
int new_ignore_probes_idx = 1 - ignore_probes_idx;
- gdb::optional<compiled_regex> &re_prov
+ std::optional<compiled_regex> &re_prov
= ignore_probes_prov_pat[new_ignore_probes_idx];
- gdb::optional<compiled_regex> &re_name
+ std::optional<compiled_regex> &re_name
= ignore_probes_name_pat[new_ignore_probes_idx];
- gdb::optional<compiled_regex> &re_obj
+ std::optional<compiled_regex> &re_obj
= ignore_probes_obj_pat[new_ignore_probes_idx];
re_prov.reset ();
re_name.reset ();