From 8082468ffe65095cdd640fb081b9d3d28dd7add4 Mon Sep 17 00:00:00 2001 From: Lancelot Six Date: Fri, 13 Oct 2023 10:17:02 +0000 Subject: gdb: Use std::string_view instead of gdb::string_view Given that GDB now requires a C++17, replace all uses of gdb::string_view with std::string_view. This change has mostly been done automatically: - gdb::string_view -> std::string_view - #include "gdbsupport/gdb_string_view.h" -> #include One things which got brought up during review is that gdb::stging_view does support being built from "nullptr" while std::sting_view does not. Two places are manually adjusted to account for this difference: gdb/tui/tui-io.c:tui_getc_1 and gdbsupport/format.h:format_piece::format_piece. The above automatic change transformed "gdb::to_string (const gdb::string_view &)" into "gdb::to_string (const std::string_view &)". The various direct users of this function are now explicitly including "gdbsupport/gdb_string_view.h". A later patch will remove the users of gdb::to_string. The implementation and tests of gdb::string_view are unchanged, they will be removed in a following patch. Change-Id: Ibb806a7e9c79eb16a55c87c6e41ad396fecf0207 Approved-By: Tom Tromey Approved-By: Pedro Alves --- gdb/cli/cli-script.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gdb/cli') diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c index 8ec5689..b355a6d 100644 --- a/gdb/cli/cli-script.c +++ b/gdb/cli/cli-script.c @@ -35,7 +35,7 @@ #include "extension.h" #include "interps.h" #include "compile/compile.h" -#include "gdbsupport/gdb_string_view.h" +#include #include "python/python.h" #include "guile/guile.h" @@ -103,7 +103,7 @@ private: std::string m_command_line; /* The arguments. Each element points inside M_COMMAND_LINE. */ - std::vector m_args; + std::vector m_args; }; /* The stack of arguments passed to user defined functions. We need a -- cgit v1.1