gdb: Remove uses of gdb::to_string (const std::string_view &)

This patch removes all uses of to_string(const std::string_view&) and
use the std::string ctor or implicit conversion from std::string_view to
std::string instead.

A later patch will remove this gdb::to_string while removing
gdbsupport/gdb_string_view.h.

Change-Id: I877cde557a0727be7b0435107e3c7a2aac165895
Approved-By: Tom Tromey <tom@tromey.com>
Approved-By: Pedro Alves <pedro@palves.net>
This commit is contained in:
Lancelot Six
2023-10-13 10:54:46 +00:00
parent 8082468ffe
commit 882b050516
6 changed files with 24 additions and 33 deletions

View File

@@ -20,7 +20,6 @@
#include "diagnostics.h"
#include <errno.h>
#include "gdbsupport/scoped_fd.h"
#include "gdbsupport/gdb_string_view.h"
#include "debuginfod-support.h"
#include <optional>
#include "cli/cli-cmds.h"
@@ -265,8 +264,7 @@ debuginfod_is_enabled ()
gdb_printf
(_(" <%ps>\n"),
styled_string (file_name_style.style (),
gdb::to_string (url_view.substr (0,
off)).c_str ()));
std::string (url_view.substr (0, off)).c_str ()));
if (off == std::string_view::npos)
break;
url_view = url_view.substr (off);