From 6b09f1342cf2d8e2b13a0d634acc3bcf2852a73b Mon Sep 17 00:00:00 2001 From: Lancelot Six Date: Fri, 13 Oct 2023 09:27:48 +0000 Subject: 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 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 Approved-By: Pedro Alves --- gdb/solib-aix.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'gdb/solib-aix.c') diff --git a/gdb/solib-aix.c b/gdb/solib-aix.c index 0fc3a15..1a70f98 100644 --- a/gdb/solib-aix.c +++ b/gdb/solib-aix.c @@ -65,7 +65,7 @@ struct solib_aix_inferior_data the same principles applied to shared libraries also apply to the main executable. So it's simpler to keep it as part of this list. */ - gdb::optional> library_list; + std::optional> library_list; }; /* Key to our per-inferior data. */ @@ -91,7 +91,7 @@ get_solib_aix_inferior_data (struct inferior *inf) /* Dummy implementation if XML support is not compiled in. */ -static gdb::optional> +static std::optional> solib_aix_parse_libraries (const char *library) { static int have_warned; @@ -201,7 +201,7 @@ static const struct gdb_xml_element library_list_elements[] = Return an empty option if the parsing failed. */ -static gdb::optional> +static std::optional> solib_aix_parse_libraries (const char *library) { std::vector result; @@ -225,7 +225,7 @@ solib_aix_parse_libraries (const char *library) is not NULL, then print a warning including WARNING_MSG and a description of the error. */ -static gdb::optional> & +static std::optional> & solib_aix_get_library_list (struct inferior *inf, const char *warning_msg) { struct solib_aix_inferior_data *data; @@ -235,7 +235,7 @@ solib_aix_get_library_list (struct inferior *inf, const char *warning_msg) if (data->library_list.has_value ()) return data->library_list; - gdb::optional library_document + std::optional library_document = target_read_stralloc (current_inferior ()->top_target (), TARGET_OBJECT_LIBRARIES_AIX, NULL); @@ -421,7 +421,7 @@ solib_aix_solib_create_inferior_hook (int from_tty) /* We need to relocate the main executable... */ - gdb::optional> &library_list + std::optional> &library_list = solib_aix_get_library_list (current_inferior (), warning_msg); if (!library_list.has_value ()) return; /* Warning already printed. */ @@ -448,7 +448,7 @@ solib_aix_solib_create_inferior_hook (int from_tty) static intrusive_list solib_aix_current_sos () { - gdb::optional> &library_list + std::optional> &library_list = solib_aix_get_library_list (current_inferior (), NULL); if (!library_list.has_value ()) return {}; -- cgit v1.1