diff options
author | Lancelot Six <lancelot.six@amd.com> | 2023-10-13 10:17:02 +0000 |
---|---|---|
committer | Lancelot Six <lancelot.six@amd.com> | 2023-11-21 11:52:36 +0000 |
commit | 8082468ffe65095cdd640fb081b9d3d28dd7add4 (patch) | |
tree | 4e9ab5a6ad254f77e96e295d873a1d5b31cf44fa /gdb/elfread.c | |
parent | 42742fc5817a8f2e47c711880501073a9ad86cfc (diff) | |
download | gdb-8082468ffe65095cdd640fb081b9d3d28dd7add4.zip gdb-8082468ffe65095cdd640fb081b9d3d28dd7add4.tar.gz gdb-8082468ffe65095cdd640fb081b9d3d28dd7add4.tar.bz2 |
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>
Diffstat (limited to 'gdb/elfread.c')
-rw-r--r-- | gdb/elfread.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/elfread.c b/gdb/elfread.c index 86e7f61..5dc8f21 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -45,7 +45,7 @@ #include "auxv.h" #include "mdebugread.h" #include "ctfread.h" -#include "gdbsupport/gdb_string_view.h" +#include <string_view> #include "gdbsupport/scoped_fd.h" #include "dwarf2/public.h" #include "cli/cli-cmds.h" @@ -195,7 +195,7 @@ elf_locate_sections (asection *sectp, struct elfinfo *ei) static struct minimal_symbol * record_minimal_symbol (minimal_symbol_reader &reader, - gdb::string_view name, bool copy_name, + std::string_view name, bool copy_name, unrelocated_addr address, enum minimal_symbol_type ms_type, asection *bfd_section, struct objfile *objfile) @@ -503,7 +503,7 @@ elf_symtab_read (minimal_symbol_reader &reader, && !is_plt && (elf_sym->version & VERSYM_HIDDEN) == 0) record_minimal_symbol (reader, - gdb::string_view (sym->name, len), + std::string_view (sym->name, len), true, unrelocated_addr (symaddr), ms_type, sym->section, objfile); else if (is_plt) @@ -517,7 +517,7 @@ elf_symtab_read (minimal_symbol_reader &reader, struct minimal_symbol *mtramp; mtramp = record_minimal_symbol - (reader, gdb::string_view (sym->name, len), true, + (reader, std::string_view (sym->name, len), true, unrelocated_addr (symaddr), mst_solib_trampoline, sym->section, objfile); if (mtramp) |