]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb: Use std::string_view instead of gdb::string_view
authorLancelot Six <lancelot.six@amd.com>
Fri, 13 Oct 2023 10:17:02 +0000 (10:17 +0000)
committerLancelot Six <lancelot.six@amd.com>
Tue, 21 Nov 2023 11:52:36 +0000 (11:52 +0000)
commit8082468ffe65095cdd640fb081b9d3d28dd7add4
tree4e9ab5a6ad254f77e96e295d873a1d5b31cf44fa
parent42742fc5817a8f2e47c711880501073a9ad86cfc
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 <string_view>

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 <tom@tromey.com>
Approved-By: Pedro Alves <pedro@palves.net>
31 files changed:
gdb/ada-lang.c
gdb/amdgpu-tdep.c
gdb/cli/cli-script.c
gdb/dbxread.c
gdb/debuginfod-support.c
gdb/dwarf2/cooked-index.c
gdb/dwarf2/cooked-index.h
gdb/dwarf2/index-common.c
gdb/dwarf2/index-common.h
gdb/dwarf2/read.c
gdb/elfread.c
gdb/eval.c
gdb/language.c
gdb/linux-tdep.c
gdb/mdebugread.c
gdb/minsyms.c
gdb/minsyms.h
gdb/psymtab.c
gdb/psymtab.h
gdb/solib-rocm.c
gdb/split-name.c
gdb/split-name.h
gdb/stabsread.c
gdb/symtab.c
gdb/symtab.h
gdb/tui/tui-io.c
gdb/tui/tui-win.c
gdb/xcoffread.c
gdbsupport/common-utils.h
gdbsupport/format.h
gdbsupport/gdb_string_view.h