[2/4] Rename gdb::array_view to gdb::span

Message ID 20261103-span-part-1-v1-2-133180dd43a5@adacore.com
State New
Headers
Series Rename gdb::array_view to gdb::span |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm pending Build did not complete; will be retriggered
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 pending Build did not complete; will be retriggered

Commit Message

Tom Tromey Nov. 3, 2026, 7:18 p.m. UTC
  This rename gdb::array_view to gdb::span.  The long term idea here is
to eventually use the C++20 std::span.

This rename was mostly done by a perl script.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31422
---
 gdb/aarch64-tdep.c                       |  18 +--
 gdb/ada-lang.c                           |   6 +-
 gdb/ada-typeprint.c                      |   4 +-
 gdb/ada-valprint.c                       |   2 +-
 gdb/amd64-tdep.c                         |   2 +-
 gdb/amd64-windows-tdep.c                 |   6 +-
 gdb/arch/arm-get-next-pcs.c              |   2 +-
 gdb/arm-pikeos-tdep.c                    |   2 +-
 gdb/arm-tdep.c                           |  10 +-
 gdb/block.c                              |   4 +-
 gdb/block.h                              |  16 +--
 gdb/breakpoint.c                         |  14 +--
 gdb/breakpoint.h                         |   6 +-
 gdb/cli/cli-cmds.c                       |   4 +-
 gdb/cli/cli-option.c                     |  16 +--
 gdb/cli/cli-option.h                     |  12 +-
 gdb/compile/compile-loc2c.c              |  12 +-
 gdb/compile/compile-object-load.c        |   4 +-
 gdb/compile/compile.h                    |   4 +-
 gdb/corelow.c                            |   2 +-
 gdb/cp-support.c                         |   2 +-
 gdb/cp-support.h                         |   2 +-
 gdb/dicos-tdep.c                         |   2 +-
 gdb/disasm-selftests.c                   |   6 +-
 gdb/disasm.c                             |   4 +-
 gdb/displaced-stepping.h                 |   2 +-
 gdb/dwarf2/attribute.h                   |   2 +-
 gdb/dwarf2/call-site.h                   |   4 +-
 gdb/dwarf2/expr.c                        |  16 +--
 gdb/dwarf2/expr.h                        |  16 +--
 gdb/dwarf2/frame.c                       |   4 +-
 gdb/dwarf2/frame.h                       |   6 +-
 gdb/dwarf2/index-cache.c                 |   6 +-
 gdb/dwarf2/index-cache.h                 |   2 +-
 gdb/dwarf2/index-write.c                 |   2 +-
 gdb/dwarf2/loc.c                         |  32 ++---
 gdb/dwarf2/loc.h                         |  18 +--
 gdb/dwarf2/read-gdb-index.c              |  24 ++--
 gdb/dwarf2/read-gdb-index.h              |   4 +-
 gdb/dwarf2/read.c                        |  42 +++----
 gdb/dwarf2/read.h                        |   2 +-
 gdb/elfread.c                            |   2 +-
 gdb/eval.c                               |  10 +-
 gdb/expression.h                         |   2 +-
 gdb/extension.c                          |   2 +-
 gdb/extension.h                          |   6 +-
 gdb/extract-store-integer.c              |  12 +-
 gdb/extract-store-integer.h              |  16 +--
 gdb/f-lang.c                             |   2 +-
 gdb/fbsd-nat.c                           |   2 +-
 gdb/fbsd-nat.h                           |   2 +-
 gdb/findvar.c                            |   4 +-
 gdb/frame-unwind.c                       |   4 +-
 gdb/frame-unwind.h                       |   2 +-
 gdb/frame.c                              |  22 ++--
 gdb/frame.h                              |  18 +--
 gdb/gdb-gdb.gdb                          |   2 +-
 gdb/gdb_bfd.c                            |   2 +-
 gdb/gdb_bfd.h                            |   2 +-
 gdb/gdbarch-gen.c                        |   2 +-
 gdb/gdbarch-gen.h                        |   4 +-
 gdb/gdbarch_components.py                |   2 +-
 gdb/gdbthread.h                          |   2 +-
 gdb/gdbtypes.c                           |  12 +-
 gdb/gdbtypes.h                           |  22 ++--
 gdb/gmp-utils.c                          |   8 +-
 gdb/gmp-utils.h                          |  14 +--
 gdb/i386-tdep.c                          |   2 +-
 gdb/i386-tdep.h                          |   2 +-
 gdb/i386-windows-tdep.c                  |   2 +-
 gdb/infcall.c                            |   6 +-
 gdb/infcall.h                            |   4 +-
 gdb/inferior.h                           |   2 +-
 gdb/linux-nat.c                          |   4 +-
 gdb/linux-nat.h                          |   4 +-
 gdb/linux-thread-db.c                    |   4 +-
 gdb/main.c                               |   2 +-
 gdb/minsyms.c                            |   6 +-
 gdb/mips-tdep.c                          |   8 +-
 gdb/nat/x86-linux.c                      |   4 +-
 gdb/nat/x86-linux.h                      |   4 +-
 gdb/netbsd-nat.c                         |   2 +-
 gdb/netbsd-nat.h                         |   2 +-
 gdb/objfiles.c                           |   4 +-
 gdb/objfiles.h                           |   2 +-
 gdb/procfs.c                             |   4 +-
 gdb/python/py-connection.c               |   6 +-
 gdb/python/py-inferior.c                 |   4 +-
 gdb/python/py-infthread.c                |   2 +-
 gdb/python/py-unwind.c                   |   2 +-
 gdb/python/py-value.c                    |   4 +-
 gdb/python/py-wrappers.h                 |   2 +-
 gdb/python/py-xmethods.c                 |   8 +-
 gdb/python/python.c                      |   2 +-
 gdb/ravenscar-thread.h                   |   4 +-
 gdb/regcache.c                           |  56 ++++-----
 gdb/regcache.h                           |  36 +++---
 gdb/remote.c                             |  28 ++---
 gdb/remote.h                             |   6 +-
 gdb/rust-lang.c                          |   2 +-
 gdb/solib-darwin.c                       |   2 +-
 gdb/solib.c                              |   2 +-
 gdb/source.c                             |   2 +-
 gdb/symtab.c                             |   4 +-
 gdb/symtab.h                             |   6 +-
 gdb/target-debug.h                       |   6 +-
 gdb/target-delegates-gen.c               |  44 +++----
 gdb/target.c                             |   8 +-
 gdb/target.h                             |  18 +--
 gdb/thread.c                             |   2 +-
 gdb/trad-frame.c                         |   2 +-
 gdb/trad-frame.h                         |   6 +-
 gdb/unittests/intrusive_list-selftests.c |   2 +-
 gdb/unittests/span-selftests.c           | 206 +++++++++++++++----------------
 gdb/utils.c                              |   4 +-
 gdb/valarith.c                           |  22 ++--
 gdb/valops.c                             |  36 +++---
 gdb/value.c                              |  50 ++++----
 gdb/value.h                              |  30 ++---
 gdb/windows-tdep.c                       |   6 +-
 gdb/windows-tdep.h                       |   4 +-
 gdb/x86-linux-nat.c                      |   4 +-
 gdb/xcoffread.c                          |   2 +-
 gdbserver/linux-x86-low.cc               |   4 +-
 gdbserver/regcache.cc                    |   8 +-
 gdbserver/regcache.h                     |   4 +-
 gdbserver/server.cc                      |   2 +-
 gdbserver/target.cc                      |   2 +-
 gdbserver/target.h                       |   2 +-
 gdbsupport/buildargv.h                   |   8 +-
 gdbsupport/common-inferior.cc            |   8 +-
 gdbsupport/common-inferior.h             |   2 +-
 gdbsupport/common-regcache.h             |   4 +-
 gdbsupport/common-utils.cc               |   2 +-
 gdbsupport/common-utils.h                |   2 +-
 gdbsupport/pathstuff.cc                  |   2 +-
 gdbsupport/pathstuff.h                   |   4 +-
 gdbsupport/remote-args.h                 |   2 +-
 gdbsupport/rsp-low.cc                    |   2 +-
 gdbsupport/rsp-low.h                     |   2 +-
 gdbsupport/selftest.cc                   |   2 +-
 gdbsupport/selftest.h                    |   2 +-
 gdbsupport/span.h                        |  88 ++++++-------
 143 files changed, 686 insertions(+), 686 deletions(-)
  

Patch

diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
index 109fca6bf11..ffd553fd981 100644
--- a/gdb/aarch64-tdep.c
+++ b/gdb/aarch64-tdep.c
@@ -3556,7 +3556,7 @@  aarch64_pseudo_read_value (gdbarch *gdbarch, const frame_info_ptr &next_frame,
 static void
 aarch64_pseudo_write_1 (gdbarch *gdbarch, const frame_info_ptr &next_frame,
 			int regnum_offset,
-			gdb::array_view<const gdb_byte> buf)
+			gdb::span<const gdb_byte> buf)
 {
   unsigned raw_regnum = AARCH64_V0_REGNUM + regnum_offset;
 
@@ -3569,7 +3569,7 @@  aarch64_pseudo_write_1 (gdbarch *gdbarch, const frame_info_ptr &next_frame,
   gdb::byte_vector raw_buf (register_size (gdbarch, raw_regnum), 0);
   static_assert (AARCH64_V0_REGNUM == AARCH64_SVE_Z0_REGNUM);
 
-  gdb::array_view<gdb_byte> raw_view (raw_buf);
+  gdb::span<gdb_byte> raw_view (raw_buf);
   copy (buf, raw_view.slice (0, buf.size ()));
   put_frame_register (next_frame, raw_regnum, raw_view);
 }
@@ -3580,7 +3580,7 @@  aarch64_pseudo_write_1 (gdbarch *gdbarch, const frame_info_ptr &next_frame,
 static void
 aarch64_sme_pseudo_register_write (gdbarch *gdbarch, const frame_info_ptr &next_frame,
 				   const int regnum,
-				   gdb::array_view<const gdb_byte> data)
+				   gdb::span<const gdb_byte> data)
 {
   aarch64_gdbarch_tdep *tdep = gdbarch_tdep<aarch64_gdbarch_tdep> (gdbarch);
 
@@ -3598,15 +3598,15 @@  aarch64_sme_pseudo_register_write (gdbarch *gdbarch, const frame_info_ptr &next_
 
   {
     /* Create a view only on the portion of za we want to write.  */
-    gdb::array_view<gdb_byte> za_view
+    gdb::span<gdb_byte> za_view
       = za_value->contents_writeable ().slice (offsets.starting_offset);
 
     /* Copy the requested data.  */
     for (int chunks = 0; chunks < offsets.chunks; chunks++)
       {
-	gdb::array_view<const gdb_byte> src
+	gdb::span<const gdb_byte> src
 	  = data.slice (chunks * offsets.chunk_size, offsets.chunk_size);
-	gdb::array_view<gdb_byte> dst
+	gdb::span<gdb_byte> dst
 	  = za_view.slice (chunks * offsets.stride_size, offsets.chunk_size);
 	copy (src, dst);
       }
@@ -3624,7 +3624,7 @@  static void
 aarch64_poe_pseudo_register_write (gdbarch *gdbarch,
 				   const frame_info_ptr &next_frame,
 				   const int pseudo_reg_num,
-				   gdb::array_view<const gdb_byte> data)
+				   gdb::span<const gdb_byte> data)
 {
   aarch64_gdbarch_tdep *tdep
     = gdbarch_tdep<aarch64_gdbarch_tdep> (gdbarch);
@@ -3664,7 +3664,7 @@  aarch64_poe_pseudo_register_write (gdbarch *gdbarch,
 static void
 aarch64_pseudo_write (gdbarch *gdbarch, const frame_info_ptr &next_frame,
 		      const int pseudo_reg_num,
-		      gdb::array_view<const gdb_byte> buf)
+		      gdb::span<const gdb_byte> buf)
 {
   aarch64_gdbarch_tdep *tdep = gdbarch_tdep<aarch64_gdbarch_tdep> (gdbarch);
 
@@ -3682,7 +3682,7 @@  aarch64_pseudo_write (gdbarch *gdbarch, const frame_info_ptr &next_frame,
 
       /* First zero-out the contents of X.  */
       gdb_byte bytes[8] {};
-      gdb::array_view<gdb_byte> bytes_view (bytes);
+      gdb::span<gdb_byte> bytes_view (bytes);
       copy (buf, bytes_view.slice (offset, 4));
 
       /* Write to the bottom 4 bytes of X.  */
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 567ab69a4fe..5d20f3eb2b1 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -2584,7 +2584,7 @@  decode_constrained_packed_array (struct value *arr)
      sizes.  */
   const gdb_byte *valaddr = arr->contents_for_printing ().data ();
   CORE_ADDR address = arr->address ();
-  gdb::array_view<const gdb_byte> view
+  gdb::span<const gdb_byte> view
     = gdb::make_array_view (valaddr, type->length ());
   type = resolve_dynamic_type (type, view, address);
   recursively_update_array_bitsize (type);
@@ -6360,7 +6360,7 @@  value_tag_from_contents_and_address (struct type *type,
   int tag_byte_offset;
   struct type *tag_type;
 
-  gdb::array_view<const gdb_byte> contents;
+  gdb::span<const gdb_byte> contents;
   if (valaddr != nullptr)
     contents = gdb::make_array_view (valaddr, type->length ());
   struct type *resolved_type = resolve_dynamic_type (type, contents, address);
@@ -9203,7 +9203,7 @@  ada_promote_array_of_integrals (struct type *type, struct value *val)
     error (_("unable to determine array bounds"));
 
   value *res = value::allocate (type);
-  gdb::array_view<gdb_byte> res_contents = res->contents_writeable ();
+  gdb::span<gdb_byte> res_contents = res->contents_writeable ();
 
   /* Promote each array element.  */
   for (i = 0; i < hi - lo + 1; i++)
diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c
index 15045a02f35..5e2bf675c12 100644
--- a/gdb/ada-typeprint.c
+++ b/gdb/ada-typeprint.c
@@ -649,7 +649,7 @@  print_selected_record_field_types (struct type *type, struct type *outer_type,
 }
 
 static void print_record_field_types_dynamic
-  (const gdb::array_view<variant_part> &parts,
+  (const gdb::span<variant_part> &parts,
    int from, int to, struct type *type, struct ui_file *stream,
    int show, int level, const struct type_print_options *flags);
 
@@ -735,7 +735,7 @@  print_variant_part (const variant_part &part,
    and TO are the range of fields to print.  */
 
 static void
-print_record_field_types_dynamic (const gdb::array_view<variant_part> &parts,
+print_record_field_types_dynamic (const gdb::span<variant_part> &parts,
 				  int from, int to,
 				  struct type *type, struct ui_file *stream,
 				  int show, int level,
diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c
index 7bb5e1394b0..a533c83a6c8 100644
--- a/gdb/ada-valprint.c
+++ b/gdb/ada-valprint.c
@@ -852,7 +852,7 @@  ada_value_print_inner (struct value *val, struct ui_file *stream, int recurse,
 
   const gdb_byte *valaddr = val->contents_for_printing ().data ();
   CORE_ADDR address = val->address ();
-  gdb::array_view<const gdb_byte> view
+  gdb::span<const gdb_byte> view
     = gdb::make_array_view (valaddr, type->length ());
   type = ada_check_typedef (resolve_dynamic_type (type, view, address));
   if (type != saved_type)
diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
index 18b8f2a4c0b..60c89bf5e7f 100644
--- a/gdb/amd64-tdep.c
+++ b/gdb/amd64-tdep.c
@@ -527,7 +527,7 @@  amd64_pseudo_register_read_value (gdbarch *gdbarch, const frame_info_ptr &next_f
 
 static void
 amd64_pseudo_register_write (gdbarch *gdbarch, const frame_info_ptr &next_frame,
-			     int regnum, gdb::array_view<const gdb_byte> buf)
+			     int regnum, gdb::span<const gdb_byte> buf)
 {
   i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
 
diff --git a/gdb/amd64-windows-tdep.c b/gdb/amd64-windows-tdep.c
index 68dd2f354fe..33b149f8de4 100644
--- a/gdb/amd64-windows-tdep.c
+++ b/gdb/amd64-windows-tdep.c
@@ -205,7 +205,7 @@  static void
 amd64_windows_store_arg_in_reg (struct regcache *regcache,
 				struct value *arg, int regno)
 {
-  gdb::array_view<const gdb_byte> valbuf = arg->contents ();
+  gdb::span<const gdb_byte> valbuf = arg->contents ();
   /* We only set 8 bytes, buf if it's a XMM register, 16 bytes are read.  */
   std::array<gdb_byte, 16> buf {};
 
@@ -213,7 +213,7 @@  amd64_windows_store_arg_in_reg (struct regcache *regcache,
   std::copy (valbuf.begin (), valbuf.end (), buf.begin ());
   size_t reg_size = regcache->register_size (regno);
   gdb_assert (reg_size <= buf.size ());
-  gdb::array_view<gdb_byte> view (buf);
+  gdb::span<gdb_byte> view (buf);
   regcache->cooked_write (regno, view.slice (0, reg_size));
 }
 
@@ -1337,7 +1337,7 @@  static const gdb_byte amd64_sigdelayed_bytes[] = {
   /* 4 bytes for tls::stackptr operand.  */
 };
 
-static const gdb::array_view<const gdb_byte> amd64_sig_patterns[] {
+static const gdb::span<const gdb_byte> amd64_sig_patterns[] {
   { amd64_sigbe_bytes },
   { amd64_sigdelayed_bytes },
 };
diff --git a/gdb/arch/arm-get-next-pcs.c b/gdb/arch/arm-get-next-pcs.c
index 4f5ecc36fee..8ea93c3193a 100644
--- a/gdb/arch/arm-get-next-pcs.c
+++ b/gdb/arch/arm-get-next-pcs.c
@@ -42,7 +42,7 @@  arm_get_next_pcs_ctor (struct arm_get_next_pcs *self,
 /* Return true if INSN matches one of the <value,mask> pairs in MATCHES.  */
 
 static bool
-insn_matches (uint32_t insn, gdb::array_view<const uint32_t> matches)
+insn_matches (uint32_t insn, gdb::span<const uint32_t> matches)
 {
   gdb_assert (matches.size () % 2 == 0);
 
diff --git a/gdb/arm-pikeos-tdep.c b/gdb/arm-pikeos-tdep.c
index 8b84cc3f68a..e2704fb0c38 100644
--- a/gdb/arm-pikeos-tdep.c
+++ b/gdb/arm-pikeos-tdep.c
@@ -48,7 +48,7 @@  arm_pikeos_osabi_sniffer (bfd *abfd)
      OS ABI sniffers are called before the minimal symtabs are
      created. So inspect the symbol table using BFD.  */
 
-  gdb::array_view<asymbol *> symbol_table
+  gdb::span<asymbol *> symbol_table
     = gdb_bfd_canonicalize_symtab (abfd, false);
 
   if (symbol_table.empty ())
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index bffd5d22199..94b11e1715d 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -9868,7 +9868,7 @@  arm_neon_quad_write (struct gdbarch *gdbarch, struct regcache *regcache,
 
 static void
 arm_neon_quad_write (gdbarch *gdbarch, const frame_info_ptr &next_frame,
-		     int quad_reg_index, gdb::array_view<const gdb_byte> buf)
+		     int quad_reg_index, gdb::span<const gdb_byte> buf)
 {
   std::string raw_reg_name = string_printf ("d%d", quad_reg_index << 1);
   int double_regnum
@@ -9881,7 +9881,7 @@  arm_neon_quad_write (gdbarch *gdbarch, const frame_info_ptr &next_frame,
 
 static void
 arm_mve_pseudo_write (gdbarch *gdbarch, const frame_info_ptr &next_frame,
-		      int pseudo_reg_num, gdb::array_view<const gdb_byte> buf)
+		      int pseudo_reg_num, gdb::span<const gdb_byte> buf)
 {
   arm_gdbarch_tdep *tdep = gdbarch_tdep<arm_gdbarch_tdep> (gdbarch);
 
@@ -9892,7 +9892,7 @@  arm_mve_pseudo_write (gdbarch *gdbarch, const frame_info_ptr &next_frame,
 static void
 arm_pseudo_write (gdbarch *gdbarch, const frame_info_ptr &next_frame,
 		  const int pseudo_reg_num,
-		  gdb::array_view<const gdb_byte> buf)
+		  gdb::span<const gdb_byte> buf)
 {
   arm_gdbarch_tdep *tdep = gdbarch_tdep<arm_gdbarch_tdep> (gdbarch);
 
@@ -14761,7 +14761,7 @@  arm_record_test (void)
 class test_arm_instruction_reader : public arm_instruction_reader
 {
 public:
-  explicit test_arm_instruction_reader (gdb::array_view<const uint32_t> insns)
+  explicit test_arm_instruction_reader (gdb::span<const uint32_t> insns)
     : m_insns (insns)
   {}
 
@@ -14774,7 +14774,7 @@  class test_arm_instruction_reader : public arm_instruction_reader
   }
 
 private:
-  const gdb::array_view<const uint32_t> m_insns;
+  const gdb::span<const uint32_t> m_insns;
 };
 
 static void
diff --git a/gdb/block.c b/gdb/block.c
index ae9af08acb8..cb449591d21 100644
--- a/gdb/block.c
+++ b/gdb/block.c
@@ -372,7 +372,7 @@  block::static_link () const
 
 void
 block::relocate (struct objfile *objfile,
-		 gdb::array_view<const CORE_ADDR> offsets)
+		 gdb::span<const CORE_ADDR> offsets)
 {
   int block_line_section = SECT_OFF_TEXT (objfile);
 
@@ -874,7 +874,7 @@  blockvector::~blockvector ()
 
 void
 blockvector::relocate (struct objfile *objfile,
-		       gdb::array_view<const CORE_ADDR> offsets)
+		       gdb::span<const CORE_ADDR> offsets)
 {
   int block_line_section = SECT_OFF_TEXT (objfile);
 
diff --git a/gdb/block.h b/gdb/block.h
index 2fc1bdea919..69f980e2c2d 100644
--- a/gdb/block.h
+++ b/gdb/block.h
@@ -157,7 +157,7 @@  struct block : public allocate_on_obstack<block>
   { m_multidict = multidict; }
 
   /* Return a view on this block's ranges.  */
-  gdb::array_view<blockrange> ranges ()
+  gdb::span<blockrange> ranges ()
   {
     if (m_ranges == nullptr)
       return {};
@@ -166,7 +166,7 @@  struct block : public allocate_on_obstack<block>
   }
 
   /* Const version of the above.  */
-  gdb::array_view<const blockrange> ranges () const
+  gdb::span<const blockrange> ranges () const
   {
     if (m_ranges == nullptr)
       return {};
@@ -319,7 +319,7 @@  struct block : public allocate_on_obstack<block>
      objfile holding this block, and OFFSETS is the relocation offsets
      to use.  */
   void relocate (struct objfile *objfile,
-		 gdb::array_view<const CORE_ADDR> offsets);
+		 gdb::span<const CORE_ADDR> offsets);
 
 private:
 
@@ -435,17 +435,17 @@  struct blockvector
   DISABLE_COPY_AND_ASSIGN (blockvector);
 
   /* Return a view on the blocks of this blockvector.  */
-  gdb::array_view<struct block *> blocks ()
+  gdb::span<struct block *> blocks ()
   {
-    return gdb::array_view<struct block *> (m_blocks.data (),
+    return gdb::span<struct block *> (m_blocks.data (),
 					    m_blocks.size ());
   }
 
   /* Const version of the above.  */
-  gdb::array_view<const struct block *const> blocks () const
+  gdb::span<const struct block *const> blocks () const
   {
     const struct block **blocks = (const struct block **) m_blocks.data ();
-    return gdb::array_view<const struct block *const> (blocks,
+    return gdb::span<const struct block *const> (blocks,
 						       m_blocks.size ());
   }
 
@@ -519,7 +519,7 @@  struct blockvector
      the objfile holding this blockvector, and OFFSETS is the
      relocation offsets to use.  */
   void relocate (struct objfile *objfile,
-		 gdb::array_view<const CORE_ADDR> offsets);
+		 gdb::span<const CORE_ADDR> offsets);
 
 private:
   /* An address map mapping addresses to blocks in this blockvector.
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 9370bc0ac26..187e14c8f2b 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -794,7 +794,7 @@  maintenance_info_source_tracking_context (const char *args, int from_tty)
    empty structure if capture fails.  Does not print the lines.  */
 
 static breakpoint_source
-breakpoint_source_capture (gdb::array_view<const symtab_and_line> sals,
+breakpoint_source_capture (gdb::span<const symtab_and_line> sals,
 			   int num_of_lines)
 {
   /* Check if we have a valid symtab - if not, we can't capture source lines.
@@ -9032,7 +9032,7 @@  update_dprintf_commands (const char *args, int from_tty,
 
 code_breakpoint::code_breakpoint (struct gdbarch *gdbarch_,
 				  enum bptype type_,
-				  gdb::array_view<const symtab_and_line> sals,
+				  gdb::span<const symtab_and_line> sals,
 				  location_spec_up &&locspec_,
 				  gdb::unique_xmalloc_ptr<char> filter_,
 				  gdb::unique_xmalloc_ptr<char> cond_string_,
@@ -9161,7 +9161,7 @@  code_breakpoint::code_breakpoint (struct gdbarch *gdbarch_,
 
 static void
 create_breakpoint_sal (struct gdbarch *gdbarch,
-		       gdb::array_view<const symtab_and_line> sals,
+		       gdb::span<const symtab_and_line> sals,
 		       location_spec_up &&locspec,
 		       gdb::unique_xmalloc_ptr<char> filter,
 		       gdb::unique_xmalloc_ptr<char> cond_string,
@@ -9377,7 +9377,7 @@  breakpoint_sals_to_pc (std::vector<symtab_and_line> &sals)
 
 static void
 check_fast_tracepoint_sals (struct gdbarch *gdbarch,
-			    gdb::array_view<const symtab_and_line> sals)
+			    gdb::span<const symtab_and_line> sals)
 {
   for (const auto &sal : sals)
     {
@@ -11340,7 +11340,7 @@  clear_command (const char *arg, int from_tty)
 
   std::vector<symtab_and_line> decoded_sals;
   symtab_and_line last_sal;
-  gdb::array_view<symtab_and_line> sals;
+  gdb::span<symtab_and_line> sals;
   if (arg)
     {
       decoded_sals
@@ -13285,8 +13285,8 @@  breakpoint::steal_locations (program_space *pspace)
 void
 update_breakpoint_locations (code_breakpoint *b,
 			     struct program_space *filter_pspace,
-			     gdb::array_view<const symtab_and_line> sals,
-			     gdb::array_view<const symtab_and_line> sals_end)
+			     gdb::span<const symtab_and_line> sals,
+			     gdb::span<const symtab_and_line> sals_end)
 {
   if (!sals_end.empty () && (sals.size () != 1 || sals_end.size () != 1))
     {
diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
index 5a70785382a..62567db141c 100644
--- a/gdb/breakpoint.h
+++ b/gdb/breakpoint.h
@@ -950,7 +950,7 @@  struct code_breakpoint : public breakpoint
      expression.  If LOCATION is NULL then create an "address
      location" from the address in the SAL.  */
   code_breakpoint (struct gdbarch *gdbarch, bptype type,
-		   gdb::array_view<const symtab_and_line> sals,
+		   gdb::span<const symtab_and_line> sals,
 		   location_spec_up &&locspec,
 		   gdb::unique_xmalloc_ptr<char> filter,
 		   gdb::unique_xmalloc_ptr<char> cond_string,
@@ -1532,8 +1532,8 @@  extern void until_break_command (const char *, int, int);
 extern void update_breakpoint_locations
   (code_breakpoint *b,
    struct program_space *filter_pspace,
-   gdb::array_view<const symtab_and_line> sals,
-   gdb::array_view<const symtab_and_line> sals_end);
+   gdb::span<const symtab_and_line> sals,
+   gdb::span<const symtab_and_line> sals_end);
 
 extern void breakpoint_re_set (void);
 
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index 7aca84ff09a..41bd40d38c6 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -73,7 +73,7 @@ 
 
 static void print_sal_location (const symtab_and_line &sal);
 
-static void ambiguous_line_spec (gdb::array_view<const symtab_and_line> sals,
+static void ambiguous_line_spec (gdb::span<const symtab_and_line> sals,
 				 const char *format, ...)
   ATTRIBUTE_PRINTF (2, 3);
 
@@ -2332,7 +2332,7 @@  print_sal_location (const symtab_and_line &sal)
    ambiguous.  */
 
 static void
-ambiguous_line_spec (gdb::array_view<const symtab_and_line> sals,
+ambiguous_line_spec (gdb::span<const symtab_and_line> sals,
 		     const char *format, ...)
 {
   va_list ap;
diff --git a/gdb/cli/cli-option.c b/gdb/cli/cli-option.c
index ded79adaa14..e836c5358ab 100644
--- a/gdb/cli/cli-option.c
+++ b/gdb/cli/cli-option.c
@@ -152,7 +152,7 @@  find_end_options_delimiter (const char *args)
 /* Complete TEXT/WORD on all options in OPTIONS_GROUP.  */
 
 static void
-complete_on_options (gdb::array_view<const option_def_group> options_group,
+complete_on_options (gdb::span<const option_def_group> options_group,
 		     completion_tracker &tracker,
 		     const char *text, const char *word)
 {
@@ -170,7 +170,7 @@  complete_on_options (gdb::array_view<const option_def_group> options_group,
 
 void
 complete_on_all_options (completion_tracker &tracker,
-			 gdb::array_view<const option_def_group> options_group)
+			 gdb::span<const option_def_group> options_group)
 {
   static const char opt[] = "-";
   complete_on_options (options_group, tracker, opt + 1, opt);
@@ -180,7 +180,7 @@  complete_on_all_options (completion_tracker &tracker,
    whole ARGS line included the "--" options-terminator delimiter.  */
 
 static std::optional<option_def_and_value>
-parse_option (gdb::array_view<const option_def_group> options_group,
+parse_option (gdb::span<const option_def_group> options_group,
 	      process_options_mode mode,
 	      bool have_delimiter,
 	      const char **args,
@@ -570,7 +570,7 @@  bool
 complete_options (completion_tracker &tracker,
 		  const char **args,
 		  process_options_mode mode,
-		  gdb::array_view<const option_def_group> options_group)
+		  gdb::span<const option_def_group> options_group)
 {
   const char *text = *args;
 
@@ -734,7 +734,7 @@  save_option_value_in_ctx (std::optional<option_def_and_value> &ov)
 bool
 process_options (const char **args,
 		 process_options_mode mode,
-		 gdb::array_view<const option_def_group> options_group)
+		 gdb::span<const option_def_group> options_group)
 {
   if (*args == nullptr)
     return false;
@@ -866,7 +866,7 @@  append_indented_doc (const char *doc, std::string &help)
    OPTIONS.  */
 
 static void
-build_help_option (gdb::array_view<const option_def> options,
+build_help_option (gdb::span<const option_def> options,
 		   std::string &help)
 {
   std::string buffer;
@@ -895,7 +895,7 @@  build_help_option (gdb::array_view<const option_def> options,
 
 std::string
 build_help (const char *help_tmpl,
-	    gdb::array_view<const option_def_group> options_group)
+	    gdb::span<const option_def_group> options_group)
 {
   bool need_newlines = false;
   std::string help_str;
@@ -924,7 +924,7 @@  build_help (const char *help_tmpl,
 void
 add_setshow_cmds_for_options (command_class cmd_class,
 			      void *data,
-			      gdb::array_view<const option_def> options,
+			      gdb::span<const option_def> options,
 			      struct cmd_list_element **set_list,
 			      struct cmd_list_element **show_list)
 {
diff --git a/gdb/cli/cli-option.h b/gdb/cli/cli-option.h
index 99a8db2f8c7..560b189ffc9 100644
--- a/gdb/cli/cli-option.h
+++ b/gdb/cli/cli-option.h
@@ -354,7 +354,7 @@  struct color_option_def : option_def
 struct option_def_group
 {
   /* The list of options.  */
-  gdb::array_view<const option_def> options;
+  gdb::span<const option_def> options;
 
   /* The context pointer to pass to the options' get-current-value
      callbacks.  */
@@ -385,7 +385,7 @@  enum process_options_mode
 extern bool process_options
   (const char **args,
    process_options_mode mode,
-   gdb::array_view<const option_def_group> options_group);
+   gdb::span<const option_def_group> options_group);
 
 /* Complete ARGS on options listed by OPTIONS_GROUP.  Returns true if
    the string has been fully parsed and there are no operands to
@@ -395,25 +395,25 @@  extern bool complete_options
   (completion_tracker &tracker,
    const char **args,
    process_options_mode mode,
-   gdb::array_view<const option_def_group> options_group);
+   gdb::span<const option_def_group> options_group);
 
 /* Complete on all options listed by OPTIONS_GROUP.  */
 extern void
   complete_on_all_options (completion_tracker &tracker,
-			   gdb::array_view<const option_def_group> options_group);
+			   gdb::span<const option_def_group> options_group);
 
 /* Return a string with the result of replacing %OPTIONS% in HELP_TMLP
    with an auto-generated "help" string fragment for all the options
    in OPTIONS_GROUP.  */
 extern std::string build_help
   (const char *help_tmpl,
-   gdb::array_view<const option_def_group> options_group);
+   gdb::span<const option_def_group> options_group);
 
 /* Install set/show commands for options defined in OPTIONS.  DATA is
    a pointer to the structure that holds the data associated with the
    OPTIONS array.  */
 extern void add_setshow_cmds_for_options (command_class cmd_class, void *data,
-					  gdb::array_view<const option_def> options,
+					  gdb::span<const option_def> options,
 					  struct cmd_list_element **set_list,
 					  struct cmd_list_element **show_list);
 
diff --git a/gdb/compile/compile-loc2c.c b/gdb/compile/compile-loc2c.c
index 5e208a86563..add5f6f6620 100644
--- a/gdb/compile/compile-loc2c.c
+++ b/gdb/compile/compile-loc2c.c
@@ -77,7 +77,7 @@  compute_stack_depth_worker (int start, int *need_tempvar,
 			    std::vector<struct insn_info> *info,
 			    std::vector<int> *to_do,
 			    enum bfd_endian byte_order, unsigned int addr_size,
-			    gdb::array_view<const gdb_byte> expr)
+			    gdb::span<const gdb_byte> expr)
 {
   const gdb_byte *const base = expr.data ();
   const gdb_byte *op_ptr = expr.data ();
@@ -390,7 +390,7 @@  compute_stack_depth_worker (int start, int *need_tempvar,
 static int
 compute_stack_depth (enum bfd_endian byte_order, unsigned int addr_size,
 		     int *need_tempvar, int *is_tls,
-		     gdb::array_view<const gdb_byte> expr,
+		     gdb::span<const gdb_byte> expr,
 		     int initial_depth,
 		     std::vector<struct insn_info> *info)
 {
@@ -596,7 +596,7 @@  do_compile_dwarf_expr_to_c (int indent, string_file *stream,
 			    struct gdbarch *arch,
 			    std::vector<bool> &registers_used,
 			    unsigned int addr_size,
-			    gdb::array_view<const gdb_byte> expr,
+			    gdb::span<const gdb_byte> expr,
 			    CORE_ADDR *initial,
 			    dwarf2_per_cu *per_cu,
 			    dwarf2_per_objfile *per_objfile)
@@ -1074,7 +1074,7 @@  do_compile_dwarf_expr_to_c (int indent, string_file *stream,
 	    int regnum;
 	    CORE_ADDR text_offset;
 	    LONGEST off;
-	    gdb::array_view<const gdb_byte> cfa_expr;
+	    gdb::span<const gdb_byte> cfa_expr;
 
 	    if (dwarf2_fetch_cfa_info (arch, pc, per_cu, &regnum, &off,
 				       &text_offset, cfa_expr))
@@ -1144,7 +1144,7 @@  compile_dwarf_expr_to_c (string_file *stream, const char *result_name,
 			 struct gdbarch *arch,
 			 std::vector<bool> &registers_used,
 			 unsigned int addr_size,
-			 gdb::array_view<const gdb_byte> expr,
+			 gdb::span<const gdb_byte> expr,
 			 dwarf2_per_cu *per_cu,
 			 dwarf2_per_objfile *per_objfile)
 {
@@ -1163,7 +1163,7 @@  compile_dwarf_bounds_to_c (string_file *stream,
 			   struct gdbarch *arch,
 			   std::vector<bool> &registers_used,
 			   unsigned int addr_size,
-			   gdb::array_view<const gdb_byte> expr,
+			   gdb::span<const gdb_byte> expr,
 			   dwarf2_per_cu *per_cu,
 			   dwarf2_per_objfile *per_objfile)
 {
diff --git a/gdb/compile/compile-object-load.c b/gdb/compile/compile-object-load.c
index a70282c4e0c..5378f2e7895 100644
--- a/gdb/compile/compile-object-load.c
+++ b/gdb/compile/compile-object-load.c
@@ -333,7 +333,7 @@  struct link_hash_table_cleanup_data
 
 static void
 copy_section (bfd *abfd, asection *sect,
-	      gdb::array_view<asymbol *> symbol_table)
+	      gdb::span<asymbol *> symbol_table)
 {
   bfd_byte *sect_data_got;
   struct bfd_link_info link_info;
@@ -689,7 +689,7 @@  compile_object_load (const compile_file_names &file_names,
 	   GCC_FE_WRAPPER_FUNCTION,
 	   styled_string (file_name_style.style (), objfile_name (objfile)));
 
-  gdb::array_view<asymbol *> symbol_table
+  gdb::span<asymbol *> symbol_table
     = gdb_bfd_canonicalize_symtab (abfd.get ());
 
   missing_symbols = 0;
diff --git a/gdb/compile/compile.h b/gdb/compile/compile.h
index 15fc22cb62c..060adbaa2e4 100644
--- a/gdb/compile/compile.h
+++ b/gdb/compile/compile.h
@@ -213,7 +213,7 @@  extern void compile_dwarf_expr_to_c (string_file *stream,
 				     struct gdbarch *arch,
 				     std::vector<bool> &registers_used,
 				     unsigned int addr_size,
-				     gdb::array_view<const gdb_byte> expr,
+				     gdb::span<const gdb_byte> expr,
 				     dwarf2_per_cu *per_cu,
 				     dwarf2_per_objfile *per_objfile);
 
@@ -251,7 +251,7 @@  extern void compile_dwarf_bounds_to_c (string_file *stream,
 				       struct gdbarch *arch,
 				       std::vector<bool> &registers_used,
 				       unsigned int addr_size,
-				       gdb::array_view<const gdb_byte> expr,
+				       gdb::span<const gdb_byte> expr,
 				       dwarf2_per_cu *per_cu,
 				       dwarf2_per_objfile *per_objfile);
 
diff --git a/gdb/corelow.c b/gdb/corelow.c
index cd36882a12c..249e50ddc60 100644
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -1190,7 +1190,7 @@  core_target_open (const char *arg, int from_tty)
       std::vector<char *> argv;
       for (const gdb::unique_xmalloc_ptr<char> &a : ctx.args ())
 	argv.push_back (a.get ());
-      gdb::array_view<char * const> view (argv.data (), argv.size ());
+      gdb::span<char * const> view (argv.data (), argv.size ());
       current_inferior ()->set_args (view, true);
 
       /* And now copy the environment.  */
diff --git a/gdb/cp-support.c b/gdb/cp-support.c
index 7a1b07a3b16..51c836a06d0 100644
--- a/gdb/cp-support.c
+++ b/gdb/cp-support.c
@@ -1354,7 +1354,7 @@  add_symbol_overload_list_adl_namespace (struct type *type,
    FUNC_NAME found through argument dependent lookup.  */
 
 void
-add_symbol_overload_list_adl (gdb::array_view<type *> arg_types,
+add_symbol_overload_list_adl (gdb::span<type *> arg_types,
 			      const char *func_name,
 			      std::vector<symbol *> *overload_list)
 {
diff --git a/gdb/cp-support.h b/gdb/cp-support.h
index dfb6865831b..b3040506c8a 100644
--- a/gdb/cp-support.h
+++ b/gdb/cp-support.h
@@ -114,7 +114,7 @@  extern std::vector<symbol *> make_symbol_overload_list (const char *,
 							const char *);
 
 extern void add_symbol_overload_list_adl
-  (gdb::array_view<type *> arg_types,
+  (gdb::span<type *> arg_types,
    const char *func_name,
    std::vector<symbol *> *overload_list);
 
diff --git a/gdb/dicos-tdep.c b/gdb/dicos-tdep.c
index 805889174d1..0d0c865faa5 100644
--- a/gdb/dicos-tdep.c
+++ b/gdb/dicos-tdep.c
@@ -73,7 +73,7 @@  dicos_load_module_p (bfd *abfd, int header_size)
   /* Dicos LMs always have a "Dicos_loadModuleInfo" symbol
      defined.  Look for it.  */
 
-  gdb::array_view<asymbol *> symbol_table
+  gdb::span<asymbol *> symbol_table
     = gdb_bfd_canonicalize_symtab (abfd, false);
 
   for (asymbol *sym : symbol_table)
diff --git a/gdb/disasm-selftests.c b/gdb/disasm-selftests.c
index 485c1245118..90b16b2f8c1 100644
--- a/gdb/disasm-selftests.c
+++ b/gdb/disasm-selftests.c
@@ -334,7 +334,7 @@  memory_error_test (struct gdbarch *gdbarch)
 
 static std::string
 disassemble_one_insn_to_string (struct gdbarch *gdbarch,
-				gdb::array_view<const gdb_byte> insn)
+				gdb::span<const gdb_byte> insn)
 {
   string_file buffer;
 
@@ -343,7 +343,7 @@  disassemble_one_insn_to_string (struct gdbarch *gdbarch,
   public:
 
     explicit gdb_disassembler_test (struct gdbarch *gdbarch,
-				    gdb::array_view<const gdb_byte> insn,
+				    gdb::span<const gdb_byte> insn,
 				    string_file &buffer)
       : gdb_disassembler (gdbarch,
 			  &buffer,
@@ -366,7 +366,7 @@  disassemble_one_insn_to_string (struct gdbarch *gdbarch,
     }
 
   private:
-    gdb::array_view<const gdb_byte> m_insn;
+    gdb::span<const gdb_byte> m_insn;
 
     static int read_memory (bfd_vma memaddr, gdb_byte *myaddr,
 			    unsigned int len,
diff --git a/gdb/disasm.c b/gdb/disasm.c
index 01361fe4323..5c4fbf616dd 100644
--- a/gdb/disasm.c
+++ b/gdb/disasm.c
@@ -1224,7 +1224,7 @@  struct gdb_non_printing_buffer_disassembler
      contains the instruction to disassemble, and INSN_ADDRESS is the
      address (in target memory) of the instruction to disassemble.  */
   gdb_non_printing_buffer_disassembler (struct gdbarch *gdbarch,
-					gdb::array_view<const gdb_byte> buffer,
+					gdb::span<const gdb_byte> buffer,
 					CORE_ADDR insn_address)
     : gdb_non_printing_disassembler (gdbarch, nullptr)
   {
@@ -1242,7 +1242,7 @@  int
 gdb_buffered_insn_length (struct gdbarch *gdbarch,
 			  const gdb_byte *insn, int max_len, CORE_ADDR addr)
 {
-  gdb::array_view<const gdb_byte> buffer
+  gdb::span<const gdb_byte> buffer
     = gdb::make_array_view (insn, max_len);
   gdb_non_printing_buffer_disassembler dis (gdbarch, buffer, addr);
   int result = gdb_print_insn_1 (gdbarch, addr, dis.disasm_info ());
diff --git a/gdb/displaced-stepping.h b/gdb/displaced-stepping.h
index e0bb77a3fff..e2bd9d21003 100644
--- a/gdb/displaced-stepping.h
+++ b/gdb/displaced-stepping.h
@@ -193,7 +193,7 @@  struct displaced_step_thread_state
 
 struct displaced_step_buffers
 {
-  explicit displaced_step_buffers (gdb::array_view<CORE_ADDR> buffer_addrs)
+  explicit displaced_step_buffers (gdb::span<CORE_ADDR> buffer_addrs)
   {
     gdb_assert (buffer_addrs.size () > 0);
 
diff --git a/gdb/dwarf2/attribute.h b/gdb/dwarf2/attribute.h
index f2648747d9c..1cd772e861e 100644
--- a/gdb/dwarf2/attribute.h
+++ b/gdb/dwarf2/attribute.h
@@ -34,7 +34,7 @@ 
 struct dwarf_block
 {
   /* Return the contents of this block.  */
-  gdb::array_view<const gdb_byte> view () const
+  gdb::span<const gdb_byte> view () const
   { return gdb::make_array_view (data, size); }
 
   size_t size;
diff --git a/gdb/dwarf2/call-site.h b/gdb/dwarf2/call-site.h
index cfd2953cce1..b6d13f9649b 100644
--- a/gdb/dwarf2/call-site.h
+++ b/gdb/dwarf2/call-site.h
@@ -144,12 +144,12 @@  union call_site_parameter_u
 struct call_site_parameter
 {
   /* Return the DW_AT_call_value DWARF expression.  */
-  gdb::array_view<const gdb_byte> value_expr () const
+  gdb::span<const gdb_byte> value_expr () const
   { return gdb::make_array_view (value, value_size); }
 
   /* Return the DW_AT_call_data_value DWARF expression.  Returns an empty
      view if not provided by DWARF.  */
-  gdb::array_view<const gdb_byte> data_value_expr () const
+  gdb::span<const gdb_byte> data_value_expr () const
   { return gdb::make_array_view (data_value, data_value_size); }
 
   call_site_parameter_kind kind : 2;
diff --git a/gdb/dwarf2/expr.c b/gdb/dwarf2/expr.c
index 306d8a43187..196a2dcc259 100644
--- a/gdb/dwarf2/expr.c
+++ b/gdb/dwarf2/expr.c
@@ -825,7 +825,7 @@  dwarf_expr_context::fetch (int n)
 
 /* See expr.h.  */
 
-gdb::array_view<const gdb_byte>
+gdb::span<const gdb_byte>
 dwarf_expr_context::get_frame_base ()
 {
   ensure_have_frame (this->m_frame, "DW_OP_fbreg");
@@ -1158,7 +1158,7 @@  dwarf_expr_context::fetch_result (struct type *type, struct type *subobj_type,
 /* See expr.h.  */
 
 value *
-dwarf_expr_context::evaluate (gdb::array_view<const gdb_byte> expr,
+dwarf_expr_context::evaluate (gdb::span<const gdb_byte> expr,
 			      bool as_lval, dwarf2_per_cu *per_cu,
 			      const frame_info_ptr &frame,
 			      const struct property_addr_info *addr_info,
@@ -1327,7 +1327,7 @@  dwarf_expr_context::add_piece (ULONGEST size, ULONGEST offset,
 /* Evaluate the expression EXPR.  */
 
 void
-dwarf_expr_context::eval (gdb::array_view<const gdb_byte> expr)
+dwarf_expr_context::eval (gdb::span<const gdb_byte> expr)
 {
   int old_recursion_depth = this->m_recursion_depth;
 
@@ -1408,7 +1408,7 @@  base_types_equal_p (struct type *t1, struct type *t2)
    DWARF register number.  Otherwise return -1.  */
 
 int
-dwarf_block_to_dwarf_reg (gdb::array_view<const gdb_byte> block)
+dwarf_block_to_dwarf_reg (gdb::span<const gdb_byte> block)
 {
   uint64_t dwarf_reg;
   const gdb_byte *buf = block.data ();
@@ -1453,7 +1453,7 @@  dwarf_block_to_dwarf_reg (gdb::array_view<const gdb_byte> block)
    DW_OP_deref_size.  */
 
 int
-dwarf_block_to_dwarf_reg_deref (gdb::array_view<const gdb_byte> block,
+dwarf_block_to_dwarf_reg_deref (gdb::span<const gdb_byte> block,
 				CORE_ADDR *deref_size_return)
 {
   uint64_t dwarf_reg;
@@ -1513,7 +1513,7 @@  dwarf_block_to_dwarf_reg_deref (gdb::array_view<const gdb_byte> block,
 /* See expr.h.  */
 
 bool
-dwarf_block_to_fb_offset (gdb::array_view<const gdb_byte> block,
+dwarf_block_to_fb_offset (gdb::span<const gdb_byte> block,
 			  CORE_ADDR *fb_offset_return)
 {
   int64_t fb_offset;
@@ -1541,7 +1541,7 @@  dwarf_block_to_fb_offset (gdb::array_view<const gdb_byte> block,
 
 bool
 dwarf_block_to_sp_offset (struct gdbarch *gdbarch,
-			  gdb::array_view<const gdb_byte> block,
+			  gdb::span<const gdb_byte> block,
 			  CORE_ADDR *sp_offset_return)
 {
   uint64_t dwarf_reg;
@@ -1606,7 +1606,7 @@  trivial_entry_value (frame_info_ptr frame)
    object, evaluate the expression EXPR.  */
 
 void
-dwarf_expr_context::execute_stack_op (gdb::array_view<const gdb_byte> expr)
+dwarf_expr_context::execute_stack_op (gdb::span<const gdb_byte> expr)
 {
   gdbarch *arch = this->m_per_objfile->objfile->arch ();
   bfd_endian byte_order = gdbarch_byte_order (arch);
diff --git a/gdb/dwarf2/expr.h b/gdb/dwarf2/expr.h
index 02b0e41f6fd..0ea887464b3 100644
--- a/gdb/dwarf2/expr.h
+++ b/gdb/dwarf2/expr.h
@@ -139,7 +139,7 @@  struct dwarf_expr_context
 
      The ADDR_INFO property can be specified to override the range of
      memory addresses with the passed in buffer.  */
-  value *evaluate (gdb::array_view<const gdb_byte> expr, bool as_lval,
+  value *evaluate (gdb::span<const gdb_byte> expr, bool as_lval,
 		   dwarf2_per_cu *per_cu, const frame_info_ptr &frame,
 		   const struct property_addr_info *addr_info = nullptr,
 		   struct type *type = nullptr,
@@ -207,12 +207,12 @@  struct dwarf_expr_context
   /* Property address info used for the evaluation.  */
   const struct property_addr_info *m_addr_info = nullptr;
 
-  void eval (gdb::array_view<const gdb_byte> expr);
+  void eval (gdb::span<const gdb_byte> expr);
   struct type *address_type () const;
   void push (struct value *value, bool in_stack_memory);
   bool stack_empty_p () const;
   void add_piece (ULONGEST size, ULONGEST offset, enum dwarf_location_atom op);
-  void execute_stack_op (gdb::array_view<const gdb_byte> expr);
+  void execute_stack_op (gdb::span<const gdb_byte> expr);
   void pop ();
   struct value *fetch (int n);
   CORE_ADDR fetch_address (int n);
@@ -229,7 +229,7 @@  struct dwarf_expr_context
   /* Return the location expression for the frame base attribute.  The
      result must be live until the current expression evaluation is
      complete.  */
-  gdb::array_view<const gdb_byte> get_frame_base ();
+  gdb::span<const gdb_byte> get_frame_base ();
 
   /* Return the base type given by the indicated DIE at DIE_CU_OFF.
      This can throw an exception if the DIE is invalid or does not
@@ -268,16 +268,16 @@  CORE_ADDR read_addr_from_reg (const frame_info_ptr &frame, int reg);
 void dwarf_expr_require_composition (const gdb_byte *, const gdb_byte *,
 				     const char *);
 
-int dwarf_block_to_dwarf_reg (gdb::array_view<const gdb_byte> block);
+int dwarf_block_to_dwarf_reg (gdb::span<const gdb_byte> block);
 
-int dwarf_block_to_dwarf_reg_deref (gdb::array_view<const gdb_byte> block,
+int dwarf_block_to_dwarf_reg_deref (gdb::span<const gdb_byte> block,
 				    CORE_ADDR *deref_size_return);
 
 /* If BLOCK contains DW_FORM_block* with single DW_OP_fbreg(X) fill in
    FB_OFFSET_RETURN with the X offset and return true.  Otherwise return
    false.  */
 
-bool dwarf_block_to_fb_offset (gdb::array_view<const gdb_byte> block,
+bool dwarf_block_to_fb_offset (gdb::span<const gdb_byte> block,
 			       CORE_ADDR *fb_offset_return);
 
 /* If BLOCK contains DW_FORM_block* with single DW_OP_bregSP(X) fill in
@@ -285,7 +285,7 @@  bool dwarf_block_to_fb_offset (gdb::array_view<const gdb_byte> block,
    false.  The matched SP register number depends on GDBARCH.  */
 
 bool dwarf_block_to_sp_offset (struct gdbarch *gdbarch,
-			       gdb::array_view<const gdb_byte> block,
+			       gdb::span<const gdb_byte> block,
 			       CORE_ADDR *sp_offset_return);
 
 /* Wrappers around the leb128 reader routines to simplify them for our
diff --git a/gdb/dwarf2/frame.c b/gdb/dwarf2/frame.c
index 95e9f1e7c34..be003142e04 100644
--- a/gdb/dwarf2/frame.c
+++ b/gdb/dwarf2/frame.c
@@ -225,7 +225,7 @@  register %s (#%d) at %s"),
 }
 
 static CORE_ADDR
-execute_stack_op (gdb::array_view<const gdb_byte> expr, int addr_size,
+execute_stack_op (gdb::span<const gdb_byte> expr, int addr_size,
 		  const frame_info_ptr &this_frame, CORE_ADDR initial,
 		  int initial_in_stack_memory, dwarf2_per_objfile *per_objfile)
 {
@@ -755,7 +755,7 @@  bool
 dwarf2_fetch_cfa_info (struct gdbarch *gdbarch, CORE_ADDR pc,
 		       dwarf2_per_cu *data, int *regnum_out,
 		       LONGEST *offset_out, CORE_ADDR *text_offset_out,
-		       gdb::array_view<const gdb_byte> &cfa_expr_out)
+		       gdb::span<const gdb_byte> &cfa_expr_out)
 {
   struct dwarf2_fde *fde;
   dwarf2_per_objfile *per_objfile;
diff --git a/gdb/dwarf2/frame.h b/gdb/dwarf2/frame.h
index 6462d008cc2..4a4fbeabeda 100644
--- a/gdb/dwarf2/frame.h
+++ b/gdb/dwarf2/frame.h
@@ -79,7 +79,7 @@  struct dwarf2_frame_state_reg
     struct
     {
       /* Return this expression.  */
-      gdb::array_view<const gdb_byte> view () const
+      gdb::span<const gdb_byte> view () const
       { return gdb::make_array_view (start, len); }
 
       const gdb_byte *start;
@@ -147,7 +147,7 @@  struct dwarf2_frame_state_reg_info
   LONGEST cfa_offset = 0;
   ULONGEST cfa_reg = 0;
   enum cfa_how_kind cfa_how = CFA_UNSET;
-  gdb::array_view<const gdb_byte> cfa_exp;
+  gdb::span<const gdb_byte> cfa_exp;
 
   /* Used to implement DW_CFA_remember_state.  */
   struct dwarf2_frame_state_reg_info *prev = NULL;
@@ -265,7 +265,7 @@  CORE_ADDR dwarf2_frame_cfa (const frame_info_ptr &this_frame);
 extern bool dwarf2_fetch_cfa_info
   (struct gdbarch *gdbarch, CORE_ADDR pc, dwarf2_per_cu *data, int *regnum_out,
    LONGEST *offset_out, CORE_ADDR *text_offset_out,
-   gdb::array_view<const gdb_byte> &cfa_expr_out);
+   gdb::span<const gdb_byte> &cfa_expr_out);
 
 /* Allocate a new instance of the function unique data.
 
diff --git a/gdb/dwarf2/index-cache.c b/gdb/dwarf2/index-cache.c
index 0e0aca3ac6d..abeb0c6a497 100644
--- a/gdb/dwarf2/index-cache.c
+++ b/gdb/dwarf2/index-cache.c
@@ -200,7 +200,7 @@  struct index_cache_resource_mmap final : public index_cache_resource
 
 /* See dwarf-index-cache.h.  */
 
-gdb::array_view<const gdb_byte>
+gdb::span<const gdb_byte>
 index_cache::lookup_gdb_index (const bfd_build_id *build_id,
 			       index_cache_resource_up *resource)
 {
@@ -229,7 +229,7 @@  index_cache::lookup_gdb_index (const bfd_build_id *build_id,
       /* Yay, it worked!  Hand the resource to the caller.  */
       resource->reset (mmap_resource);
 
-      return gdb::array_view<const gdb_byte>
+      return gdb::span<const gdb_byte>
 	  ((const gdb_byte *) mmap_resource->mapping.get (),
 	   mmap_resource->mapping.size ());
     }
@@ -246,7 +246,7 @@  index_cache::lookup_gdb_index (const bfd_build_id *build_id,
 
 /* See dwarf-index-cache.h.  This is a no-op on unsupported systems.  */
 
-gdb::array_view<const gdb_byte>
+gdb::span<const gdb_byte>
 index_cache::lookup_gdb_index (const bfd_build_id *build_id,
 			       index_cache_resource_up *resource)
 {
diff --git a/gdb/dwarf2/index-cache.h b/gdb/dwarf2/index-cache.h
index 9ee51137d3b..de6a81e11f4 100644
--- a/gdb/dwarf2/index-cache.h
+++ b/gdb/dwarf2/index-cache.h
@@ -89,7 +89,7 @@  class index_cache
      as RESOURCE is not destroyed.
 
      If no matching index file is found, return an empty array view.  */
-  gdb::array_view<const gdb_byte>
+  gdb::span<const gdb_byte>
   lookup_gdb_index (const bfd_build_id *build_id,
 		    index_cache_resource_up *resource);
 
diff --git a/gdb/dwarf2/index-write.c b/gdb/dwarf2/index-write.c
index 4712f08515c..e9112aa3f19 100644
--- a/gdb/dwarf2/index-write.c
+++ b/gdb/dwarf2/index-write.c
@@ -96,7 +96,7 @@  class data_buf
 {
 public:
   /* Copy ARRAY to the end of the buffer.  */
-  void append_array (gdb::array_view<const gdb_byte> array)
+  void append_array (gdb::span<const gdb_byte> array)
   {
     std::copy (array.begin (), array.end (), grow (array.size ()));
   }
diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c
index 15336aaf017..c10ace48563 100644
--- a/gdb/dwarf2/loc.c
+++ b/gdb/dwarf2/loc.c
@@ -50,7 +50,7 @@ 
 
 static struct value *dwarf2_evaluate_loc_desc_full
   (struct type *type, const frame_info_ptr &frame,
-   gdb::array_view<const gdb_byte> loc_desc, dwarf2_per_cu *per_cu,
+   gdb::span<const gdb_byte> loc_desc, dwarf2_per_cu *per_cu,
    dwarf2_per_objfile *per_objfile, struct type *subobj_type,
    LONGEST subobj_byte_offset, bool as_lval = true);
 
@@ -362,7 +362,7 @@  decode_debug_loc_dwo_addresses (dwarf2_per_cu *per_cu,
    For now, only return the first matching location expression; there
    can be more than one in the list.  */
 
-gdb::array_view<const gdb_byte>
+gdb::span<const gdb_byte>
 dwarf2_find_location_expression (const dwarf2_loclist_baton *baton,
 				 const CORE_ADDR pc, bool at_entry)
 {
@@ -481,7 +481,7 @@  dwarf2_find_location_expression (const dwarf2_loclist_baton *baton,
 /* Implement find_frame_base_location method for LOC_BLOCK functions using
    DWARF expression for its DW_AT_frame_base.  */
 
-static gdb::array_view<const gdb_byte>
+static gdb::span<const gdb_byte>
 locexpr_find_frame_base_location (struct symbol *framefunc, CORE_ADDR pc)
 {
   struct dwarf2_locexpr_baton *symbaton
@@ -536,7 +536,7 @@  const struct symbol_block_ops dwarf2_block_frame_base_locexpr_funcs =
 /* Implement find_frame_base_location method for LOC_BLOCK functions using
    DWARF location list for its DW_AT_frame_base.  */
 
-static gdb::array_view<const gdb_byte>
+static gdb::span<const gdb_byte>
 loclist_find_frame_base_location (struct symbol *framefunc, CORE_ADDR pc)
 {
   struct dwarf2_loclist_baton *symbaton
@@ -590,10 +590,10 @@  const struct symbol_block_ops dwarf2_block_frame_base_loclist_funcs =
 
 /* See dwarf2/loc.h.  */
 
-gdb::array_view<const gdb_byte>
+gdb::span<const gdb_byte>
 func_get_frame_base_dwarf_block (struct symbol *framefunc, CORE_ADDR pc)
 {
-  gdb::array_view<const gdb_byte> block;
+  gdb::span<const gdb_byte> block;
 
   if (const symbol_block_ops *block_ops = framefunc->block_ops ();
       block_ops != nullptr)
@@ -1380,7 +1380,7 @@  value_of_dwarf_reg_entry (struct type *type, const frame_info_ptr &frame,
 
 static struct value *
 value_of_dwarf_block_entry (struct type *type, const frame_info_ptr &frame,
-			    gdb::array_view<const gdb_byte> block)
+			    gdb::span<const gdb_byte> block)
 {
   union call_site_parameter_u kind_u;
 
@@ -1479,7 +1479,7 @@  indirect_synthetic_pointer (sect_offset die, LONGEST byte_offset,
 
 static struct value *
 dwarf2_evaluate_loc_desc_full (struct type *type, const frame_info_ptr &frame,
-			       gdb::array_view<const gdb_byte> loc_desc,
+			       gdb::span<const gdb_byte> loc_desc,
 			       dwarf2_per_cu *per_cu,
 			       dwarf2_per_objfile *per_objfile,
 			       struct type *subobj_type,
@@ -1544,7 +1544,7 @@  dwarf2_evaluate_loc_desc_full (struct type *type, const frame_info_ptr &frame,
 
 struct value *
 dwarf2_evaluate_loc_desc (struct type *type, const frame_info_ptr &frame,
-			  gdb::array_view<const gdb_byte> loc_desc,
+			  gdb::span<const gdb_byte> loc_desc,
 			  dwarf2_per_cu *per_cu,
 			  dwarf2_per_objfile *per_objfile, bool as_lval)
 {
@@ -1569,7 +1569,7 @@  dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton,
 			   const frame_info_ptr &frame,
 			   const struct property_addr_info *addr_stack,
 			   CORE_ADDR *valp,
-			   gdb::array_view<CORE_ADDR> push_values,
+			   gdb::span<CORE_ADDR> push_values,
 			   bool *is_reference)
 {
   if (dlbaton->size == 0)
@@ -1630,7 +1630,7 @@  dwarf2_evaluate_property (const dynamic_prop *prop,
 			  const frame_info_ptr &initial_frame,
 			  const property_addr_info *addr_stack,
 			  CORE_ADDR *value,
-			  gdb::array_view<CORE_ADDR> push_values)
+			  gdb::span<CORE_ADDR> push_values)
 {
   /* Evaluating a property should not change the current language.
      Without this here this could happen if the code below selects a
@@ -1792,7 +1792,7 @@  dwarf2_compile_property_to_c (string_file *stream,
 {
 #if defined (HAVE_COMPILE)
   const dwarf2_property_baton *baton = prop->baton ();
-  gdb::array_view<const gdb_byte> expr;
+  gdb::span<const gdb_byte> expr;
   dwarf2_per_cu *per_cu;
   dwarf2_per_objfile *per_objfile;
 
@@ -1826,7 +1826,7 @@  dwarf2_compile_property_to_c (string_file *stream,
    expression.  */
 
 static enum symbol_needs_kind
-dwarf2_get_symbol_read_needs (gdb::array_view<const gdb_byte> expr,
+dwarf2_get_symbol_read_needs (gdb::span<const gdb_byte> expr,
 			      dwarf2_per_cu *per_cu,
 			      dwarf2_per_objfile *per_objfile,
 			      bfd_endian byte_order,
@@ -2379,7 +2379,7 @@  access_memory (struct gdbarch *arch, struct agent_expr *expr, ULONGEST nbits)
 static void
 dwarf2_compile_expr_to_ax (struct agent_expr *ax, struct axs_value *loc,
 			   unsigned int addr_size,
-			   gdb::array_view<const gdb_byte> expr,
+			   gdb::span<const gdb_byte> expr,
 			   dwarf2_per_cu *per_cu,
 			   dwarf2_per_objfile *per_objfile)
 {
@@ -2878,7 +2878,7 @@  dwarf2_compile_expr_to_ax (struct agent_expr *ax, struct axs_value *loc,
 	    int regnum;
 	    CORE_ADDR text_offset;
 	    LONGEST off;
-	    gdb::array_view<const gdb_byte> cfa_expr;
+	    gdb::span<const gdb_byte> cfa_expr;
 
 	    if (dwarf2_fetch_cfa_info (arch, ax->scope, per_cu, &regnum,
 				       &off, &text_offset, cfa_expr))
@@ -3722,7 +3722,7 @@  show_dwarf_always_disassemble (struct ui_file *file, int from_tty,
 static void
 locexpr_describe_location_1 (struct symbol *symbol, CORE_ADDR addr,
 			     struct ui_file *stream,
-			     gdb::array_view<const gdb_byte> expr,
+			     gdb::span<const gdb_byte> expr,
 			     unsigned int addr_size,
 			     int offset_size, dwarf2_per_cu *per_cu,
 			     dwarf2_per_objfile *per_objfile)
diff --git a/gdb/dwarf2/loc.h b/gdb/dwarf2/loc.h
index 192e53318d6..bab9e270585 100644
--- a/gdb/dwarf2/loc.h
+++ b/gdb/dwarf2/loc.h
@@ -38,7 +38,7 @@  struct axs_value;
 extern unsigned int entry_values_debug;
 
 /* Find a particular location expression from a location list.  */
-gdb::array_view<const gdb_byte> dwarf2_find_location_expression
+gdb::span<const gdb_byte> dwarf2_find_location_expression
   (const dwarf2_loclist_baton *baton, CORE_ADDR pc, bool at_entry = false);
 
 /* Find the frame base information for FRAMEFUNC at PC and return the
@@ -46,7 +46,7 @@  gdb::array_view<const gdb_byte> dwarf2_find_location_expression
 
    Throw an exception if no expression is found.  */
 
-gdb::array_view<const gdb_byte> func_get_frame_base_dwarf_block
+gdb::span<const gdb_byte> func_get_frame_base_dwarf_block
   (struct symbol *framefunc, CORE_ADDR pc);
 
 /* A helper function to find the definition of NAME and compute its
@@ -72,7 +72,7 @@  call_site_parameter *dwarf_expr_reg_to_entry_parameter
    description.  */
 
 value *dwarf2_evaluate_loc_desc (type *type, const frame_info_ptr &frame,
-				 gdb::array_view<const gdb_byte> loc_desc,
+				 gdb::span<const gdb_byte> loc_desc,
 				 dwarf2_per_cu *per_cu,
 				 dwarf2_per_objfile *per_objfile,
 				 bool as_lval = true);
@@ -87,7 +87,7 @@  struct property_addr_info
   struct type *type;
 
   /* If not NULL, a buffer containing the object's value.  */
-  gdb::array_view<const gdb_byte> valaddr;
+  gdb::span<const gdb_byte> valaddr;
 
   /* The address of that object.  */
   CORE_ADDR addr;
@@ -127,11 +127,11 @@  void dwarf2_compile_property_to_c (string_file *stream,
 struct dwarf2_locexpr_baton
 {
   /* Return the expression in this baton.  */
-  gdb::array_view<const gdb_byte> expr () const
+  gdb::span<const gdb_byte> expr () const
   { return gdb::make_array_view (data, size); }
 
   /* Set the expression in this baton from EXPR.  */
-  void set_expr (gdb::array_view<const gdb_byte> expr)
+  void set_expr (gdb::span<const gdb_byte> expr)
   {
     data = expr.data ();
     size = expr.size ();
@@ -189,7 +189,7 @@  struct dwarf2_field_location_baton : public dwarf2_locexpr_baton
 struct dwarf2_loclist_baton
 {
   /* Return the location list in this baton.  */
-  gdb::array_view<const gdb_byte> expr () const
+  gdb::span<const gdb_byte> expr () const
   { return gdb::make_array_view (data, size); }
 
   /* The initial base address for the location list, based on the compilation
@@ -327,7 +327,7 @@  bool dwarf2_evaluate_property (const struct dynamic_prop *prop,
 			       const frame_info_ptr &frame,
 			       const property_addr_info *addr_stack,
 			       CORE_ADDR *value,
-			       gdb::array_view<CORE_ADDR> push_values = {});
+			       gdb::span<CORE_ADDR> push_values = {});
 
 extern struct value *value_of_dwarf_reg_entry (struct type *type,
 					       const frame_info_ptr &frame,
@@ -339,7 +339,7 @@  extern struct value *value_of_dwarf_reg_entry (struct type *type,
 static inline bool
 dwarf2_evaluate_property (const struct dynamic_prop *, const frame_info_ptr &,
 			  const property_addr_info *, CORE_ADDR *,
-			  gdb::array_view<CORE_ADDR> = {})
+			  gdb::span<CORE_ADDR> = {})
 {
   return false;
 }
diff --git a/gdb/dwarf2/read-gdb-index.c b/gdb/dwarf2/read-gdb-index.c
index 324984c0de2..c0bd6822711 100644
--- a/gdb/dwarf2/read-gdb-index.c
+++ b/gdb/dwarf2/read-gdb-index.c
@@ -94,7 +94,7 @@  class offset_view
 public:
   offset_view () = default;
 
-  explicit offset_view (gdb::array_view<const gdb_byte> bytes)
+  explicit offset_view (gdb::span<const gdb_byte> bytes)
     : m_bytes (bytes)
   {
   }
@@ -122,7 +122,7 @@  class offset_view
 
 private:
   /* The underlying bytes.  */
-  gdb::array_view<const gdb_byte> m_bytes;
+  gdb::span<const gdb_byte> m_bytes;
 };
 
 /* A worker for reading .gdb_index.  The file format is described in
@@ -138,16 +138,16 @@  struct mapped_gdb_index
   std::vector<dwarf2_per_cu *> units;
 
   /* The address table data.  */
-  gdb::array_view<const gdb_byte> address_table;
+  gdb::span<const gdb_byte> address_table;
 
   /* The symbol table, implemented as a hash table.  */
   offset_view symbol_table;
 
   /* A pointer to the constant pool.  */
-  gdb::array_view<const gdb_byte> constant_pool;
+  gdb::span<const gdb_byte> constant_pool;
 
   /* The shortcut table data.  */
-  gdb::array_view<const gdb_byte> shortcut_table;
+  gdb::span<const gdb_byte> shortcut_table;
 
   /* An address map that maps from PC to dwarf2_per_cu.  */
   addrmap_fixed *index_addrmap = nullptr;
@@ -417,7 +417,7 @@  gdb_index_worker::do_reading ()
 static bool
 read_gdb_index_from_buffer (const char *filename,
 			    bool deprecated_ok,
-			    gdb::array_view<const gdb_byte> buffer,
+			    gdb::span<const gdb_byte> buffer,
 			    mapped_gdb_index *map,
 			    const gdb_byte **cu_list,
 			    offset_type *cu_list_elements,
@@ -471,13 +471,13 @@  read_gdb_index_from_buffer (const char *filename,
   const gdb_byte *address_table = addr + metadata[i];
   const gdb_byte *address_table_end = addr + metadata[i + 1];
   map->address_table
-    = gdb::array_view<const gdb_byte> (address_table, address_table_end);
+    = gdb::span<const gdb_byte> (address_table, address_table_end);
   ++i;
 
   const gdb_byte *symbol_table = addr + metadata[i];
   const gdb_byte *symbol_table_end = addr + metadata[i + 1];
   map->symbol_table
-    = offset_view (gdb::array_view<const gdb_byte> (symbol_table,
+    = offset_view (gdb::span<const gdb_byte> (symbol_table,
 						    symbol_table_end));
 
   ++i;
@@ -487,7 +487,7 @@  read_gdb_index_from_buffer (const char *filename,
       const gdb_byte *shortcut_table = addr + metadata[i];
       const gdb_byte *shortcut_table_end = addr + metadata[i + 1];
       map->shortcut_table
-	= gdb::array_view<const gdb_byte> (shortcut_table, shortcut_table_end);
+	= gdb::span<const gdb_byte> (shortcut_table, shortcut_table_end);
       ++i;
     }
 
@@ -498,7 +498,7 @@  read_gdb_index_from_buffer (const char *filename,
       /* An empty constant pool implies that all symbol table entries are
 	 empty.  Make map->symbol_table.empty () == true.  */
       map->symbol_table
-	= offset_view (gdb::array_view<const gdb_byte> (symbol_table,
+	= offset_view (gdb::span<const gdb_byte> (symbol_table,
 							symbol_table));
     }
 
@@ -728,7 +728,7 @@  dwarf2_read_gdb_index
   dwarf2_per_bfd *per_bfd = per_objfile->per_bfd;
   scoped_remove_all_units remove_all_units (*per_bfd);
 
-  gdb::array_view<const gdb_byte> main_index_contents
+  gdb::span<const gdb_byte> main_index_contents
     = get_gdb_index_contents (objfile, per_bfd);
 
   if (main_index_contents.empty ())
@@ -755,7 +755,7 @@  dwarf2_read_gdb_index
       const gdb_byte *dwz_types_ignore;
       offset_type dwz_types_elements_ignore;
 
-      gdb::array_view<const gdb_byte> dwz_index_content
+      gdb::span<const gdb_byte> dwz_index_content
 	= get_gdb_index_contents_dwz (objfile, dwz);
 
       if (dwz_index_content.empty ())
diff --git a/gdb/dwarf2/read-gdb-index.h b/gdb/dwarf2/read-gdb-index.h
index 56e112c6cbb..58425042088 100644
--- a/gdb/dwarf2/read-gdb-index.h
+++ b/gdb/dwarf2/read-gdb-index.h
@@ -44,10 +44,10 @@  struct objfile;
 /* Callback types for dwarf2_read_gdb_index.  */
 
 using get_gdb_index_contents_ftype
-  = gdb::function_view<gdb::array_view<const gdb_byte>(objfile *,
+  = gdb::function_view<gdb::span<const gdb_byte>(objfile *,
 						       dwarf2_per_bfd *)>;
 using get_gdb_index_contents_dwz_ftype
-  = gdb::function_view<gdb::array_view<const gdb_byte>(objfile *, dwz_file *)>;
+  = gdb::function_view<gdb::span<const gdb_byte>(objfile *, dwz_file *)>;
 
 /* Read .gdb_index.  If everything went ok, initialize the "quick"
    elements of all the CUs and return true.  Otherwise, return
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 078fdd9850b..31120df4225 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -2027,7 +2027,7 @@  dwarf2_base_index_functions::has_unexpanded_symtabs (struct objfile *objfile)
    to either a dwarf2_per_bfd or dwz_file object.  */
 
 template <typename T>
-static gdb::array_view<const gdb_byte>
+static gdb::span<const gdb_byte>
 get_gdb_index_contents_from_section (objfile *obj, T *section_owner)
 {
   dwarf2_section_info *section = &section_owner->gdb_index;
@@ -2043,7 +2043,7 @@  get_gdb_index_contents_from_section (objfile *obj, T *section_owner)
   section->read (obj);
 
   /* dwarf2_section_info::size is a bfd_size_type, while
-     gdb::array_view works with size_t.  On 32-bit hosts, with
+     gdb::span works with size_t.  On 32-bit hosts, with
      --enable-64-bit-bfd, bfd_size_type is a 64-bit type, while size_t
      is 32-bit.  So we need an explicit narrowing conversion here.
      This is fine, because it's impossible to allocate or mmap an
@@ -2054,7 +2054,7 @@  get_gdb_index_contents_from_section (objfile *obj, T *section_owner)
 /* Lookup the index cache for the contents of the index associated to
    DWARF2_OBJ.  */
 
-static gdb::array_view<const gdb_byte>
+static gdb::span<const gdb_byte>
 get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_bfd *dwarf2_per_bfd)
 {
   const bfd_build_id *build_id = build_id_bfd_get (obj->obfd.get ());
@@ -2071,7 +2071,7 @@  get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_bfd *dwarf2_per_bfd)
 
 /* Same as the above, but for DWZ.  */
 
-static gdb::array_view<const gdb_byte>
+static gdb::span<const gdb_byte>
 get_gdb_index_contents_from_cache_dwz (objfile *obj, dwz_file *dwz)
 {
   const bfd_build_id *build_id = build_id_bfd_get (dwz->dwz_bfd.get ());
@@ -4003,7 +4003,7 @@  rust_fully_qualify (struct obstack *obstack, const char *p1, const char *p2)
 static void
 alloc_rust_variant (struct obstack *obstack, struct type *type,
 		    int discriminant_index, int default_index,
-		    gdb::array_view<discriminant_range> ranges)
+		    gdb::span<discriminant_range> ranges)
 {
   /* When DISCRIMINANT_INDEX == -1, we have a univariant enum.  */
   gdb_assert (discriminant_index == -1
@@ -4050,11 +4050,11 @@  alloc_rust_variant (struct obstack *obstack, struct type *type,
     = (discriminant_index == -1
        ? false
        : type->field (discriminant_index).type ()->is_unsigned ());
-  part->variants = gdb::array_view<variant> (variants, n_variants);
+  part->variants = gdb::span<variant> (variants, n_variants);
 
-  void *storage = obstack_alloc (obstack, sizeof (gdb::array_view<variant_part>));
-  gdb::array_view<variant_part> *prop_value
-    = new (storage) gdb::array_view<variant_part> (part, 1);
+  void *storage = obstack_alloc (obstack, sizeof (gdb::span<variant_part>));
+  gdb::span<variant_part> *prop_value
+    = new (storage) gdb::span<variant_part> (part, 1);
 
   struct dynamic_prop prop;
   prop.set_variant_parts (prop_value);
@@ -4287,7 +4287,7 @@  quirk_rust_enum (struct type *type, struct objfile *objfile)
 
       /* Indicate that this is a variant type.  */
       alloc_rust_variant (&objfile->objfile_obstack, type, 0, -1,
-			  gdb::array_view<discriminant_range> (ranges,
+			  gdb::span<discriminant_range> (ranges,
 							       n_fields - 1));
     }
 }
@@ -9461,7 +9461,7 @@  using offset_map_type = gdb::unordered_map<sect_offset, int>;
    process.  IS_UNSIGNED indicates whether the discriminant is signed
    or unsigned.  */
 
-static const gdb::array_view<discriminant_range>
+static const gdb::span<discriminant_range>
 convert_variant_range (struct obstack *obstack, const variant_field &variant,
 		       bool is_unsigned)
 {
@@ -9484,7 +9484,7 @@  convert_variant_range (struct obstack *obstack, const variant_field &variant,
     }
   else
     {
-      gdb::array_view<const gdb_byte> data (variant.discr_list_data->data,
+      gdb::span<const gdb_byte> data (variant.discr_list_data->data,
 					    variant.discr_list_data->size);
       while (!data.empty ())
 	{
@@ -9536,10 +9536,10 @@  convert_variant_range (struct obstack *obstack, const variant_field &variant,
   discriminant_range *result = XOBNEWVEC (obstack, discriminant_range,
 					  ranges.size ());
   std::copy (ranges.begin (), ranges.end (), result);
-  return gdb::array_view<discriminant_range> (result, ranges.size ());
+  return gdb::span<discriminant_range> (result, ranges.size ());
 }
 
-static const gdb::array_view<variant_part> create_variant_parts
+static const gdb::span<variant_part> create_variant_parts
   (struct obstack *obstack,
    const offset_map_type &offset_map,
    struct field_info *fi,
@@ -9599,7 +9599,7 @@  create_one_variant_part (variant_part &result,
     create_one_variant (output[i], obstack, offset_map, fi,
 			builder.variants[i], result.is_unsigned);
 
-  result.variants = gdb::array_view<variant> (output, n);
+  result.variants = gdb::span<variant> (output, n);
 }
 
 /* Create a vector of variant parts that can be attached to a type.
@@ -9608,7 +9608,7 @@  create_one_variant_part (variant_part &result,
    describes the fields of the type we're processing.  VARIANT_PARTS
    is the vector to convert.  */
 
-static const gdb::array_view<variant_part>
+static const gdb::span<variant_part>
 create_variant_parts (struct obstack *obstack,
 		      const offset_map_type &offset_map,
 		      struct field_info *fi,
@@ -9623,7 +9623,7 @@  create_variant_parts (struct obstack *obstack,
     create_one_variant_part (result[i], obstack, offset_map, fi,
 			     variant_parts[i]);
 
-  return gdb::array_view<variant_part> (result, n);
+  return gdb::span<variant_part> (result, n);
 }
 
 /* Compute the variant part vector for FIP, attaching it to TYPE when
@@ -9641,12 +9641,12 @@  add_variant_property (struct field_info *fip, struct type *type,
     offset_map[fip->fields[i].offset] = i;
 
   struct objfile *objfile = cu->per_objfile->objfile;
-  gdb::array_view<const variant_part> parts
+  gdb::span<const variant_part> parts
     = create_variant_parts (&objfile->objfile_obstack, offset_map, fip,
 			    fip->variant_parts);
 
   struct dynamic_prop prop;
-  prop.set_variant_parts ((gdb::array_view<variant_part> *)
+  prop.set_variant_parts ((gdb::span<variant_part> *)
 			  obstack_copy (&objfile->objfile_obstack, &parts,
 					sizeof (parts)));
 
@@ -13749,7 +13749,7 @@  cutu_reader::read_full_die (int num_extra_attrs, bool allow_reprocess)
    child, next, and parent fields.  */
 
 die_info *
-cutu_reader::read_toplevel_die (gdb::array_view<attribute *> extra_attrs)
+cutu_reader::read_toplevel_die (gdb::span<attribute *> extra_attrs)
 {
   m_cu->per_objfile->per_bfd->nr_toplevel_dies_read++;
   const gdb_byte *begin_info_ptr = m_info_ptr;
@@ -16919,7 +16919,7 @@  dwarf2_fetch_die_loc_sect_off (sect_offset sect_off, dwarf2_per_cu *per_cu,
   if (!attr)
     {
       /* DWARF: "If there is no such attribute, then there is no effect.".  */
-      retval.set_expr (gdb::array_view<const gdb_byte> ());
+      retval.set_expr (gdb::span<const gdb_byte> ());
     }
   else if (attr->form_is_section_offset ())
     {
diff --git a/gdb/dwarf2/read.h b/gdb/dwarf2/read.h
index 0ea86943ae3..ade39a38d9b 100644
--- a/gdb/dwarf2/read.h
+++ b/gdb/dwarf2/read.h
@@ -1123,7 +1123,7 @@  class cutu_reader
 
   /* Helpers to build the in-memory DIE tree.  */
 
-  die_info *read_toplevel_die (gdb::array_view<attribute *> extra_attrs = {});
+  die_info *read_toplevel_die (gdb::span<attribute *> extra_attrs = {});
 
   die_info *read_die_and_siblings (die_info *parent);
 
diff --git a/gdb/elfread.c b/gdb/elfread.c
index fcbd0176d08..2f4d326f20a 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -1106,7 +1106,7 @@  elf_read_minimal_symbols (struct objfile *objfile, int symfile_flags,
 
   /* Process the normal ELF symbol table first.  */
 
-  gdb::array_view<asymbol *> symbol_table
+  gdb::span<asymbol *> symbol_table
     = gdb_bfd_canonicalize_symtab (objfile->obfd.get ());
 
   elf_symtab_read (reader, objfile, ST_REGULAR, symbol_table.size (),
diff --git a/gdb/eval.c b/gdb/eval.c
index 17fb6723413..c5f8caa7fd5 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -582,7 +582,7 @@  evaluate_var_msym_value (enum noside noside,
 value *
 evaluate_subexp_do_call (expression *exp, enum noside noside,
 			 value *callee,
-			 gdb::array_view<value *> argvec,
+			 gdb::span<value *> argvec,
 			 const char *function_name,
 			 type *default_return_type)
 {
@@ -771,7 +771,7 @@  scope_operation::evaluate_funcall (struct type *expect_type,
 
   for (int i = 0; i < args.size (); ++i)
     argvec[i + 1] = args[i]->evaluate_with_coercion (exp, noside);
-  gdb::array_view<value *> arg_view = argvec;
+  gdb::span<value *> arg_view = argvec;
 
   value *callee = nullptr;
   if (function_name != nullptr)
@@ -820,7 +820,7 @@  structop_member_base::evaluate_funcall (struct type *expect_type,
     lhs = std::get<0> (m_storage)->evaluate (nullptr, exp, noside);
 
   std::vector<value *> vals (args.size () + 1);
-  gdb::array_view<value *> val_view = vals;
+  gdb::span<value *> val_view = vals;
   /* If the function is a virtual function, then the aggregate
      value (providing the structure) plays its part by providing
      the vtable.  Otherwise, it is just along for the ride: call
@@ -927,7 +927,7 @@  structop_base_operation::evaluate_funcall
     vals[i + 1] = args[i]->evaluate_with_coercion (exp, noside);
 
   /* The array view includes the `this' pointer.  */
-  gdb::array_view<value *> arg_view (vals);
+  gdb::span<value *> arg_view (vals);
 
   int static_memfuncp;
   value *callee;
@@ -1914,7 +1914,7 @@  eval_binop_assign_modify (struct type *expect_type, struct expression *exp,
 static struct value *
 eval_multi_subscript (struct type *expect_type, struct expression *exp,
 		      enum noside noside, value *arg1,
-		      gdb::array_view<value *> args)
+		      gdb::span<value *> args)
 {
   for (value *arg2 : args)
     {
diff --git a/gdb/expression.h b/gdb/expression.h
index ce8abb4380e..29c1d3a9bbe 100644
--- a/gdb/expression.h
+++ b/gdb/expression.h
@@ -366,7 +366,7 @@  extern expression_up parse_exp_1 (const char **, CORE_ADDR pc,
 extern struct value *evaluate_subexp_do_call (expression *exp,
 					      enum noside noside,
 					      value *callee,
-					      gdb::array_view<value *> argvec,
+					      gdb::span<value *> argvec,
 					      const char *function_name,
 					      type *default_return_type);
 
diff --git a/gdb/extension.c b/gdb/extension.c
index de3b3eb69a5..cf8b23abc33 100644
--- a/gdb/extension.c
+++ b/gdb/extension.c
@@ -994,7 +994,7 @@  xmethod_worker::get_arg_types ()
 /* See extension.h.  */
 
 struct type *
-xmethod_worker::get_result_type (value *object, gdb::array_view<value *> args)
+xmethod_worker::get_result_type (value *object, gdb::span<value *> args)
 {
   type *result_type;
 
diff --git a/gdb/extension.h b/gdb/extension.h
index cefb7edb267..694b367f2ea 100644
--- a/gdb/extension.h
+++ b/gdb/extension.h
@@ -198,7 +198,7 @@  struct xmethod_worker
   /* Invoke the xmethod encapsulated in this worker and return the result.
      The method is invoked on OBJ with arguments in the ARGS array.  */
 
-  virtual value *invoke (value *obj, gdb::array_view<value *> args) = 0;
+  virtual value *invoke (value *obj, gdb::span<value *> args) = 0;
 
   /* Return the arg types of the xmethod encapsulated in this worker.
      The type of the 'this' object is returned as the first element of
@@ -209,7 +209,7 @@  struct xmethod_worker
   /* Return the type of the result of the xmethod encapsulated in this worker.
      OBJECT and ARGS are the same as for invoke.  */
 
-  type *get_result_type (value *object, gdb::array_view<value *> args);
+  type *get_result_type (value *object, gdb::span<value *> args);
 
 private:
 
@@ -224,7 +224,7 @@  struct xmethod_worker
      The result type is stored in *RESULT_TYPE.  */
 
   virtual enum ext_lang_rc do_get_result_type
-    (struct value *obj, gdb::array_view<value *> args,
+    (struct value *obj, gdb::span<value *> args,
      struct type **result_type_ptr) = 0;
 
   /* The language the xmethod worker is implemented in.  */
diff --git a/gdb/extract-store-integer.c b/gdb/extract-store-integer.c
index 67e4534a27d..2232aa70f51 100644
--- a/gdb/extract-store-integer.c
+++ b/gdb/extract-store-integer.c
@@ -22,7 +22,7 @@ 
 
 template<typename T, typename>
 T
-extract_integer (gdb::array_view<const gdb_byte> buf, enum bfd_endian byte_order)
+extract_integer (gdb::span<const gdb_byte> buf, enum bfd_endian byte_order)
 {
   typename std::make_unsigned<T>::type retval = 0;
 
@@ -115,10 +115,10 @@  extract_integer (gdb::array_view<const gdb_byte> buf, enum bfd_endian byte_order
 }
 
 /* Explicit instantiations.  */
-template LONGEST extract_integer<LONGEST> (gdb::array_view<const gdb_byte> buf,
+template LONGEST extract_integer<LONGEST> (gdb::span<const gdb_byte> buf,
 					   enum bfd_endian byte_order);
 template ULONGEST extract_integer<ULONGEST>
-  (gdb::array_view<const gdb_byte> buf, enum bfd_endian byte_order);
+  (gdb::span<const gdb_byte> buf, enum bfd_endian byte_order);
 
 /* Treat the bytes at BUF as a pointer of type TYPE, and return the
    address it represents.  */
@@ -133,7 +133,7 @@  extract_typed_address (const gdb_byte *buf, struct type *type)
 
 template<typename T, typename>
 void
-store_integer (gdb::array_view<gdb_byte> dst, enum bfd_endian byte_order,
+store_integer (gdb::span<gdb_byte> dst, enum bfd_endian byte_order,
 	       T val)
 {
   gdb_byte *p;
@@ -161,10 +161,10 @@  store_integer (gdb::array_view<gdb_byte> dst, enum bfd_endian byte_order,
 }
 
 /* Explicit instantiations.  */
-template void store_integer (gdb::array_view<gdb_byte> dst,
+template void store_integer (gdb::span<gdb_byte> dst,
 			     bfd_endian byte_order, LONGEST val);
 
-template void store_integer (gdb::array_view<gdb_byte> dst,
+template void store_integer (gdb::span<gdb_byte> dst,
 			     bfd_endian byte_order, ULONGEST val);
 
 /* Store the address ADDR as a pointer of type TYPE at BUF, in target
diff --git a/gdb/extract-store-integer.h b/gdb/extract-store-integer.h
index b6f734d23a7..bdb5a45433e 100644
--- a/gdb/extract-store-integer.h
+++ b/gdb/extract-store-integer.h
@@ -21,10 +21,10 @@ 
 #include <type_traits>
 
 template<typename T, typename = std::is_integral<T>>
-T extract_integer (gdb::array_view<const gdb_byte>, enum bfd_endian byte_order);
+T extract_integer (gdb::span<const gdb_byte>, enum bfd_endian byte_order);
 
 static inline LONGEST
-extract_signed_integer (gdb::array_view<const gdb_byte> buf,
+extract_signed_integer (gdb::span<const gdb_byte> buf,
 			enum bfd_endian byte_order)
 {
   return extract_integer<LONGEST> (buf, byte_order);
@@ -34,12 +34,12 @@  static inline LONGEST
 extract_signed_integer (const gdb_byte *addr, int len,
 			enum bfd_endian byte_order)
 {
-  return extract_signed_integer (gdb::array_view<const gdb_byte> (addr, len),
+  return extract_signed_integer (gdb::span<const gdb_byte> (addr, len),
 				 byte_order);
 }
 
 static inline ULONGEST
-extract_unsigned_integer (gdb::array_view<const gdb_byte> buf,
+extract_unsigned_integer (gdb::span<const gdb_byte> buf,
 			  enum bfd_endian byte_order)
 {
   return extract_integer<ULONGEST> (buf, byte_order);
@@ -49,7 +49,7 @@  static inline ULONGEST
 extract_unsigned_integer (const gdb_byte *addr, int len,
 			  enum bfd_endian byte_order)
 {
-  return extract_unsigned_integer (gdb::array_view<const gdb_byte> (addr, len),
+  return extract_unsigned_integer (gdb::span<const gdb_byte> (addr, len),
 				   byte_order);
 }
 
@@ -60,7 +60,7 @@  extern CORE_ADDR extract_typed_address (const gdb_byte *buf,
    DST.  */
 
 template<typename T, typename = RequireLongest<T>>
-extern void store_integer (gdb::array_view<gdb_byte> dst,
+extern void store_integer (gdb::span<gdb_byte> dst,
 			   bfd_endian byte_order, T val);
 
 /* Take host-format integer VAL and store it as target-format integer at
@@ -77,7 +77,7 @@  store_integer (gdb_byte *addr, int len, bfd_endian byte_order, T val)
    signed integer at DST.  */
 
 static inline void
-store_signed_integer (gdb::array_view<gdb_byte> dst, bfd_endian byte_order,
+store_signed_integer (gdb::span<gdb_byte> dst, bfd_endian byte_order,
 		      LONGEST val)
 {
   return store_integer (dst, byte_order, val);
@@ -98,7 +98,7 @@  store_signed_integer (gdb_byte *addr, int len, bfd_endian byte_order,
    unsigned integer at DST.  */
 
 static inline void
-store_unsigned_integer (gdb::array_view<gdb_byte> dst, bfd_endian byte_order,
+store_unsigned_integer (gdb::span<gdb_byte> dst, bfd_endian byte_order,
 			ULONGEST val)
 {
   return store_integer (dst, byte_order, val);
diff --git a/gdb/f-lang.c b/gdb/f-lang.c
index 19ea1645970..a6566b23e88 100644
--- a/gdb/f-lang.c
+++ b/gdb/f-lang.c
@@ -1619,7 +1619,7 @@  fortran_structop_operation::evaluate (struct type *expect_type,
 	{
 	  const gdb_byte *valaddr = elt->contents_for_printing ().data ();
 	  CORE_ADDR address = elt->address ();
-	  gdb::array_view<const gdb_byte> view
+	  gdb::span<const gdb_byte> view
 	    = gdb::make_array_view (valaddr, elt_type->length ());
 	  elt_type = resolve_dynamic_type (elt_type, view, address);
 	}
diff --git a/gdb/fbsd-nat.c b/gdb/fbsd-nat.c
index cf59ae21efc..8f3ba89c8d9 100644
--- a/gdb/fbsd-nat.c
+++ b/gdb/fbsd-nat.c
@@ -2302,7 +2302,7 @@  fbsd_nat_target::remove_exec_catchpoint (int pid)
 int
 fbsd_nat_target::set_syscall_catchpoint (int pid, bool needed,
 					 int any_count,
-					 gdb::array_view<const int> syscall_counts)
+					 gdb::span<const int> syscall_counts)
 {
 
   /* Ignore the arguments.  inf-ptrace.c will use PT_SYSCALL which
diff --git a/gdb/fbsd-nat.h b/gdb/fbsd-nat.h
index 9db5fb200a8..3113238f335 100644
--- a/gdb/fbsd-nat.h
+++ b/gdb/fbsd-nat.h
@@ -114,7 +114,7 @@  class fbsd_nat_target : public inf_ptrace_target
   int remove_exec_catchpoint (int) override;
 
 #ifdef HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE
-  int set_syscall_catchpoint (int, bool, int, gdb::array_view<const int>)
+  int set_syscall_catchpoint (int, bool, int, gdb::span<const int>)
     override;
 #endif
 
diff --git a/gdb/findvar.c b/gdb/findvar.c
index daa4730eb4d..8eef9fe6e69 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -320,7 +320,7 @@  language_defn::read_var_value (struct symbol *var,
 	  store_unsigned_integer (bytes, len,
 				  type_byte_order (type),
 				  var->value_longest ());
-	  gdb::array_view<const gdb_byte> view (bytes, len);
+	  gdb::span<const gdb_byte> view (bytes, len);
 
 	  /* Value is a constant byte-sequence.  */
 	  type = resolve_dynamic_type (type, view, /* Unused address.  */ 0);
@@ -363,7 +363,7 @@  language_defn::read_var_value (struct symbol *var,
     case LOC_CONST_BYTES:
       if (is_dynamic_type (type))
 	{
-	  gdb::array_view<const gdb_byte> view (var->value_bytes (),
+	  gdb::span<const gdb_byte> view (var->value_bytes (),
 						type->length ());
 
 	  /* Value is a constant byte-sequence.  */
diff --git a/gdb/frame-unwind.c b/gdb/frame-unwind.c
index 91a3cbe7eeb..b4497af1f70 100644
--- a/gdb/frame-unwind.c
+++ b/gdb/frame-unwind.c
@@ -338,13 +338,13 @@  frame_unwind_got_constant (const frame_info_ptr &frame, int regnum,
 
 struct value *
 frame_unwind_got_bytes (const frame_info_ptr &frame, int regnum,
-			gdb::array_view<const gdb_byte> buf)
+			gdb::span<const gdb_byte> buf)
 {
   struct gdbarch *gdbarch = frame_unwind_arch (frame);
   struct value *reg_val;
 
   reg_val = value::zero (register_type (gdbarch, regnum), not_lval);
-  gdb::array_view<gdb_byte> val_contents = reg_val->contents_raw ();
+  gdb::span<gdb_byte> val_contents = reg_val->contents_raw ();
 
   /* The value's contents buffer is zeroed on allocation so if buf is
      smaller, the remaining space will be filled with zero.
diff --git a/gdb/frame-unwind.h b/gdb/frame-unwind.h
index a1edb92a4ad..972da134d8b 100644
--- a/gdb/frame-unwind.h
+++ b/gdb/frame-unwind.h
@@ -377,7 +377,7 @@  value *frame_unwind_got_constant (const frame_info_ptr &frame, int regnum,
    inside BUF.  */
 
 value *frame_unwind_got_bytes (const frame_info_ptr &frame, int regnum,
-			       gdb::array_view<const gdb_byte> buf);
+			       gdb::span<const gdb_byte> buf);
 
 /* Return a value which indicates that FRAME's saved version of REGNUM
    has a known constant (computed) value of ADDR.  Convert the
diff --git a/gdb/frame.c b/gdb/frame.c
index 6b02c5f559a..2da31ed3b6b 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -1184,7 +1184,7 @@  get_frame_func (const frame_info_ptr &this_frame)
 std::unique_ptr<readonly_detached_regcache>
 frame_save_as_regcache (const frame_info_ptr &this_frame)
 {
-  auto cooked_read = [this_frame] (int regnum, gdb::array_view<gdb_byte> buf)
+  auto cooked_read = [this_frame] (int regnum, gdb::span<gdb_byte> buf)
     {
       if (!deprecated_frame_register_read (this_frame, regnum, buf))
 	return REG_UNAVAILABLE;
@@ -1252,7 +1252,7 @@  frame_register_unwind (const frame_info_ptr &next_frame, int regnum,
 		       bool *optimizedp, bool *unavailablep,
 		       enum lval_type *lvalp, CORE_ADDR *addrp,
 		       int *realnump,
-		       gdb::array_view<gdb_byte> buffer)
+		       gdb::span<gdb_byte> buffer)
 {
   struct value *value;
 
@@ -1294,7 +1294,7 @@  frame_register_unwind (const frame_info_ptr &next_frame, int regnum,
 
 void
 frame_unwind_register (const frame_info_ptr &next_frame, int regnum,
-		       gdb::array_view<gdb_byte> buf)
+		       gdb::span<gdb_byte> buf)
 {
   bool optimized;
   bool unavailable;
@@ -1315,7 +1315,7 @@  frame_unwind_register (const frame_info_ptr &next_frame, int regnum,
 
 void
 get_frame_register (const frame_info_ptr &frame,
-		    int regnum, gdb::array_view<gdb_byte> buf)
+		    int regnum, gdb::span<gdb_byte> buf)
 {
   frame_unwind_register (frame_info_ptr (frame->next), regnum, buf);
 }
@@ -1396,7 +1396,7 @@  frame_unwind_register_value (const frame_info_ptr &next_frame, int regnum)
 	  else if (value->entirely_available ())
 	    {
 	      int i;
-	      gdb::array_view<const gdb_byte> buf = value->contents ();
+	      gdb::span<const gdb_byte> buf = value->contents ();
 
 	      gdb_printf (&debug_file, " bytes=");
 	      gdb_printf (&debug_file, "[");
@@ -1511,7 +1511,7 @@  read_frame_register_unsigned (const frame_info_ptr &frame, int regnum,
 
 void
 put_frame_register (const frame_info_ptr &next_frame, int regnum,
-		     gdb::array_view<const gdb_byte> buf)
+		     gdb::span<const gdb_byte> buf)
 {
   gdbarch *gdbarch = frame_unwind_arch (next_frame);
   int realnum;
@@ -1559,7 +1559,7 @@  put_frame_register (const frame_info_ptr &next_frame, int regnum,
 
 bool
 deprecated_frame_register_read (const frame_info_ptr &frame, int regnum,
-				gdb::array_view<gdb_byte> myaddr)
+				gdb::span<gdb_byte> myaddr)
 {
   bool optimized;
   bool unavailable;
@@ -1576,7 +1576,7 @@  deprecated_frame_register_read (const frame_info_ptr &frame, int regnum,
 
 bool
 get_frame_register_bytes (const frame_info_ptr &next_frame, int regnum,
-			  CORE_ADDR offset, gdb::array_view<gdb_byte> buffer,
+			  CORE_ADDR offset, gdb::span<gdb_byte> buffer,
 			  bool *optimizedp, bool *unavailablep)
 {
   gdbarch *gdbarch = frame_unwind_arch (next_frame);
@@ -1654,7 +1654,7 @@  get_frame_register_bytes (const frame_info_ptr &next_frame, int regnum,
 void
 put_frame_register_bytes (const frame_info_ptr &next_frame, int regnum,
 			  CORE_ADDR offset,
-			  gdb::array_view<const gdb_byte> buffer)
+			  gdb::span<const gdb_byte> buffer)
 {
   gdbarch *gdbarch = frame_unwind_arch (next_frame);
 
@@ -3094,7 +3094,7 @@  get_frame_address_space (const frame_info_ptr &frame)
 
 void
 get_frame_memory (const frame_info_ptr &this_frame, CORE_ADDR addr,
-		  gdb::array_view<gdb_byte> buffer)
+		  gdb::span<gdb_byte> buffer)
 {
   read_memory (addr, buffer.data (), buffer.size ());
 }
@@ -3121,7 +3121,7 @@  get_frame_memory_unsigned (const frame_info_ptr &this_frame, CORE_ADDR addr,
 
 bool
 safe_frame_unwind_memory (const frame_info_ptr &this_frame,
-			  CORE_ADDR addr, gdb::array_view<gdb_byte> buffer)
+			  CORE_ADDR addr, gdb::span<gdb_byte> buffer)
 {
   /* NOTE: target_read_memory returns zero on success!  */
   return target_read_memory (addr, buffer.data (), buffer.size ()) == 0;
diff --git a/gdb/frame.h b/gdb/frame.h
index b64650f3215..78df8f7ca53 100644
--- a/gdb/frame.h
+++ b/gdb/frame.h
@@ -698,7 +698,7 @@  extern void frame_register_unwind (const frame_info_ptr &frame, int regnum,
 				   bool *optimizedp, bool *unavailablep,
 				   enum lval_type *lvalp,
 				   CORE_ADDR *addrp, int *realnump,
-				   gdb::array_view<gdb_byte> value = {});
+				   gdb::span<gdb_byte> value = {});
 
 /* Fetch a register from this, or unwind a register from the next
    frame.  Note that the get_frame methods are wrappers to
@@ -707,9 +707,9 @@  extern void frame_register_unwind (const frame_info_ptr &frame, int regnum,
    do return a lazy value.  */
 
 extern void frame_unwind_register (const frame_info_ptr &next_frame,
-				   int regnum, gdb::array_view<gdb_byte> buf);
+				   int regnum, gdb::span<gdb_byte> buf);
 extern void get_frame_register (const frame_info_ptr &frame,
-				int regnum, gdb::array_view<gdb_byte> buf);
+				int regnum, gdb::span<gdb_byte> buf);
 
 struct value *frame_unwind_register_value (const frame_info_ptr &next_frame,
 					   int regnum);
@@ -737,7 +737,7 @@  extern bool read_frame_register_unsigned (const frame_info_ptr &frame,
    Note: this call makes the frame's state undefined.  The register and frame
    caches must be flushed.  */
 extern void put_frame_register (const frame_info_ptr &next_frame, int regnum,
-				gdb::array_view<const gdb_byte> buf);
+				gdb::span<const gdb_byte> buf);
 
 /* Read LEN bytes from one or multiple registers starting with REGNUM in
    NEXT_FRAME's previous frame, starting at OFFSET, into BUF.  If the register
@@ -745,14 +745,14 @@  extern void put_frame_register (const frame_info_ptr &next_frame, int regnum,
    accordingly.  */
 extern bool get_frame_register_bytes (const frame_info_ptr &next_frame,
 				      int regnum, CORE_ADDR offset,
-				      gdb::array_view<gdb_byte> buffer,
+				      gdb::span<gdb_byte> buffer,
 				      bool *optimizedp, bool *unavailablep);
 
 /* Write bytes from BUFFER to one or multiple registers starting with REGNUM
    in NEXT_FRAME's previous frame, starting at OFFSET.  */
 extern void put_frame_register_bytes (const frame_info_ptr &next_frame,
 				      int regnum, CORE_ADDR offset,
-				      gdb::array_view<const gdb_byte> buffer);
+				      gdb::span<const gdb_byte> buffer);
 
 /* Unwind the PC.  Strictly speaking return the resume address of the
    calling frame.  For GDB, `pc' is the resume address and not a
@@ -778,7 +778,7 @@  extern void frame_pop (const frame_info_ptr &frame);
    adaptor frames this should be ok.  */
 
 extern void get_frame_memory (const frame_info_ptr &this_frame, CORE_ADDR addr,
-			      gdb::array_view<gdb_byte> buffer);
+			      gdb::span<gdb_byte> buffer);
 extern LONGEST get_frame_memory_signed (const frame_info_ptr &this_frame,
 					CORE_ADDR memaddr, int len);
 extern ULONGEST get_frame_memory_unsigned (const frame_info_ptr &this_frame,
@@ -787,7 +787,7 @@  extern ULONGEST get_frame_memory_unsigned (const frame_info_ptr &this_frame,
 /* Same as above, but return true zero when the entire memory read
    succeeds, false otherwise.  */
 extern bool safe_frame_unwind_memory (const frame_info_ptr &this_frame, CORE_ADDR addr,
-				      gdb::array_view<gdb_byte> buffer);
+				      gdb::span<gdb_byte> buffer);
 
 /* Return this frame's architecture.  */
 extern gdbarch *get_frame_arch (const frame_info_ptr &this_frame);
@@ -910,7 +910,7 @@  extern void print_frame_info (const frame_print_options &fp_opts,
 extern frame_info_ptr block_innermost_frame (const struct block *);
 
 extern bool deprecated_frame_register_read (const frame_info_ptr &frame, int regnum,
-					    gdb::array_view<gdb_byte> buf);
+					    gdb::span<gdb_byte> buf);
 
 /* From stack.c.  */
 
diff --git a/gdb/gdb-gdb.gdb b/gdb/gdb-gdb.gdb
index 1ce90b9b4e0..3b4f15fd3e8 100644
--- a/gdb/gdb-gdb.gdb
+++ b/gdb/gdb-gdb.gdb
@@ -40,6 +40,6 @@  end
 
 # Trivial and uninteresting functions to skip.
 skip -rfu "^enum_flags<.*>::enum_flags"
-skip -rfu "^gdb::array_view<.*>::array_view"
+skip -rfu "^gdb::span<.*>::span"
 skip -rfu "^gdb::function_view<.*>::function_view"
 skip -rfu "^gdb::ref_ptr<.*>::get"
diff --git a/gdb/gdb_bfd.c b/gdb/gdb_bfd.c
index 5def8093138..7e7562230a2 100644
--- a/gdb/gdb_bfd.c
+++ b/gdb/gdb_bfd.c
@@ -1154,7 +1154,7 @@  gdb_bfd_errmsg (bfd_error_type error_tag, char **matching)
 
 /* See gdb_bfd.h.  */
 
-gdb::array_view<asymbol *>
+gdb::span<asymbol *>
 gdb_bfd_canonicalize_symtab (bfd *abfd, bool should_throw)
 {
   struct gdb_bfd_data *gdata = (struct gdb_bfd_data *) bfd_usrdata (abfd);
diff --git a/gdb/gdb_bfd.h b/gdb/gdb_bfd.h
index b1b295f22e0..4f56a9dc616 100644
--- a/gdb/gdb_bfd.h
+++ b/gdb/gdb_bfd.h
@@ -286,7 +286,7 @@  extern void gdb_bfd_init ();
    exception if symbols could not be read.  When SHOULD_THROW is
    false, an empty view is returned instead.  */
 
-extern gdb::array_view<asymbol *> gdb_bfd_canonicalize_symtab
+extern gdb::span<asymbol *> gdb_bfd_canonicalize_symtab
      (bfd *abfd, bool should_throw = true);
 
 /* A wrapper for bfd_check_format that acquires the BFD lock.  */
diff --git a/gdb/gdbarch-gen.c b/gdb/gdbarch-gen.c
index 71ff31ea56e..dd907237774 100644
--- a/gdb/gdbarch-gen.c
+++ b/gdb/gdbarch-gen.c
@@ -1874,7 +1874,7 @@  gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch)
 }
 
 void
-gdbarch_pseudo_register_write (struct gdbarch *gdbarch, const frame_info_ptr &next_frame, int pseudo_reg_num, gdb::array_view<const gdb_byte> buf)
+gdbarch_pseudo_register_write (struct gdbarch *gdbarch, const frame_info_ptr &next_frame, int pseudo_reg_num, gdb::span<const gdb_byte> buf)
 {
   gdb_assert (gdbarch != nullptr);
   gdb_assert (gdbarch->pseudo_register_write != nullptr);
diff --git a/gdb/gdbarch-gen.h b/gdb/gdbarch-gen.h
index e38d7ab61c5..06674c310c3 100644
--- a/gdb/gdbarch-gen.h
+++ b/gdb/gdbarch-gen.h
@@ -211,8 +211,8 @@  void set_gdbarch_pseudo_register_read_value (struct gdbarch *gdbarch, gdbarch_ps
 
 bool gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch);
 
-using gdbarch_pseudo_register_write_ftype = void (struct gdbarch *gdbarch, const frame_info_ptr &next_frame, int pseudo_reg_num, gdb::array_view<const gdb_byte> buf);
-void gdbarch_pseudo_register_write (struct gdbarch *gdbarch, const frame_info_ptr &next_frame, int pseudo_reg_num, gdb::array_view<const gdb_byte> buf);
+using gdbarch_pseudo_register_write_ftype = void (struct gdbarch *gdbarch, const frame_info_ptr &next_frame, int pseudo_reg_num, gdb::span<const gdb_byte> buf);
+void gdbarch_pseudo_register_write (struct gdbarch *gdbarch, const frame_info_ptr &next_frame, int pseudo_reg_num, gdb::span<const gdb_byte> buf);
 void set_gdbarch_pseudo_register_write (struct gdbarch *gdbarch, gdbarch_pseudo_register_write_ftype *pseudo_register_write);
 
 /* Write bytes to a pseudo register.
diff --git a/gdb/gdbarch_components.py b/gdb/gdbarch_components.py
index f2ad61e5a23..24199842339 100644
--- a/gdb/gdbarch_components.py
+++ b/gdb/gdbarch_components.py
@@ -439,7 +439,7 @@  NEXT_FRAME.
     params=[
         ("const frame_info_ptr &", "next_frame"),
         ("int", "pseudo_reg_num"),
-        ("gdb::array_view<const gdb_byte>", "buf"),
+        ("gdb::span<const gdb_byte>", "buf"),
     ],
     predicate=True,
 )
diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h
index 51e9ae1b3f0..5561ec22b42 100644
--- a/gdb/gdbthread.h
+++ b/gdb/gdbthread.h
@@ -774,7 +774,7 @@  struct thread_info *find_thread_global_id (int global_id);
 
 /* Find thread by thread library specific handle in inferior INF.  */
 struct thread_info *find_thread_by_handle
-  (gdb::array_view<const gdb_byte> handle, struct inferior *inf);
+  (gdb::span<const gdb_byte> handle, struct inferior *inf);
 
 /* Finds the first thread of the specified inferior.  */
 extern struct thread_info *first_thread_of_inferior (inferior *inf);
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index f86549aca88..ded4cb2dfee 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -1378,7 +1378,7 @@  smash_to_methodptr_type (struct type *type, struct type *to_type)
 
 void
 smash_to_method_type (struct type *type, struct type *self_type,
-		      struct type *to_type, gdb::array_view<struct field> args,
+		      struct type *to_type, gdb::span<struct field> args,
 		      int varargs)
 {
   smash_type (type);
@@ -2492,7 +2492,7 @@  static void
 compute_variant_fields (struct type *type,
 			struct type *resolved_type,
 			const property_addr_info *addr_stack,
-			const gdb::array_view<variant_part> &parts)
+			const gdb::span<variant_part> &parts)
 {
   /* Assume all fields are included by default.  */
   std::vector<bool> flags (resolved_type->num_fields (), true);
@@ -2828,7 +2828,7 @@  resolve_dynamic_type_internal (struct type *type,
 
 struct type *
 resolve_dynamic_type (struct type *type,
-		      gdb::array_view<const gdb_byte> valaddr,
+		      gdb::span<const gdb_byte> valaddr,
 		      CORE_ADDR addr,
 		      const frame_info_ptr *in_frame)
 {
@@ -3846,8 +3846,8 @@  compare_badness (const badness_vector &a, const badness_vector &b)
    has ARGS.size() + 1 entries.  */
 
 badness_vector
-rank_function (gdb::array_view<type *> parms,
-	       gdb::array_view<value *> args,
+rank_function (gdb::span<type *> parms,
+	       gdb::span<value *> args,
 	       bool varargs)
 {
   /* add 1 for the length-match rank.  */
@@ -4714,7 +4714,7 @@  rank_one_type (struct type *parm, struct type *arg, struct value *value)
    situation.  */
 
 static void
-print_args (gdb::array_view<struct field> args, int spaces)
+print_args (gdb::span<struct field> args, int spaces)
 {
   for (auto [i, arg] : gdb::ranges::views::enumerate (args))
     {
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index edae58754f7..eb20a103f90 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -218,7 +218,7 @@  struct variant_part;
 struct variant : allocate_on_obstack<variant>
 {
   /* The discriminant ranges for this variant.  */
-  gdb::array_view<discriminant_range> discriminants;
+  gdb::span<discriminant_range> discriminants;
 
   /* The fields controlled by this variant.  This is inclusive on
      the low end and exclusive on the high end.  A variant may not
@@ -228,7 +228,7 @@  struct variant : allocate_on_obstack<variant>
   int last_field;
 
   /* Variant parts controlled by this variant.  */
-  gdb::array_view<variant_part> parts;
+  gdb::span<variant_part> parts;
 
   /* Return true if this is the default variant.  The default
      variant can be recognized because it has no associated
@@ -261,7 +261,7 @@  struct variant_part : allocate_on_obstack<variant_part>
 
   /* The variants that are controlled by this variant part.  Note
      that these will always be sorted by field number.  */
-  gdb::array_view<variant> variants;
+  gdb::span<variant> variants;
 };
 
 
@@ -295,7 +295,7 @@  union dynamic_prop_data
      used to control which fields end up in the final type during
      dynamic type resolution.  */
 
-  const gdb::array_view<variant_part> *variant_parts;
+  const gdb::span<variant_part> *variant_parts;
 
   /* Once a variant type is resolved, we may want to be able to go
      from the resolved type to the original type.  In this case we
@@ -380,14 +380,14 @@  struct dynamic_prop
     m_data.baton = baton;
   }
 
-  const gdb::array_view<variant_part> *variant_parts () const
+  const gdb::span<variant_part> *variant_parts () const
   {
     gdb_assert (m_kind == PROP_VARIANT_PARTS);
 
     return m_data.variant_parts;
   }
 
-  void set_variant_parts (gdb::array_view<variant_part> *variant_parts)
+  void set_variant_parts (gdb::span<variant_part> *variant_parts)
   {
     m_kind = PROP_VARIANT_PARTS;
     m_data.variant_parts = variant_parts;
@@ -1110,7 +1110,7 @@  struct type
   }
 
   /* Return an array view of the fields.  */
-  gdb::array_view<struct field> fields () const
+  gdb::span<struct field> fields () const
   {
     return gdb::make_array_view (this->main_type->flds_bnds.fields,
 				 num_fields ());
@@ -2511,7 +2511,7 @@  extern struct type *lookup_methodptr_type (struct type *);
 
 extern void smash_to_method_type (struct type *type, struct type *self_type,
 				  struct type *to_type,
-				  gdb::array_view<struct field> args,
+				  gdb::span<struct field> args,
 				  int varargs);
 
 extern void smash_to_methodptr_type (struct type *, struct type *);
@@ -2686,7 +2686,7 @@  extern CORE_ADDR get_pointer_type_max (struct type *);
    memory).  In this situation, 'is_dynamic_type' will still return
    true for the return value of this function.  */
 extern struct type *resolve_dynamic_type
-  (struct type *type, gdb::array_view<const gdb_byte> valaddr,
+  (struct type *type, gdb::span<const gdb_byte> valaddr,
    CORE_ADDR addr, const frame_info_ptr *frame = nullptr);
 
 /* Predicate if the type has dynamic values, which are not resolved yet.
@@ -2856,8 +2856,8 @@  extern int compare_ranks (struct rank a, struct rank b);
 extern int compare_badness (const badness_vector &,
 			    const badness_vector &);
 
-extern badness_vector rank_function (gdb::array_view<type *> parms,
-				     gdb::array_view<value *> args,
+extern badness_vector rank_function (gdb::span<type *> parms,
+				     gdb::span<value *> args,
 				     bool varargs = false);
 
 extern struct rank rank_one_type (struct type *, struct type *,
diff --git a/gdb/gmp-utils.c b/gdb/gmp-utils.c
index 6438a4615d4..a3a9712f07b 100644
--- a/gdb/gmp-utils.c
+++ b/gdb/gmp-utils.c
@@ -56,7 +56,7 @@  debug (const gdb_mpz &val)
 /* See gmp-utils.h.  */
 
 void
-gdb_mpz::read (gdb::array_view<const gdb_byte> buf, enum bfd_endian byte_order,
+gdb_mpz::read (gdb::span<const gdb_byte> buf, enum bfd_endian byte_order,
 	       bool unsigned_p)
 {
   mpz_import (m_val, 1 /* count */, -1 /* order */, buf.size () /* size */,
@@ -79,7 +79,7 @@  gdb_mpz::read (gdb::array_view<const gdb_byte> buf, enum bfd_endian byte_order,
 /* See gmp-utils.h.  */
 
 void
-gdb_mpz::export_bits (gdb::array_view<gdb_byte> buf, int endian, bool unsigned_p,
+gdb_mpz::export_bits (gdb::span<gdb_byte> buf, int endian, bool unsigned_p,
 		      bool safe) const
 {
   int sign = mpz_sgn (m_val);
@@ -207,7 +207,7 @@  gdb_mpq::get_rounded () const
 /* See gmp-utils.h.  */
 
 void
-gdb_mpq::read_fixed_point (gdb::array_view<const gdb_byte> buf,
+gdb_mpq::read_fixed_point (gdb::span<const gdb_byte> buf,
 			   enum bfd_endian byte_order, bool unsigned_p,
 			   const gdb_mpq &scaling_factor)
 {
@@ -221,7 +221,7 @@  gdb_mpq::read_fixed_point (gdb::array_view<const gdb_byte> buf,
 /* See gmp-utils.h.  */
 
 void
-gdb_mpq::write_fixed_point (gdb::array_view<gdb_byte> buf,
+gdb_mpq::write_fixed_point (gdb::span<gdb_byte> buf,
 			    enum bfd_endian byte_order, bool unsigned_p,
 			    const gdb_mpq &scaling_factor) const
 {
diff --git a/gdb/gmp-utils.h b/gdb/gmp-utils.h
index 04f8d0c83dc..56bd66e441f 100644
--- a/gdb/gmp-utils.h
+++ b/gdb/gmp-utils.h
@@ -135,14 +135,14 @@  struct gdb_mpz
      the byte array's size.
 
      UNSIGNED_P indicates whether the number has an unsigned type.  */
-  void read (gdb::array_view<const gdb_byte> buf, enum bfd_endian byte_order,
+  void read (gdb::span<const gdb_byte> buf, enum bfd_endian byte_order,
 	     bool unsigned_p);
 
   /* Write VAL into BUF as a number whose byte size is the size of BUF,
      using the given BYTE_ORDER.
 
      UNSIGNED_P indicates whether the number has an unsigned type.  */
-  void write (gdb::array_view<gdb_byte> buf, enum bfd_endian byte_order,
+  void write (gdb::span<gdb_byte> buf, enum bfd_endian byte_order,
 	      bool unsigned_p) const
   {
     export_bits (buf, byte_order == BFD_ENDIAN_BIG ? 1 : -1 /* endian */,
@@ -151,7 +151,7 @@  struct gdb_mpz
 
   /* Like write, but truncates the value to the desired number of
      bytes.  */
-  void truncate (gdb::array_view<gdb_byte> buf, enum bfd_endian byte_order,
+  void truncate (gdb::span<gdb_byte> buf, enum bfd_endian byte_order,
 		 bool unsigned_p) const
   {
     export_bits (buf, byte_order == BFD_ENDIAN_BIG ? 1 : -1 /* endian */,
@@ -410,7 +410,7 @@  struct gdb_mpz
     If SAFE is true, an error is raised if BUF is not large enough to
     contain the value being exported.  If SAFE is false, the value is
     truncated to fit in BUF.  */
-  void export_bits (gdb::array_view<gdb_byte> buf, int endian, bool unsigned_p,
+  void export_bits (gdb::span<gdb_byte> buf, int endian, bool unsigned_p,
 		    bool safe) const;
 
   friend struct gdb_mpq;
@@ -566,7 +566,7 @@  struct gdb_mpq
      UNSIGNED_P indicates whether the number has an unsigned type.
      SCALING_FACTOR is the scaling factor to apply after having
      read the unscaled value from our buffer.  */
-  void read_fixed_point (gdb::array_view<const gdb_byte> buf,
+  void read_fixed_point (gdb::span<const gdb_byte> buf,
 			 enum bfd_endian byte_order, bool unsigned_p,
 			 const gdb_mpq &scaling_factor);
 
@@ -576,7 +576,7 @@  struct gdb_mpq
      UNSIGNED_P indicates whether the number has an unsigned type.
      SCALING_FACTOR is the scaling factor to apply before writing
      the unscaled value to our buffer.  */
-  void write_fixed_point (gdb::array_view<gdb_byte> buf,
+  void write_fixed_point (gdb::span<gdb_byte> buf,
 			  enum bfd_endian byte_order, bool unsigned_p,
 			  const gdb_mpq &scaling_factor) const;
 
@@ -609,7 +609,7 @@  struct gdb_mpf
      UNSIGNED_P indicates whether the number has an unsigned type.
      SCALING_FACTOR is the scaling factor to apply after having
      read the unscaled value from our buffer.  */
-  void read_fixed_point (gdb::array_view<const gdb_byte> buf,
+  void read_fixed_point (gdb::span<const gdb_byte> buf,
 			 enum bfd_endian byte_order, bool unsigned_p,
 			 const gdb_mpq &scaling_factor)
   {
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 071d8e004ae..fa0a049cc87 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -3348,7 +3348,7 @@  i386_pseudo_register_read_value (gdbarch *gdbarch, const frame_info_ptr &next_fr
 void
 i386_pseudo_register_write (gdbarch *gdbarch, const frame_info_ptr &next_frame,
 			    const int pseudo_reg_num,
-			    gdb::array_view<const gdb_byte> buf)
+			    gdb::span<const gdb_byte> buf)
 {
   if (i386_mmx_regnum_p (gdbarch, pseudo_reg_num))
     {
diff --git a/gdb/i386-tdep.h b/gdb/i386-tdep.h
index bdafd523834..8cecf445395 100644
--- a/gdb/i386-tdep.h
+++ b/gdb/i386-tdep.h
@@ -408,7 +408,7 @@  extern value *i386_pseudo_register_read_value (gdbarch *gdbarch,
 
 extern void i386_pseudo_register_write (gdbarch *gdbarch,
 					const frame_info_ptr &next_frame, int regnum,
-					gdb::array_view<const gdb_byte> buf);
+					gdb::span<const gdb_byte> buf);
 
 extern void i386_ax_pseudo_register_collect (struct gdbarch *gdbarch,
 					     struct agent_expr *ax,
diff --git a/gdb/i386-windows-tdep.c b/gdb/i386-windows-tdep.c
index b8db0b9d5fb..96834e596bb 100644
--- a/gdb/i386-windows-tdep.c
+++ b/gdb/i386-windows-tdep.c
@@ -169,7 +169,7 @@  static const gdb_byte i386_sigbe_bytes[] = {
   /* 4 bytes for tls::stackptr operand.  */
 };
 
-static const gdb::array_view<const gdb_byte> i386_sig_patterns[] {
+static const gdb::span<const gdb_byte> i386_sig_patterns[] {
   { i386_sigbe_bytes },
 };
 
diff --git a/gdb/infcall.c b/gdb/infcall.c
index 4c40f6cb06e..91df4d45066 100644
--- a/gdb/infcall.c
+++ b/gdb/infcall.c
@@ -463,7 +463,7 @@  find_function_addr (struct value *function,
 static CORE_ADDR
 push_dummy_code (struct gdbarch *gdbarch,
 		 CORE_ADDR sp, CORE_ADDR funaddr,
-		 gdb::array_view<value *> args,
+		 gdb::span<value *> args,
 		 struct type *value_type,
 		 CORE_ADDR *real_pc, CORE_ADDR *bp_addr,
 		 struct regcache *regcache)
@@ -1038,7 +1038,7 @@  call_destructors (const std::list<destructor_info> &dtors_to_invoke,
 struct value *
 call_function_by_hand (struct value *function,
 		       type *default_return_type,
-		       gdb::array_view<value *> args)
+		       gdb::span<value *> args)
 {
   return call_function_by_hand_dummy (function, default_return_type,
 				      args, NULL, NULL);
@@ -1065,7 +1065,7 @@  call_function_by_hand (struct value *function,
 struct value *
 call_function_by_hand_dummy (struct value *function,
 			     type *default_return_type,
-			     gdb::array_view<value *> args,
+			     gdb::span<value *> args,
 			     dummy_frame_dtor_ftype *dummy_dtor,
 			     void *dummy_dtor_data)
 {
diff --git a/gdb/infcall.h b/gdb/infcall.h
index 58e40db3509..205cffff591 100644
--- a/gdb/infcall.h
+++ b/gdb/infcall.h
@@ -51,7 +51,7 @@  extern CORE_ADDR find_function_addr (struct value *function,
 
 extern struct value *call_function_by_hand (struct value *function,
 					    type *default_return_type,
-					    gdb::array_view<value *> args);
+					    gdb::span<value *> args);
 
 /* Similar to call_function_by_hand and additional call
    register_dummy_frame_dtor with DUMMY_DTOR and DUMMY_DTOR_DATA for the
@@ -60,7 +60,7 @@  extern struct value *call_function_by_hand (struct value *function,
 extern struct value *
   call_function_by_hand_dummy (struct value *function,
 			       type *default_return_type,
-			       gdb::array_view<value *> args,
+			       gdb::span<value *> args,
 			       dummy_frame_dtor_ftype *dummy_dtor,
 			       void *dummy_dtor_data);
 
diff --git a/gdb/inferior.h b/gdb/inferior.h
index accd36740c3..2bb3f8d8655 100644
--- a/gdb/inferior.h
+++ b/gdb/inferior.h
@@ -558,7 +558,7 @@  class inferior : public refcounted_object,
      escaped, When false only the characters that GDB sees as special will
      be escaped.  See construct_inferior_arguments for more details.  */
   template<typename T>
-  void set_args (gdb::array_view<T const> args, bool escape_shell_char)
+  void set_args (gdb::span<T const> args, bool escape_shell_char)
   {
     this->set_args (construct_inferior_arguments (args, escape_shell_char));
   }
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index 8840dbe3f75..ab9f6ade55d 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -637,7 +637,7 @@  linux_nat_target::remove_exec_catchpoint (int pid)
 
 int
 linux_nat_target::set_syscall_catchpoint (int pid, bool needed, int any_count,
-					  gdb::array_view<const int> syscall_counts)
+					  gdb::span<const int> syscall_counts)
 {
   /* On GNU/Linux, we ignore the arguments.  It means that we only
      enable the syscall catchpoints, but do not disable them.
@@ -778,7 +778,7 @@  static sigset_t pass_mask;
 /* Update signals to pass to the inferior.  */
 void
 linux_nat_target::pass_signals
-  (gdb::array_view<const unsigned char> pass_signals)
+  (gdb::span<const unsigned char> pass_signals)
 {
   int signo;
 
diff --git a/gdb/linux-nat.h b/gdb/linux-nat.h
index 180059a9496..3fe2715b604 100644
--- a/gdb/linux-nat.h
+++ b/gdb/linux-nat.h
@@ -48,7 +48,7 @@  class linux_nat_target : public inf_ptrace_target
 
   ptid_t wait (ptid_t, struct target_waitstatus *, target_wait_flags) override;
 
-  void pass_signals (gdb::array_view<const unsigned char>) override;
+  void pass_signals (gdb::span<const unsigned char>) override;
 
   enum target_xfer_status xfer_partial (enum target_object object,
 					const char *annex,
@@ -124,7 +124,7 @@  class linux_nat_target : public inf_ptrace_target
   int remove_exec_catchpoint (int) override;
 
   int set_syscall_catchpoint (int pid, bool needed, int any_count,
-			      gdb::array_view<const int> syscall_counts) override;
+			      gdb::span<const int> syscall_counts) override;
 
   const char *pid_to_exec_file (int pid) override;
 
diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c
index 5a7c39b9cef..94bdb978dbd 100644
--- a/gdb/linux-thread-db.c
+++ b/gdb/linux-thread-db.c
@@ -105,7 +105,7 @@  class thread_db_target final : public target_ops
   thread_info *thread_handle_to_thread_info (const gdb_byte *thread_handle,
 					     int handle_len,
 					     inferior *inf) override;
-  gdb::array_view<const gdb_byte> thread_info_to_thread_handle (struct thread_info *) override;
+  gdb::span<const gdb_byte> thread_info_to_thread_handle (struct thread_info *) override;
 };
 
 static std::string libthread_db_search_path = LIBTHREAD_DB_SEARCH_PATH;
@@ -1717,7 +1717,7 @@  thread_db_target::thread_handle_to_thread_info (const gdb_byte *thread_handle,
 
 /* Return the thread handle associated the thread_info pointer TP.  */
 
-gdb::array_view<const gdb_byte>
+gdb::span<const gdb_byte>
 thread_db_target::thread_info_to_thread_handle (struct thread_info *tp)
 {
   thread_db_thread_info *priv = get_thread_db_thread_info (tp);
diff --git a/gdb/main.c b/gdb/main.c
index ea7ecc468e6..33d5fb2bbdc 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -1112,7 +1112,7 @@  captured_main_1 (struct captured_main_args *context)
       symarg = argv[optind];
       execarg = argv[optind];
       ++optind;
-      gdb::array_view<char * const> arg_view (&argv[optind], argc - optind);
+      gdb::span<char * const> arg_view (&argv[optind], argc - optind);
       current_inferior ()->set_args (arg_view, (set_args == SET_ESC_ARGS));
    }
   else
diff --git a/gdb/minsyms.c b/gdb/minsyms.c
index ad63e9d5eaf..788a430c887 100644
--- a/gdb/minsyms.c
+++ b/gdb/minsyms.c
@@ -1326,7 +1326,7 @@  class minimal_symbol_install_worker
 public:
   minimal_symbol_install_worker
     (minimal_symbol *msymbols,
-     gdb::array_view<computed_hash_values> hash_values,
+     gdb::span<computed_hash_values> hash_values,
      objfile_per_bfd_storage *per_bfd,
      gdb::mutex &demangled_mutex)
     : m_time_it ("minsym install worker"),
@@ -1387,7 +1387,7 @@  class minimal_symbol_install_worker
 private:
   scoped_time_it m_time_it;
   minimal_symbol *m_msymbols;
-  gdb::array_view<computed_hash_values> m_hash_values;
+  gdb::span<computed_hash_values> m_hash_values;
   objfile_per_bfd_storage *m_per_bfd;
   gdb::mutex &m_demangled_mutex;
 };
@@ -1461,7 +1461,7 @@  minimal_symbol_reader::install ()
 
       gdb::parallel_for_each<1000, minimal_symbol *, minimal_symbol_install_worker>
 	(&msymbols[0], &msymbols[mcount], msymbols,
-	 gdb::array_view<computed_hash_values> (hash_values),
+	 gdb::span<computed_hash_values> (hash_values),
 	 m_objfile->per_bfd,
 	 demangled_mutex);
 
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index 6f5f5372cc5..3a0cf8789cb 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -950,8 +950,8 @@  mips_register_to_value (const frame_info_ptr &frame, int regnum,
 
   if (mips_convert_register_float_case_p (gdbarch, regnum, type))
     {
-      gdb::array_view<gdb_byte> first_half = gdb::make_array_view (to, 4);
-      gdb::array_view<gdb_byte> second_half = gdb::make_array_view (to + 4, 4);
+      gdb::span<gdb_byte> first_half = gdb::make_array_view (to, 4);
+      gdb::span<gdb_byte> second_half = gdb::make_array_view (to + 4, 4);
 
       get_frame_register (frame, regnum + 0, second_half);
       get_frame_register (frame, regnum + 1, first_half);
@@ -6249,7 +6249,7 @@  mips_o64_return_value (struct gdbarch *gdbarch, struct value *function,
 
 static void
 mips_read_fp_register_single (const frame_info_ptr &frame, int regno,
-			      gdb::array_view<gdb_byte> rare_buffer)
+			      gdb::span<gdb_byte> rare_buffer)
 {
   struct gdbarch *gdbarch = get_frame_arch (frame);
   int raw_size = register_size (gdbarch, regno);
@@ -6283,7 +6283,7 @@  mips_read_fp_register_single (const frame_info_ptr &frame, int regno,
 
 static void
 mips_read_fp_register_double (const frame_info_ptr &frame, int regno,
-			      gdb::array_view<gdb_byte> rare_buffer)
+			      gdb::span<gdb_byte> rare_buffer)
 {
   struct gdbarch *gdbarch = get_frame_arch (frame);
   int raw_size = register_size (gdbarch, regno);
diff --git a/gdb/nat/x86-linux.c b/gdb/nat/x86-linux.c
index 838ca70fb9d..98917714813 100644
--- a/gdb/nat/x86-linux.c
+++ b/gdb/nat/x86-linux.c
@@ -188,7 +188,7 @@  x86_check_ssp_support (const int tid)
 /* See nat/x86-linux.h.  */
 
 bool
-i386_ptrace_get_tls_data (int pid, gdb::array_view<user_desc> buffer)
+i386_ptrace_get_tls_data (int pid, gdb::span<user_desc> buffer)
 {
   gdb_assert (buffer.size () == 3);
 
@@ -200,7 +200,7 @@  i386_ptrace_get_tls_data (int pid, gdb::array_view<user_desc> buffer)
 /* See nat/x86-linux.h.  */
 
 bool
-i386_ptrace_set_tls_data (int pid, gdb::array_view<user_desc> buffer)
+i386_ptrace_set_tls_data (int pid, gdb::span<user_desc> buffer)
 {
   gdb_assert (buffer.size () == 3);
 
diff --git a/gdb/nat/x86-linux.h b/gdb/nat/x86-linux.h
index f12f90c5db6..1e7395ab610 100644
--- a/gdb/nat/x86-linux.h
+++ b/gdb/nat/x86-linux.h
@@ -85,13 +85,13 @@  extern bool x86_check_ssp_support (const int tid);
    length 3.  */
 
 extern bool i386_ptrace_get_tls_data
-  (int pid, gdb::array_view<user_desc> buffer);
+  (int pid, gdb::span<user_desc> buffer);
 
 /* Store the three TLS related GDT (Global Descriptor Table) entries held
    in BUFFER back into the kernel for thread PID.  BUFFER must have a
    length of three.  */
 
 extern bool i386_ptrace_set_tls_data
-  (int pid, gdb::array_view<user_desc> buffer);
+  (int pid, gdb::span<user_desc> buffer);
 
 #endif /* GDB_NAT_X86_LINUX_H */
diff --git a/gdb/netbsd-nat.c b/gdb/netbsd-nat.c
index 9eb1e3081f8..df22c878c83 100644
--- a/gdb/netbsd-nat.c
+++ b/gdb/netbsd-nat.c
@@ -713,7 +713,7 @@  nbsd_nat_target::remove_exec_catchpoint (int pid)
 int
 nbsd_nat_target::set_syscall_catchpoint (int pid, bool needed,
 					 int any_count,
-					 gdb::array_view<const int> syscall_counts)
+					 gdb::span<const int> syscall_counts)
 {
   /* Ignore the arguments.  inf-ptrace.c will use PT_SYSCALL which
      will catch all system call entries and exits.  The system calls
diff --git a/gdb/netbsd-nat.h b/gdb/netbsd-nat.h
index 3470fe103c8..af6d504b87b 100644
--- a/gdb/netbsd-nat.h
+++ b/gdb/netbsd-nat.h
@@ -44,7 +44,7 @@  struct nbsd_nat_target : public inf_ptrace_target
   int insert_exec_catchpoint (int pid) override;
   int remove_exec_catchpoint (int pid) override;
   int set_syscall_catchpoint (int pid, bool needed, int any_count,
-			      gdb::array_view<const int> syscall_counts)
+			      gdb::span<const int> syscall_counts)
     override;
 
   bool supports_multi_process () override;
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index edaf7a10d86..406748290a3 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -478,7 +478,7 @@  objfile::~objfile ()
 
 static int
 objfile_relocate1 (struct objfile *objfile,
-		   gdb::array_view<const CORE_ADDR> new_offsets)
+		   gdb::span<const CORE_ADDR> new_offsets)
 {
   std::vector<CORE_ADDR> delta (objfile->section_offsets.size ());
 
@@ -531,7 +531,7 @@  objfile_relocate1 (struct objfile *objfile,
 
 void
 objfile_relocate (struct objfile *objfile,
-		  gdb::array_view<const CORE_ADDR> new_offsets)
+		  gdb::span<const CORE_ADDR> new_offsets)
 {
   int changed = 0;
 
diff --git a/gdb/objfiles.h b/gdb/objfiles.h
index fa265f83b79..ae928fedd17 100644
--- a/gdb/objfiles.h
+++ b/gdb/objfiles.h
@@ -923,7 +923,7 @@  extern void build_objfile_section_table (struct objfile *);
 extern void free_objfile_separate_debug (struct objfile *);
 
 extern void objfile_relocate (struct objfile *,
-			      gdb::array_view<const CORE_ADDR>);
+			      gdb::span<const CORE_ADDR>);
 extern void objfile_rebase (struct objfile *, CORE_ADDR);
 
 extern void objfile_set_sym_fns (struct objfile *objfile,
diff --git a/gdb/procfs.c b/gdb/procfs.c
index 615b92006a8..459a9f3154b 100644
--- a/gdb/procfs.c
+++ b/gdb/procfs.c
@@ -118,7 +118,7 @@  class procfs_target final : public inf_child_target
 					ULONGEST offset, ULONGEST len,
 					ULONGEST *xfered_len) override;
 
-  void pass_signals (gdb::array_view<const unsigned char>) override;
+  void pass_signals (gdb::span<const unsigned char>) override;
 
   void files_info () override;
 
@@ -2501,7 +2501,7 @@  procfs_target::resume (ptid_t scope_ptid, int step, enum gdb_signal signo)
 /* Set up to trace signals in the child process.  */
 
 void
-procfs_target::pass_signals (gdb::array_view<const unsigned char> pass_signals)
+procfs_target::pass_signals (gdb::span<const unsigned char> pass_signals)
 {
   sigset_t signals;
   procinfo *pi = find_procinfo_or_die (inferior_ptid.pid (), 0);
diff --git a/gdb/python/py-connection.c b/gdb/python/py-connection.c
index 0b10ed2e594..ffebc2c1f81 100644
--- a/gdb/python/py-connection.c
+++ b/gdb/python/py-connection.c
@@ -281,7 +281,7 @@  struct py_send_packet_callbacks : public send_remote_packet_callbacks
 
   /* There's nothing to do when the packet is sent.  */
 
-  void sending (gdb::array_view<const char> &buf) override
+  void sending (gdb::span<const char> &buf) override
   { /* Nothing.  */ }
 
   /* When the result is returned create a Python object and assign
@@ -290,7 +290,7 @@  struct py_send_packet_callbacks : public send_remote_packet_callbacks
      the result we got back from the remote is empty then set the
      result to None.  */
 
-  void received (gdb::array_view<const char> &buf) override
+  void received (gdb::span<const char> &buf) override
   {
     if (buf.size () > 0 && buf.data ()[0] != '\0')
       m_result = gdbpy_bytes_from_string_and_size (buf);
@@ -358,7 +358,7 @@  connection_object::send_packet (gdbpy_borrowed_ref<> args,
   scoped_restore_current_thread restore_thread;
   switch_to_target_no_thread (target);
 
-  gdb::array_view<const char> view (packet_str, packet_len);
+  gdb::span<const char> view (packet_str, packet_len);
   py_send_packet_callbacks callbacks;
   send_remote_packet (view, &callbacks);
   return callbacks.result ();
diff --git a/gdb/python/py-inferior.c b/gdb/python/py-inferior.c
index 5e77f9f37bd..2fa1c78526c 100644
--- a/gdb/python/py-inferior.c
+++ b/gdb/python/py-inferior.c
@@ -745,7 +745,7 @@  infpy_thread_from_thread_handle (PyObject *self, PyObject *args, PyObject *kw)
       struct thread_info *thread_info;
 
       thread_info = find_thread_by_handle
-	(gdb::array_view<const gdb_byte> (bytes, bytes_len),
+	(gdb::span<const gdb_byte> (bytes, bytes_len),
 	 inf_obj->inferior);
       if (thread_info != NULL)
 	return thread_to_thread_object (thread_info).release ();
@@ -894,7 +894,7 @@  infpy_set_args (PyObject *self, PyObject *value, void *closure)
 	    return -1;
 	  args.push_back (std::move (str));
 	}
-      gdb::array_view<gdb::unique_xmalloc_ptr<char> const> args_view (args);
+      gdb::span<gdb::unique_xmalloc_ptr<char> const> args_view (args);
       inf->inferior->set_args (args_view, true);
     }
   else
diff --git a/gdb/python/py-infthread.c b/gdb/python/py-infthread.c
index a5ea749cba9..926a375b1a6 100644
--- a/gdb/python/py-infthread.c
+++ b/gdb/python/py-infthread.c
@@ -320,7 +320,7 @@  thpy_thread_handle (PyObject *self, PyObject *args)
   thread_object *thread_obj = (thread_object *) self;
   THPY_REQUIRE_VALID (thread_obj);
 
-  gdb::array_view<const gdb_byte> hv;
+  gdb::span<const gdb_byte> hv;
 
   try
     {
diff --git a/gdb/python/py-unwind.c b/gdb/python/py-unwind.c
index 65bbd406510..cf05c939d29 100644
--- a/gdb/python/py-unwind.c
+++ b/gdb/python/py-unwind.c
@@ -966,7 +966,7 @@  frame_unwind_python::sniff (const frame_info_ptr &this_frame,
 	cached_reg_t *cached = new (&cached_frame->reg[i]) cached_reg_t ();
 	cached->num = reg->number;
 	cached->data.resize (data_size);
-	gdb::array_view<const gdb_byte> contents = value->contents ();
+	gdb::span<const gdb_byte> contents = value->contents ();
 	cached->data.assign (contents.begin (), contents.end ());
       }
   }
diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c
index 9d5986d3767..390a2233d9b 100644
--- a/gdb/python/py-value.c
+++ b/gdb/python/py-value.c
@@ -1347,7 +1347,7 @@  valpy_get_bytes (PyObject *self, void *closure)
       return value_obj->content_bytes;
     }
 
-  gdb::array_view<const gdb_byte> contents;
+  gdb::span<const gdb_byte> contents;
   try
     {
       contents = value->contents ();
@@ -1881,7 +1881,7 @@  valpy_long (PyObject *self)
 	  && type->code () != TYPE_CODE_PTR)
 	error (_("Cannot convert value to long."));
 
-      gdb::array_view<const gdb_byte> contents = value->contents ();
+      gdb::span<const gdb_byte> contents = value->contents ();
 #if PY_VERSION_HEX >= 0x030d0000
       int flags = (type_byte_order (type) == BFD_ENDIAN_BIG
 		   ? Py_ASNATIVEBYTES_BIG_ENDIAN
diff --git a/gdb/python/py-wrappers.h b/gdb/python/py-wrappers.h
index 2e2d451167a..7ab3d10eceb 100644
--- a/gdb/python/py-wrappers.h
+++ b/gdb/python/py-wrappers.h
@@ -109,7 +109,7 @@  gdbpy_bytes_from_string (const char *str)
 /* Wrapper for PyBytes_FromStringAndSize.  */
 template<typename T>
 gdbpy_ref<>
-gdbpy_bytes_from_string_and_size (gdb::array_view<T> data)
+gdbpy_bytes_from_string_and_size (gdb::span<T> data)
 {
   /* Python allows STR==nullptr but it leaves the object
      uninitialized, and I think we should avoid this in gdb.  */
diff --git a/gdb/python/py-xmethods.c b/gdb/python/py-xmethods.c
index bda9071b216..e6ca1cda0bb 100644
--- a/gdb/python/py-xmethods.c
+++ b/gdb/python/py-xmethods.c
@@ -44,7 +44,7 @@  struct python_xmethod_worker : xmethod_worker
 
   /* Implementation of xmethod_worker::invoke for Python.  */
 
-  value *invoke (value *obj, gdb::array_view<value *> args) override;
+  value *invoke (value *obj, gdb::span<value *> args) override;
 
   /* Implementation of xmethod_worker::do_get_arg_types for Python.  */
 
@@ -56,7 +56,7 @@  struct python_xmethod_worker : xmethod_worker
      result type, if the get_result_type operation is not provided by WORKER
      then EXT_LANG_RC_OK is returned and NULL is returned in *RESULT_TYPE.  */
 
-  ext_lang_rc do_get_result_type (value *obj, gdb::array_view<value *> args,
+  ext_lang_rc do_get_result_type (value *obj, gdb::span<value *> args,
 				  type **result_type_ptr) override;
 
 private:
@@ -402,7 +402,7 @@  python_xmethod_worker::do_get_arg_types (std::vector<type *> *arg_types)
 
 ext_lang_rc
 python_xmethod_worker::do_get_result_type (value *obj,
-					   gdb::array_view<value *> args,
+					   gdb::span<value *> args,
 					   type **result_type_ptr)
 {
   struct type *obj_type, *this_type;
@@ -508,7 +508,7 @@  python_xmethod_worker::do_get_result_type (value *obj,
 
 struct value *
 python_xmethod_worker::invoke (struct value *obj,
-			       gdb::array_view<value *> args)
+			       gdb::span<value *> args)
 {
   gdbpy_enter enter_py;
 
diff --git a/gdb/python/python.c b/gdb/python/python.c
index 5a9c876c197..6e4c8e98c8b 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -993,7 +993,7 @@  gdbpy_decode_line (PyObject *self, PyObject *args)
 
   std::vector<symtab_and_line> decoded_sals;
   symtab_and_line def_sal;
-  gdb::array_view<symtab_and_line> sals;
+  gdb::span<symtab_and_line> sals;
   try
     {
       if (locspec != NULL)
diff --git a/gdb/ravenscar-thread.h b/gdb/ravenscar-thread.h
index e65733a069c..564b0463e69 100644
--- a/gdb/ravenscar-thread.h
+++ b/gdb/ravenscar-thread.h
@@ -24,7 +24,7 @@ 
 
 struct ravenscar_arch_ops
 {
-  ravenscar_arch_ops (gdb::array_view<const int> offsets_,
+  ravenscar_arch_ops (gdb::span<const int> offsets_,
 		      int first_stack = -1,
 		      int last_stack = -1,
 		      int v_init = -1,
@@ -90,7 +90,7 @@  struct ravenscar_arch_ops
      are offsets.  The offsets are either in the thread descriptor or
      the stack, depending on the other fields.  An offset of -1 means
      that the corresponding register is not stored.  */
-  const gdb::array_view<const int> offsets;
+  const gdb::span<const int> offsets;
 
   /* If these are -1, then all registers for this architecture are
      stored in the thread descriptor.  Otherwise, these mark a range
diff --git a/gdb/regcache.c b/gdb/regcache.c
index 773e8ac37d0..cb02ca69ced 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -220,7 +220,7 @@  regcache::regcache (inferior *inf_for_target_calls, gdbarch *gdbarch)
 readonly_detached_regcache::readonly_detached_regcache (regcache &src)
   : readonly_detached_regcache (src.arch (),
 				[&src] (int regnum,
-					gdb::array_view<gdb_byte> buf)
+					gdb::span<gdb_byte> buf)
 				  { return src.cooked_read (regnum, buf); })
 {
 }
@@ -234,18 +234,18 @@  reg_buffer::arch () const
 /* Helper for reg_buffer::register_buffer.  */
 
 template<typename ElemType>
-gdb::array_view<ElemType>
+gdb::span<ElemType>
 reg_buffer::register_buffer (int regnum) const
 {
   assert_regnum (regnum);
   ElemType *start = &m_registers[m_descr->register_offset[regnum]];
   int size = m_descr->sizeof_register[regnum];
-  return gdb::array_view<ElemType> (start, size);
+  return gdb::span<ElemType> (start, size);
 }
 
 /* See regcache.h.  */
 
-gdb::array_view<const gdb_byte>
+gdb::span<const gdb_byte>
 reg_buffer::register_buffer (int regnum) const
 {
   return register_buffer<const gdb_byte> (regnum);
@@ -253,7 +253,7 @@  reg_buffer::register_buffer (int regnum) const
 
 /* See regcache.h.  */
 
-gdb::array_view<gdb_byte>
+gdb::span<gdb_byte>
 reg_buffer::register_buffer (int regnum)
 {
   return register_buffer<gdb_byte> (regnum);
@@ -277,7 +277,7 @@  reg_buffer::save (register_read_ftype cooked_read)
     {
       if (gdbarch_register_reggroup_p (gdbarch, regnum, save_reggroup))
 	{
-	  gdb::array_view<gdb_byte> dst_buf = register_buffer (regnum);
+	  gdb::span<gdb_byte> dst_buf = register_buffer (regnum);
 	  register_status status = cooked_read (regnum, dst_buf);
 
 	  gdb_assert (status != REG_UNKNOWN);
@@ -612,7 +612,7 @@  regcache::raw_update (int regnum)
 }
 
 register_status
-readable_regcache::raw_read (int regnum, gdb::array_view<gdb_byte> dst)
+readable_regcache::raw_read (int regnum, gdb::span<gdb_byte> dst)
 {
   assert_regnum (regnum);
   gdb_assert (dst.size () == m_descr->sizeof_register[regnum]);
@@ -713,7 +713,7 @@  regcache_raw_get_signed (struct regcache *regcache, int regnum)
 /* See regcache.h.  */
 
 register_status
-readable_regcache::cooked_read (int regnum, gdb::array_view<gdb_byte> dst)
+readable_regcache::cooked_read (int regnum, gdb::span<gdb_byte> dst)
 {
   gdb_assert (regnum >= 0);
   gdb_assert (regnum < m_descr->nr_cooked_registers);
@@ -858,7 +858,7 @@  regcache_cooked_write_unsigned (struct regcache *regcache, int regnum,
 }
 
 void
-regcache::raw_write (int regnum, gdb::array_view<const gdb_byte> src)
+regcache::raw_write (int regnum, gdb::span<const gdb_byte> src)
 {
   assert_regnum (regnum);
   gdb_assert (src.size () == m_descr->sizeof_register[regnum]);
@@ -905,7 +905,7 @@  regcache::raw_write (int regnum, const gdb_byte *src)
 /* See regcache.h.  */
 
 void
-regcache::cooked_write (int regnum, gdb::array_view<const gdb_byte> src)
+regcache::cooked_write (int regnum, gdb::span<const gdb_byte> src)
 {
   gdb_assert (regnum >= 0);
   gdb_assert (regnum < m_descr->nr_cooked_registers);
@@ -937,7 +937,7 @@  regcache::cooked_write (int regnum, const gdb_byte *src)
 
 register_status
 readable_regcache::read_part (int regnum, int offset,
-			      gdb::array_view<gdb_byte> dst, bool is_raw)
+			      gdb::span<gdb_byte> dst, bool is_raw)
 {
   int reg_size = register_size (regnum);
 
@@ -981,7 +981,7 @@  readable_regcache::read_part (int regnum, int offset,
 
 void
 reg_buffer::raw_collect_part (int regnum, int offset,
-			      gdb::array_view<gdb_byte> dst) const
+			      gdb::span<gdb_byte> dst) const
 {
   int reg_size = register_size (regnum);
 
@@ -1011,7 +1011,7 @@  reg_buffer::raw_collect_part (int regnum, int offset,
 
 register_status
 regcache::write_part (int regnum, int offset,
-		      gdb::array_view<const gdb_byte> src, bool is_raw)
+		      gdb::span<const gdb_byte> src, bool is_raw)
 {
   int reg_size = register_size (regnum);
 
@@ -1063,7 +1063,7 @@  regcache::write_part (int regnum, int offset,
 
 void
 reg_buffer::raw_supply_part (int regnum, int offset,
-			     gdb::array_view<const gdb_byte> src)
+			     gdb::span<const gdb_byte> src)
 {
   int reg_size = register_size (regnum);
 
@@ -1094,7 +1094,7 @@  reg_buffer::raw_supply_part (int regnum, int offset,
 
 register_status
 readable_regcache::raw_read_part (int regnum, int offset,
-				  gdb::array_view<gdb_byte> dst)
+				  gdb::span<gdb_byte> dst)
 {
   assert_regnum (regnum);
   return read_part (regnum, offset, dst, true);
@@ -1104,7 +1104,7 @@  readable_regcache::raw_read_part (int regnum, int offset,
 
 void
 regcache::raw_write_part (int regnum, int offset,
-			  gdb::array_view<const gdb_byte> src)
+			  gdb::span<const gdb_byte> src)
 {
   assert_regnum (regnum);
   write_part (regnum, offset, src, true);
@@ -1114,7 +1114,7 @@  regcache::raw_write_part (int regnum, int offset,
 
 register_status
 readable_regcache::cooked_read_part (int regnum, int offset,
-				     gdb::array_view<gdb_byte> dst)
+				     gdb::span<gdb_byte> dst)
 {
   gdb_assert (regnum >= 0 && regnum < m_descr->nr_cooked_registers);
   return read_part (regnum, offset, dst, false);
@@ -1124,7 +1124,7 @@  readable_regcache::cooked_read_part (int regnum, int offset,
 
 void
 regcache::cooked_write_part (int regnum, int offset,
-			     gdb::array_view<const gdb_byte> src)
+			     gdb::span<const gdb_byte> src)
 {
   gdb_assert (regnum >= 0 && regnum < m_descr->nr_cooked_registers);
   write_part (regnum, offset, src, false);
@@ -1133,9 +1133,9 @@  regcache::cooked_write_part (int regnum, int offset,
 /* See gdbsupport/common-regcache.h.  */
 
 void
-reg_buffer::raw_supply (int regnum, gdb::array_view<const gdb_byte> src)
+reg_buffer::raw_supply (int regnum, gdb::span<const gdb_byte> src)
 {
-  gdb::array_view<gdb_byte> dst = register_buffer (regnum);
+  gdb::span<gdb_byte> dst = register_buffer (regnum);
 
   if (src.data () != nullptr)
     {
@@ -1169,7 +1169,7 @@  void
 reg_buffer::raw_supply_integer (int regnum, const gdb_byte *addr, int addr_len,
 				bool is_signed)
 {
-  gdb::array_view<gdb_byte> dst = register_buffer (regnum);
+  gdb::span<gdb_byte> dst = register_buffer (regnum);
   bfd_endian byte_order = gdbarch_byte_order (m_descr->gdbarch);
 
   copy_integer_to_size (dst.data (), dst.size (), addr, addr_len, is_signed,
@@ -1182,7 +1182,7 @@  reg_buffer::raw_supply_integer (int regnum, const gdb_byte *addr, int addr_len,
 void
 reg_buffer::raw_supply_zeroed (int regnum)
 {
-  gdb::array_view<gdb_byte> dst = register_buffer (regnum);
+  gdb::span<gdb_byte> dst = register_buffer (regnum);
   memset (dst.data (), 0, dst.size ());
   m_register_status[regnum] = REG_VALID;
 }
@@ -1192,7 +1192,7 @@  reg_buffer::raw_supply_zeroed (int regnum)
 void
 reg_buffer::raw_supply_part_zeroed (int regnum, int offset, size_t size)
 {
-  gdb::array_view<gdb_byte> dst = register_buffer (regnum).slice (offset, size);
+  gdb::span<gdb_byte> dst = register_buffer (regnum).slice (offset, size);
   memset (dst.data (), 0, dst.size ());
   m_register_status[regnum] = REG_VALID;
 }
@@ -1200,9 +1200,9 @@  reg_buffer::raw_supply_part_zeroed (int regnum, int offset, size_t size)
 /* See gdbsupport/common-regcache.h.  */
 
 void
-reg_buffer::raw_collect (int regnum, gdb::array_view<gdb_byte> dst) const
+reg_buffer::raw_collect (int regnum, gdb::span<gdb_byte> dst) const
 {
-  gdb::array_view<const gdb_byte> src = register_buffer (regnum);
+  gdb::span<const gdb_byte> src = register_buffer (regnum);
   copy (src, dst);
 }
 
@@ -1223,7 +1223,7 @@  void
 reg_buffer::raw_collect_integer (int regnum, gdb_byte *addr, int addr_len,
 				 bool is_signed) const
 {
-  gdb::array_view<const gdb_byte> dst = register_buffer (regnum);
+  gdb::span<const gdb_byte> dst = register_buffer (regnum);
   bfd_endian byte_order = gdbarch_byte_order (m_descr->gdbarch);
   copy_integer_to_size (addr, addr_len, dst.data (), dst.size (), is_signed,
 			byte_order);
@@ -1394,7 +1394,7 @@  reg_buffer::raw_compare (int regnum, const void *buf, int offset) const
 {
   gdb_assert (buf != NULL);
 
-  gdb::array_view<const gdb_byte> regbuf = register_buffer (regnum);
+  gdb::span<const gdb_byte> regbuf = register_buffer (regnum);
   gdb_assert (offset <= regbuf.size ());
   regbuf = regbuf.slice (offset);
 
@@ -1486,7 +1486,7 @@  regcache::register_debug_string (int regno)
 
   if (regno >= 0 && regno < gdbarch_num_regs (gdbarch))
     {
-      gdb::array_view<gdb_byte> buf = register_buffer (regno);
+      gdb::span<gdb_byte> buf = register_buffer (regno);
 
       string_appendf (s, " = ");
 
diff --git a/gdb/regcache.h b/gdb/regcache.h
index adc1e473630..f136f7275a8 100644
--- a/gdb/regcache.h
+++ b/gdb/regcache.h
@@ -171,7 +171,7 @@  extern struct type *register_type (struct gdbarch *gdbarch, int regnum);
 extern int register_size (struct gdbarch *gdbarch, int regnum);
 
 using register_read_ftype
-  = gdb::function_view<register_status (int, gdb::array_view<gdb_byte>)>;
+  = gdb::function_view<register_status (int, gdb::span<gdb_byte>)>;
 
 /* A (register_number, register_value) pair.  */
 
@@ -197,7 +197,7 @@  class reg_buffer : public reg_buffer_common
   enum register_status get_register_status (int regnum) const override;
 
   /* See gdbsupport/common-regcache.h.  */
-  void raw_collect (int regnum, gdb::array_view<gdb_byte> dst) const override;
+  void raw_collect (int regnum, gdb::span<gdb_byte> dst) const override;
 
   /* Deprecated overload of the above.  */
   void raw_collect (int regnum, void *dst) const;
@@ -213,14 +213,14 @@  class reg_buffer : public reg_buffer_common
   /* Collect part of register REGNUM from this register buffer.  Start at OFFSET
      in register.  The size is given by the size of DST.  */
   void raw_collect_part (int regnum, int offset,
-			 gdb::array_view<gdb_byte> dst) const;
+			 gdb::span<gdb_byte> dst) const;
 
   /* Deprecated overload of the above.  */
   void raw_collect_part (int regnum, int offset, int len, gdb_byte *dst) const
   { raw_collect_part (regnum, offset, gdb::make_array_view (dst, len)); }
 
   /* See gdbsupport/common-regcache.h.  */
-  void raw_supply (int regnum, gdb::array_view<const gdb_byte> src) override;
+  void raw_supply (int regnum, gdb::span<const gdb_byte> src) override;
 
   /* Deprecated overload of the above.  */
   void raw_supply (int regnum, const void *src);
@@ -248,7 +248,7 @@  class reg_buffer : public reg_buffer_common
      the register.  The size is given by the size of SRC.  The rest of the
      register left untouched.  */
   void raw_supply_part (int regnum, int offset,
-			gdb::array_view<const gdb_byte> src);
+			gdb::span<const gdb_byte> src);
 
   void invalidate (int regnum);
 
@@ -268,9 +268,9 @@  class reg_buffer : public reg_buffer_common
 
   /* Return a view on register REGNUM's buffer cache.  */
   template <typename ElemType>
-  gdb::array_view<ElemType> register_buffer (int regnum) const;
-  gdb::array_view<const gdb_byte> register_buffer (int regnum) const;
-  gdb::array_view<gdb_byte> register_buffer (int regnum);
+  gdb::span<ElemType> register_buffer (int regnum) const;
+  gdb::span<const gdb_byte> register_buffer (int regnum) const;
+  gdb::span<gdb_byte> register_buffer (int regnum);
 
   /* Save a register cache.  The set of registers saved into the
      regcache determined by the save_reggroup.  COOKED_READ returns
@@ -300,7 +300,7 @@  class readable_regcache : public reg_buffer
 
   /* Transfer a raw register [0..NUM_REGS) from core-gdb to this regcache,
      return its value in *BUF and return its availability status.  */
-  register_status raw_read (int regnum, gdb::array_view<gdb_byte> dst);
+  register_status raw_read (int regnum, gdb::span<gdb_byte> dst);
 
   /* Deprecated overload of the above.  */
   register_status raw_read (int regnum, gdb_byte *dst);
@@ -310,7 +310,7 @@  class readable_regcache : public reg_buffer
 
   /* Partial transfer of raw registers.  Return the status of the register.  */
   register_status raw_read_part (int regnum, int offset,
-				 gdb::array_view<gdb_byte> dst);
+				 gdb::span<gdb_byte> dst);
 
   /* Deprecated overload of the above.  */
   register_status raw_read_part (int regnum, int offset, int len,
@@ -322,7 +322,7 @@  class readable_regcache : public reg_buffer
 
   /* Transfer a raw register [0..NUM_REGS+NUM_PSEUDO_REGS) from core-gdb to
      this regcache, return its value in DST and return its availability status.  */
-  register_status cooked_read (int regnum, gdb::array_view<gdb_byte> dst);
+  register_status cooked_read (int regnum, gdb::span<gdb_byte> dst);
   register_status cooked_read (int regnum, gdb_byte *dst);
 
   template<typename T, typename = RequireLongest<T>>
@@ -330,7 +330,7 @@  class readable_regcache : public reg_buffer
 
   /* Partial transfer of a cooked register.  */
   register_status cooked_read_part (int regnum, int offset,
-				    gdb::array_view<gdb_byte> dst);
+				    gdb::span<gdb_byte> dst);
 
   /* Deprecated overload of the above.  */
   register_status cooked_read_part (int regnum, int offset, int len, gdb_byte *src)
@@ -345,7 +345,7 @@  class readable_regcache : public reg_buffer
   /* Perform a partial register transfer using a read, modify, write
      operation.  Will fail if register is currently invalid.  */
   register_status read_part (int regnum, int offset,
-			     gdb::array_view<gdb_byte> dst, bool is_raw);
+			     gdb::span<gdb_byte> dst, bool is_raw);
 };
 
 /* Buffer of registers, can be read and written.  */
@@ -381,7 +381,7 @@  class regcache : public detached_regcache
   /* Update the value of raw register REGNUM (in the range [0..NUM_REGS)) and
      transfer its value to core-gdb.  */
 
-  void raw_write (int regnum, gdb::array_view<const gdb_byte> src);
+  void raw_write (int regnum, gdb::span<const gdb_byte> src);
 
   /* Deprecated overload of the above.  */
   void raw_write (int regnum, const gdb_byte *src);
@@ -390,7 +390,7 @@  class regcache : public detached_regcache
   void raw_write (int regnum, T val);
 
   /* Transfer of pseudo-registers.  */
-  void cooked_write (int regnum, gdb::array_view<const gdb_byte> src);
+  void cooked_write (int regnum, gdb::span<const gdb_byte> src);
 
   /* Deprecated overload of the above.  */
   void cooked_write (int regnum, const gdb_byte *src);
@@ -403,7 +403,7 @@  class regcache : public detached_regcache
   /* Partial transfer of raw registers.  Perform read, modify, write style
      operations.  */
   void raw_write_part (int regnum, int offset,
-		       gdb::array_view<const gdb_byte> src);
+		       gdb::span<const gdb_byte> src);
 
   /* Deprecated overload of the above.  */
   void raw_write_part (int regnum, int offset, int len, const gdb_byte *src)
@@ -412,7 +412,7 @@  class regcache : public detached_regcache
   /* Partial transfer of a cooked register.  Perform read, modify, write style
      operations.  */
   void cooked_write_part (int regnum, int offset,
-			  gdb::array_view<const gdb_byte> src);
+			  gdb::span<const gdb_byte> src);
 
   /* Deprecated overload of the above.  */
   void cooked_write_part (int regnum, int offset, int len, const gdb_byte *src)
@@ -483,7 +483,7 @@  class regcache : public detached_regcache
   /* Perform a partial register transfer using a read, modify, write
      operation.  */
   register_status write_part (int regnum, int offset,
-			      gdb::array_view<const gdb_byte> src,
+			      gdb::span<const gdb_byte> src,
 			      bool is_raw);
 
   /* The inferior to switch to, to make target calls.
diff --git a/gdb/remote.c b/gdb/remote.c
index 6e3a2089b9e..5209d5eb819 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -1018,12 +1018,12 @@  class remote_target : public process_stratum_target
 
   void mourn_inferior () override;
 
-  void pass_signals (gdb::array_view<const unsigned char>) override;
+  void pass_signals (gdb::span<const unsigned char>) override;
 
   int set_syscall_catchpoint (int, bool, int,
-			      gdb::array_view<const int>) override;
+			      gdb::span<const int>) override;
 
-  void program_signals (gdb::array_view<const unsigned char>) override;
+  void program_signals (gdb::span<const unsigned char>) override;
 
   bool thread_alive (ptid_t ptid) override;
 
@@ -1039,7 +1039,7 @@  class remote_target : public process_stratum_target
 					     int handle_len,
 					     inferior *inf) override;
 
-  gdb::array_view<const gdb_byte> thread_info_to_thread_handle (struct thread_info *tp)
+  gdb::span<const gdb_byte> thread_info_to_thread_handle (struct thread_info *tp)
     override;
 
   void stop (ptid_t) override;
@@ -3324,7 +3324,7 @@  record_currthread (struct remote_state *rs, ptid_t currthread)
    it can simply pass through to the inferior without reporting.  */
 
 void
-remote_target::pass_signals (gdb::array_view<const unsigned char> pass_signals)
+remote_target::pass_signals (gdb::span<const unsigned char> pass_signals)
 {
   if (m_features.packet_support (PACKET_QPassSignals) != PACKET_DISABLE)
     {
@@ -3374,7 +3374,7 @@  remote_target::pass_signals (gdb::array_view<const unsigned char> pass_signals)
 
 int
 remote_target::set_syscall_catchpoint (int pid, bool needed, int any_count,
-				       gdb::array_view<const int> syscall_counts)
+				       gdb::span<const int> syscall_counts)
 {
   const char *catch_packet;
   int n_sysno = 0;
@@ -3443,7 +3443,7 @@  remote_target::set_syscall_catchpoint (int pid, bool needed, int any_count,
    signals it should pass through to the inferior when detaching.  */
 
 void
-remote_target::program_signals (gdb::array_view<const unsigned char> signals)
+remote_target::program_signals (gdb::span<const unsigned char> signals)
 {
   if (m_features.packet_support (PACKET_QProgramSignals) != PACKET_DISABLE)
     {
@@ -12617,7 +12617,7 @@  struct cli_packet_command_callbacks : public send_remote_packet_callbacks
   /* Called before the packet is sent.  BUF is the packet content before
      the protocol specific prefix, suffix, and escaping is added.  */
 
-  void sending (gdb::array_view<const char> &buf) override
+  void sending (gdb::span<const char> &buf) override
   {
     gdb_puts ("sending: ");
     print_packet (buf);
@@ -12626,7 +12626,7 @@  struct cli_packet_command_callbacks : public send_remote_packet_callbacks
 
   /* Called with BUF, the reply from the remote target.  */
 
-  void received (gdb::array_view<const char> &buf) override
+  void received (gdb::span<const char> &buf) override
   {
     gdb_puts ("received: \"");
     print_packet (buf);
@@ -12639,7 +12639,7 @@  struct cli_packet_command_callbacks : public send_remote_packet_callbacks
      '\x??' with '??' replaced by the hexadecimal value of the byte.  */
 
   static void
-  print_packet (gdb::array_view<const char> &buf)
+  print_packet (gdb::span<const char> &buf)
   {
     string_file stb;
 
@@ -12659,7 +12659,7 @@  struct cli_packet_command_callbacks : public send_remote_packet_callbacks
 /* See remote.h.  */
 
 void
-send_remote_packet (gdb::array_view<const char> &buf,
+send_remote_packet (gdb::span<const char> &buf,
 		    send_remote_packet_callbacks *callbacks)
 {
   if (buf.size () == 0 || buf.data ()[0] == '\0')
@@ -12678,7 +12678,7 @@  send_remote_packet (gdb::array_view<const char> &buf,
   if (bytes < 0)
     error (_("error while fetching packet from remote target"));
 
-  gdb::array_view<const char> view (&rs->buf[0], bytes);
+  gdb::span<const char> view (&rs->buf[0], bytes);
   callbacks->received (view);
 }
 
@@ -12688,7 +12688,7 @@  static void
 cli_packet_command (const char *args, int from_tty)
 {
   cli_packet_command_callbacks cb;
-  gdb::array_view<const char> view
+  gdb::span<const char> view
     = gdb::make_array_view (args, args == nullptr ? 0 : strlen (args));
   send_remote_packet (view, &cb);
 }
@@ -15870,7 +15870,7 @@  remote_target::thread_handle_to_thread_info (const gdb_byte *thread_handle,
   return NULL;
 }
 
-gdb::array_view<const gdb_byte>
+gdb::span<const gdb_byte>
 remote_target::thread_info_to_thread_handle (struct thread_info *tp)
 {
   remote_thread_info *priv = get_remote_thread_info (tp);
diff --git a/gdb/remote.h b/gdb/remote.h
index 4e61c9c88e3..52253803137 100644
--- a/gdb/remote.h
+++ b/gdb/remote.h
@@ -92,7 +92,7 @@  struct send_remote_packet_callbacks
      (before any of the protocol specific prefix, suffix, or escaping is
      applied).  */
 
-  virtual void sending (gdb::array_view<const char> &buf) = 0;
+  virtual void sending (gdb::span<const char> &buf) = 0;
 
   /* The RECEIVED callback is called once a reply has been received from
      the remote target.  The content of the reply is in BUF which can't be
@@ -100,7 +100,7 @@  struct send_remote_packet_callbacks
      RECEIVED call has returned.  If you need to preserve the contents of
      BUF then a copy should be taken.  */
 
-  virtual void received (gdb::array_view<const char> &buf) = 0;
+  virtual void received (gdb::span<const char> &buf) = 0;
 };
 
 /* Send BUF to the current remote target.  If BUF points to an empty
@@ -112,7 +112,7 @@  struct send_remote_packet_callbacks
    target, and calls CALLBACKS->received() with the reply once this is
    received from the remote target.  */
 
-extern void send_remote_packet (gdb::array_view<const char> &buf,
+extern void send_remote_packet (gdb::span<const char> &buf,
 				send_remote_packet_callbacks *callbacks);
 
 
diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
index 9c2a4c4c811..1df3740d39d 100644
--- a/gdb/rust-lang.c
+++ b/gdb/rust-lang.c
@@ -648,7 +648,7 @@  rust_language::print_enum (struct value *val, struct ui_file *stream,
   opts.deref_ref = false;
 
   gdb_assert (rust_enum_p (type));
-  gdb::array_view<const gdb_byte> view
+  gdb::span<const gdb_byte> view
     (val->contents_for_printing ().data (),
      val->type ()->length ());
   type = resolve_dynamic_type (type, view, val->address ());
diff --git a/gdb/solib-darwin.c b/gdb/solib-darwin.c
index 11ed0bb154e..cd82c26b266 100644
--- a/gdb/solib-darwin.c
+++ b/gdb/solib-darwin.c
@@ -170,7 +170,7 @@  lookup_symbol_from_bfd (bfd *abfd, const char *symname)
 {
   CORE_ADDR symaddr = 0;
 
-  gdb::array_view<asymbol *> symbol_table
+  gdb::span<asymbol *> symbol_table
     = gdb_bfd_canonicalize_symtab (abfd, false);
 
   for (const asymbol *sym : symbol_table)
diff --git a/gdb/solib.c b/gdb/solib.c
index 7ea3084bf48..6b778d7c47d 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -1605,7 +1605,7 @@  gdb_bfd_lookup_symbol_from_symtab (
   bfd *abfd, gdb::function_view<bool (const asymbol *)> match_sym)
 {
   CORE_ADDR symaddr = 0;
-  gdb::array_view<asymbol *> symbol_table
+  gdb::span<asymbol *> symbol_table
     = gdb_bfd_canonicalize_symtab (abfd, false);
 
   for (asymbol *sym : symbol_table)
diff --git a/gdb/source.c b/gdb/source.c
index 5c7c344a1aa..a093d93297c 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -1472,7 +1472,7 @@  info_line_command (const char *arg, int from_tty)
 
   std::vector<symtab_and_line> decoded_sals;
   symtab_and_line curr_sal;
-  gdb::array_view<symtab_and_line> sals;
+  gdb::span<symtab_and_line> sals;
 
   if (arg == 0)
     {
diff --git a/gdb/symtab.c b/gdb/symtab.c
index b082a488b88..8b1fb8ec87c 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -6521,7 +6521,7 @@  static struct symbol_impl symbol_impl[MAX_SYMBOL_IMPLS];
 /* The globally visible pointer.  This is separate from 'symbol_impl'
    so that it can be const.  */
 
-gdb::array_view<const struct symbol_impl> symbol_impls (symbol_impl);
+gdb::span<const struct symbol_impl> symbol_impls (symbol_impl);
 
 /* Make sure we saved enough room in struct symbol.  */
 
@@ -6678,7 +6678,7 @@  symbol::value_block () const
 /* See symtab.h.  */
 
 void
-symbol::relocate (gdb::array_view<const CORE_ADDR> delta)
+symbol::relocate (gdb::span<const CORE_ADDR> delta)
 {
   if ((loc_class () == LOC_LABEL || loc_class () == LOC_STATIC)
       && section_index () >= 0)
diff --git a/gdb/symtab.h b/gdb/symtab.h
index bd719af6669..26ce3ebb132 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -1154,7 +1154,7 @@  struct symbol_block_ops
   /* Return the DWARF block data of function FRAMEFUNC valid for inferior
      context address PC.  Return an empty view if no such location is
      valid for PC.  */
-  gdb::array_view<const gdb_byte> (*find_frame_base_location)
+  gdb::span<const gdb_byte> (*find_frame_base_location)
     (struct symbol *framefunc, CORE_ADDR pc);
 
   /* Return the frame base address.  FRAME is the frame for which we want to
@@ -1222,7 +1222,7 @@  enum symbol_subclass_kind
   SYMBOL_RUST_VTABLE
 };
 
-extern gdb::array_view<const struct symbol_impl> symbol_impls;
+extern gdb::span<const struct symbol_impl> symbol_impls;
 
 /* This structure is space critical.  See space comments at the top.  */
 
@@ -1443,7 +1443,7 @@  struct symbol : public general_symbol_info, public allocate_on_obstack<symbol>
 
   /* Relocate this symbol.  OFFSETS is the relocation offsets to use.  */
 
-  void relocate (gdb::array_view<const CORE_ADDR> offsets);
+  void relocate (gdb::span<const CORE_ADDR> offsets);
 
   /* Data type of value */
 
diff --git a/gdb/target-debug.h b/gdb/target-debug.h
index 949847b181c..bb8c467ab1d 100644
--- a/gdb/target-debug.h
+++ b/gdb/target-debug.h
@@ -278,7 +278,7 @@  target_debug_print_traceframe_info_up (std::unique_ptr<traceframe_info> &info)
 
 static std::string
 target_debug_print_gdb_array_view_const_int
-  (const gdb::array_view<const int> &view)
+  (const gdb::span<const int> &view)
 { return host_address_to_string (view.data ()); }
 
 static std::string
@@ -325,7 +325,7 @@  target_debug_print_target_wait_flags (target_wait_flags options)
 { return target_options_to_string (options); }
 
 static std::string
-target_debug_print_signals (gdb::array_view<const unsigned char> sigs)
+target_debug_print_signals (gdb::span<const unsigned char> sigs)
 {
   std::string s = "{";
 
@@ -346,7 +346,7 @@  target_debug_print_size_t (size_t size)
 }
 
 static std::string
-target_debug_print_gdb_array_view_const_gdb_byte (gdb::array_view<const gdb_byte> vector)
+target_debug_print_gdb_array_view_const_gdb_byte (gdb::span<const gdb_byte> vector)
 {
   std::string s = "{";
 
diff --git a/gdb/target-delegates-gen.c b/gdb/target-delegates-gen.c
index b39fd7cb33a..b625112808e 100644
--- a/gdb/target-delegates-gen.c
+++ b/gdb/target-delegates-gen.c
@@ -80,17 +80,17 @@  struct dummy_target : public target_ops
   int insert_exec_catchpoint (int arg0) override;
   int remove_exec_catchpoint (int arg0) override;
   void follow_exec (inferior *arg0, ptid_t arg1, const char *arg2) override;
-  int set_syscall_catchpoint (int arg0, bool arg1, int arg2, gdb::array_view<const int> arg3) override;
+  int set_syscall_catchpoint (int arg0, bool arg1, int arg2, gdb::span<const int> arg3) override;
   void mourn_inferior () override;
-  void pass_signals (gdb::array_view<const unsigned char> arg0) override;
-  void program_signals (gdb::array_view<const unsigned char> arg0) override;
+  void pass_signals (gdb::span<const unsigned char> arg0) override;
+  void program_signals (gdb::span<const unsigned char> arg0) override;
   bool thread_alive (ptid_t arg0) override;
   void update_thread_list () override;
   std::string pid_to_str (ptid_t arg0) override;
   const char *extra_thread_info (thread_info *arg0) override;
   const char *thread_name (thread_info *arg0) override;
   thread_info *thread_handle_to_thread_info (const gdb_byte *arg0, int arg1, inferior *arg2) override;
-  gdb::array_view<const_gdb_byte> thread_info_to_thread_handle (struct thread_info *arg0) override;
+  gdb::span<const_gdb_byte> thread_info_to_thread_handle (struct thread_info *arg0) override;
   void stop (ptid_t arg0) override;
   void interrupt () override;
   void pass_ctrlc () override;
@@ -261,17 +261,17 @@  struct debug_target : public target_ops
   int insert_exec_catchpoint (int arg0) override;
   int remove_exec_catchpoint (int arg0) override;
   void follow_exec (inferior *arg0, ptid_t arg1, const char *arg2) override;
-  int set_syscall_catchpoint (int arg0, bool arg1, int arg2, gdb::array_view<const int> arg3) override;
+  int set_syscall_catchpoint (int arg0, bool arg1, int arg2, gdb::span<const int> arg3) override;
   void mourn_inferior () override;
-  void pass_signals (gdb::array_view<const unsigned char> arg0) override;
-  void program_signals (gdb::array_view<const unsigned char> arg0) override;
+  void pass_signals (gdb::span<const unsigned char> arg0) override;
+  void program_signals (gdb::span<const unsigned char> arg0) override;
   bool thread_alive (ptid_t arg0) override;
   void update_thread_list () override;
   std::string pid_to_str (ptid_t arg0) override;
   const char *extra_thread_info (thread_info *arg0) override;
   const char *thread_name (thread_info *arg0) override;
   thread_info *thread_handle_to_thread_info (const gdb_byte *arg0, int arg1, inferior *arg2) override;
-  gdb::array_view<const_gdb_byte> thread_info_to_thread_handle (struct thread_info *arg0) override;
+  gdb::span<const_gdb_byte> thread_info_to_thread_handle (struct thread_info *arg0) override;
   void stop (ptid_t arg0) override;
   void interrupt () override;
   void pass_ctrlc () override;
@@ -1588,19 +1588,19 @@  debug_target::follow_exec (inferior *arg0, ptid_t arg1, const char *arg2)
 }
 
 int
-target_ops::set_syscall_catchpoint (int arg0, bool arg1, int arg2, gdb::array_view<const int> arg3)
+target_ops::set_syscall_catchpoint (int arg0, bool arg1, int arg2, gdb::span<const int> arg3)
 {
   return this->beneath ()->set_syscall_catchpoint (arg0, arg1, arg2, arg3);
 }
 
 int
-dummy_target::set_syscall_catchpoint (int arg0, bool arg1, int arg2, gdb::array_view<const int> arg3)
+dummy_target::set_syscall_catchpoint (int arg0, bool arg1, int arg2, gdb::span<const int> arg3)
 {
   return 1;
 }
 
 int
-debug_target::set_syscall_catchpoint (int arg0, bool arg1, int arg2, gdb::array_view<const int> arg3)
+debug_target::set_syscall_catchpoint (int arg0, bool arg1, int arg2, gdb::span<const int> arg3)
 {
   target_debug_printf_nofunc ("-> %s->set_syscall_catchpoint (...)", this->beneath ()->shortname ());
   int result
@@ -1637,18 +1637,18 @@  debug_target::mourn_inferior ()
 }
 
 void
-target_ops::pass_signals (gdb::array_view<const unsigned char> arg0)
+target_ops::pass_signals (gdb::span<const unsigned char> arg0)
 {
   this->beneath ()->pass_signals (arg0);
 }
 
 void
-dummy_target::pass_signals (gdb::array_view<const unsigned char> arg0)
+dummy_target::pass_signals (gdb::span<const unsigned char> arg0)
 {
 }
 
 void
-debug_target::pass_signals (gdb::array_view<const unsigned char> arg0)
+debug_target::pass_signals (gdb::span<const unsigned char> arg0)
 {
   target_debug_printf_nofunc ("-> %s->pass_signals (...)", this->beneath ()->shortname ());
   this->beneath ()->pass_signals (arg0);
@@ -1658,18 +1658,18 @@  debug_target::pass_signals (gdb::array_view<const unsigned char> arg0)
 }
 
 void
-target_ops::program_signals (gdb::array_view<const unsigned char> arg0)
+target_ops::program_signals (gdb::span<const unsigned char> arg0)
 {
   this->beneath ()->program_signals (arg0);
 }
 
 void
-dummy_target::program_signals (gdb::array_view<const unsigned char> arg0)
+dummy_target::program_signals (gdb::span<const unsigned char> arg0)
 {
 }
 
 void
-debug_target::program_signals (gdb::array_view<const unsigned char> arg0)
+debug_target::program_signals (gdb::span<const unsigned char> arg0)
 {
   target_debug_printf_nofunc ("-> %s->program_signals (...)", this->beneath ()->shortname ());
   this->beneath ()->program_signals (arg0);
@@ -1825,23 +1825,23 @@  debug_target::thread_handle_to_thread_info (const gdb_byte *arg0, int arg1, infe
   return result;
 }
 
-gdb::array_view<const_gdb_byte>
+gdb::span<const_gdb_byte>
 target_ops::thread_info_to_thread_handle (struct thread_info *arg0)
 {
   return this->beneath ()->thread_info_to_thread_handle (arg0);
 }
 
-gdb::array_view<const_gdb_byte>
+gdb::span<const_gdb_byte>
 dummy_target::thread_info_to_thread_handle (struct thread_info *arg0)
 {
-  return gdb::array_view<const gdb_byte> ();
+  return gdb::span<const gdb_byte> ();
 }
 
-gdb::array_view<const_gdb_byte>
+gdb::span<const_gdb_byte>
 debug_target::thread_info_to_thread_handle (struct thread_info *arg0)
 {
   target_debug_printf_nofunc ("-> %s->thread_info_to_thread_handle (...)", this->beneath ()->shortname ());
-  gdb::array_view<const_gdb_byte> result
+  gdb::span<const_gdb_byte> result
     = this->beneath ()->thread_info_to_thread_handle (arg0);
   target_debug_printf_nofunc ("<- %s->thread_info_to_thread_handle (%s) = %s",
 	      this->beneath ()->shortname (),
diff --git a/gdb/target.c b/gdb/target.c
index 7a83b983922..bf04849fa17 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -329,7 +329,7 @@  target_remove_exec_catchpoint (int pid)
 
 int
 target_set_syscall_catchpoint (int pid, bool needed, int any_count,
-			       gdb::array_view<const int> syscall_counts)
+			       gdb::span<const int> syscall_counts)
 {
   target_ops *target = current_inferior ()->top_target ();
 
@@ -2646,7 +2646,7 @@  target_thread_handle_to_thread_info (const gdb_byte *thread_handle,
 
 /* See target.h.  */
 
-gdb::array_view<const gdb_byte>
+gdb::span<const gdb_byte>
 target_thread_info_to_thread_handle (struct thread_info *tip)
 {
   target_ops *target = current_inferior ()->top_target ();
@@ -2696,13 +2696,13 @@  target_has_pending_events ()
 }
 
 void
-target_pass_signals (gdb::array_view<const unsigned char> pass_signals)
+target_pass_signals (gdb::span<const unsigned char> pass_signals)
 {
   current_inferior ()->top_target ()->pass_signals (pass_signals);
 }
 
 void
-target_program_signals (gdb::array_view<const unsigned char> program_signals)
+target_program_signals (gdb::span<const unsigned char> program_signals)
 {
   current_inferior ()->top_target ()->program_signals (program_signals);
 }
diff --git a/gdb/target.h b/gdb/target.h
index 38bdc68f6a3..1037aefc3bb 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -666,7 +666,7 @@  struct target_ops
     virtual void follow_exec (inferior *, ptid_t, const char *)
       TARGET_DEFAULT_IGNORE ();
     virtual int set_syscall_catchpoint (int, bool, int,
-					gdb::array_view<const int>)
+					gdb::span<const int>)
       TARGET_DEFAULT_RETURN (1);
     virtual void mourn_inferior ()
       TARGET_DEFAULT_FUNC (default_mourn_inferior);
@@ -678,12 +678,12 @@  struct target_ops
 
     /* Documentation of this routine is provided with the corresponding
        target_* macro.  */
-    virtual void pass_signals (gdb::array_view<const unsigned char> TARGET_DEBUG_PRINTER (target_debug_print_signals))
+    virtual void pass_signals (gdb::span<const unsigned char> TARGET_DEBUG_PRINTER (target_debug_print_signals))
       TARGET_DEFAULT_IGNORE ();
 
     /* Documentation of this routine is provided with the
        corresponding target_* function.  */
-    virtual void program_signals (gdb::array_view<const unsigned char> TARGET_DEBUG_PRINTER (target_debug_print_signals))
+    virtual void program_signals (gdb::span<const unsigned char> TARGET_DEBUG_PRINTER (target_debug_print_signals))
       TARGET_DEFAULT_IGNORE ();
 
     virtual bool thread_alive (ptid_t ptid)
@@ -701,8 +701,8 @@  struct target_ops
 						       inferior *inf)
       TARGET_DEFAULT_RETURN (NULL);
     /* See target_thread_info_to_thread_handle.  */
-    virtual gdb::array_view<const_gdb_byte> thread_info_to_thread_handle (struct thread_info *)
-      TARGET_DEFAULT_RETURN (gdb::array_view<const gdb_byte> ());
+    virtual gdb::span<const_gdb_byte> thread_info_to_thread_handle (struct thread_info *)
+      TARGET_DEFAULT_RETURN (gdb::span<const gdb_byte> ());
     virtual void stop (ptid_t)
       TARGET_DEFAULT_IGNORE ();
     virtual void interrupt ()
@@ -1832,7 +1832,7 @@  extern int target_remove_exec_catchpoint (int pid);
 
 extern int target_set_syscall_catchpoint
   (int pid, bool needed, int any_count,
-   gdb::array_view<const int> syscall_counts);
+   gdb::span<const int> syscall_counts);
 
 /* The debugger has completed a blocking wait() call.  There is now
    some process event that must be processed.  This function should
@@ -1858,7 +1858,7 @@  extern int target_can_run ();
    if mentioned in a previous target_pass_signals call.  */
 
 extern void target_pass_signals
-  (gdb::array_view<const unsigned char> pass_signals);
+  (gdb::span<const unsigned char> pass_signals);
 
 /* Set list of signals the target may pass to the inferior.  This
    directly maps to the "handle SIGNAL pass/nopass" setting.
@@ -1875,7 +1875,7 @@  extern void target_pass_signals
    pending signals not reported to GDB).  */
 
 extern void target_program_signals
-  (gdb::array_view<const unsigned char> program_signals);
+  (gdb::span<const unsigned char> program_signals);
 
 /* Check to see if a thread is still alive.  */
 
@@ -2015,7 +2015,7 @@  extern struct thread_info *target_thread_handle_to_thread_info
 /* Given a thread, return the thread handle, a target-specific sequence of
    bytes which serves as a thread identifier within the program being
    debugged.  */
-extern gdb::array_view<const gdb_byte> target_thread_info_to_thread_handle
+extern gdb::span<const gdb_byte> target_thread_info_to_thread_handle
   (struct thread_info *);
 
 /* Attempts to find the pathname of the executable file
diff --git a/gdb/thread.c b/gdb/thread.c
index e14254619e3..525ff58c1e9 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -592,7 +592,7 @@  find_thread_id (struct inferior *inf, int thr_num)
 /* See gdbthread.h.  */
 
 struct thread_info *
-find_thread_by_handle (gdb::array_view<const gdb_byte> handle,
+find_thread_by_handle (gdb::span<const gdb_byte> handle,
 		       struct inferior *inf)
 {
   return target_thread_handle_to_thread_info (handle.data (),
diff --git a/gdb/trad-frame.c b/gdb/trad-frame.c
index 48d73f0ef97..749832e7df3 100644
--- a/gdb/trad-frame.c
+++ b/gdb/trad-frame.c
@@ -171,7 +171,7 @@  trad_frame_set_reg_regmap (struct trad_frame_cache *this_trad_cache,
 void
 trad_frame_set_reg_value_bytes (struct trad_frame_cache *this_trad_cache,
 				int regnum,
-				gdb::array_view<const gdb_byte> bytes)
+				gdb::span<const gdb_byte> bytes)
 {
   /* External interface for users of trad_frame_cache
      (who cannot access the prev_regs object directly).  */
diff --git a/gdb/trad-frame.h b/gdb/trad-frame.h
index 5026a14f735..7c30c17f5ae 100644
--- a/gdb/trad-frame.h
+++ b/gdb/trad-frame.h
@@ -56,7 +56,7 @@  void trad_frame_set_reg_value (struct trad_frame_cache *this_cache,
    contained in BYTES with size SIZE.  */
 void trad_frame_set_reg_value_bytes (struct trad_frame_cache *this_trad_cache,
 				     int regnum,
-				     gdb::array_view<const gdb_byte> bytes);
+				     gdb::span<const gdb_byte> bytes);
 
 struct value *trad_frame_get_register (struct trad_frame_cache *this_trad_cache,
 				       const frame_info_ptr &this_frame,
@@ -114,7 +114,7 @@  struct trad_frame_saved_reg
   /* Encode that the saved register's value is stored as a sequence of bytes.
      This is useful when the value is larger than what primitive types
      can hold.  */
-  void set_value_bytes (gdb::array_view<const gdb_byte> bytes)
+  void set_value_bytes (gdb::span<const gdb_byte> bytes)
   {
     /* Allocate the space and copy the data bytes.  */
     auto *data = frame_obstack_calloc<gdb_byte> (bytes.size ());
@@ -145,7 +145,7 @@  struct trad_frame_saved_reg
     return m_reg.addr;
   }
 
-  gdb::array_view<const gdb_byte> value_bytes () const
+  gdb::span<const gdb_byte> value_bytes () const
   {
     gdb_assert (m_kind == trad_frame_saved_reg_kind::VALUE_BYTES);
     return { m_reg.value_bytes, m_reg.bytes_len };
diff --git a/gdb/unittests/intrusive_list-selftests.c b/gdb/unittests/intrusive_list-selftests.c
index aa68b7d21ec..89695374857 100644
--- a/gdb/unittests/intrusive_list-selftests.c
+++ b/gdb/unittests/intrusive_list-selftests.c
@@ -81,7 +81,7 @@  struct item_with_member
 template <typename ListType>
 static void
 verify_items (const ListType &list,
-	      gdb::array_view<const typename ListType::value_type *> expected)
+	      gdb::span<const typename ListType::value_type *> expected)
 {
   using item_type = typename ListType::value_type;
 
diff --git a/gdb/unittests/span-selftests.c b/gdb/unittests/span-selftests.c
index 760fecf9ddc..cb1e25976f3 100644
--- a/gdb/unittests/span-selftests.c
+++ b/gdb/unittests/span-selftests.c
@@ -1,4 +1,4 @@ 
-/* Self tests for array_view for GDB, the GNU debugger.
+/* Self tests for span for GDB, the GNU debugger.
 
    Copyright (C) 2017-2026 Free Software Foundation, Inc.
 
@@ -23,11 +23,11 @@ 
 #include <vector>
 
 namespace selftests {
-namespace array_view_tests {
+namespace span_tests {
 
 /* Triviality checks.  */
 #define CHECK_TRAIT(TRAIT)			\
-  static_assert (std::TRAIT<gdb::array_view<gdb_byte>>::value, "")
+  static_assert (std::TRAIT<gdb::span<gdb_byte>>::value, "")
 
 CHECK_TRAIT (is_trivially_copyable);
 CHECK_TRAIT (is_trivially_move_assignable);
@@ -52,26 +52,26 @@  static constexpr bool
 check_convertible ()
 {
   using T = gdb_byte;
-  using gdb::array_view;
+  using gdb::span;
 
   return (true
-	  /* immutable array_view */
-	  &&  is_convertible<const T (&) [1],	array_view<const T>> ()
-	  &&  is_convertible<T (&) [1], 	array_view<const T>> ()
-	  &&  is_convertible<const T, 		array_view<const T>> ()
-	  &&  is_convertible<T, 		array_view<const T>> ()
-
-	  /* mutable array_view */
-	  &&  is_convertible<T (&) [1], 	array_view<T>> ()
-	  && !is_convertible<const T (&) [1],	array_view<T>> ()
-	  &&  is_convertible<T, 		array_view<T>> ()
-	  && !is_convertible<const T,		array_view<T>> ()
+	  /* immutable span */
+	  &&  is_convertible<const T (&) [1],	span<const T>> ()
+	  &&  is_convertible<T (&) [1], 	span<const T>> ()
+	  &&  is_convertible<const T, 		span<const T>> ()
+	  &&  is_convertible<T, 		span<const T>> ()
+
+	  /* mutable span */
+	  &&  is_convertible<T (&) [1], 	span<T>> ()
+	  && !is_convertible<const T (&) [1],	span<T>> ()
+	  &&  is_convertible<T, 		span<T>> ()
+	  && !is_convertible<const T,		span<T>> ()
 
 	  /* While float is implicitly convertible to gdb_byte, we
-	     don't want implicit float->array_view<gdb_byte>
+	     don't want implicit float->span<gdb_byte>
 	     conversion.  */
-	  && !is_convertible<float, 		array_view<const T>> ()
-	  && !is_convertible<float, 		array_view<T>> ());
+	  && !is_convertible<float, 		span<const T>> ()
+	  && !is_convertible<float, 		span<T>> ());
 }
 
 static_assert (check_convertible (), "");
@@ -87,29 +87,29 @@  struct C : A { int l; };
 static constexpr bool
 check ()
 {
-  using gdb::array_view;
+  using gdb::span;
 
   return (true
 
 	  /* array->view  */
 
-	  &&  is_convertible <A (&)[1], array_view<A>> ()
-	  && !is_convertible <B (&)[1], array_view<A>> ()
-	  && !is_convertible <C (&)[1], array_view<A>> ()
+	  &&  is_convertible <A (&)[1], span<A>> ()
+	  && !is_convertible <B (&)[1], span<A>> ()
+	  && !is_convertible <C (&)[1], span<A>> ()
 
-	  && !is_convertible <A (&)[1], array_view<B>> ()
-	  &&  is_convertible <B (&)[1], array_view<B>> ()
-	  && !is_convertible <C (&)[1], array_view<B>> ()
+	  && !is_convertible <A (&)[1], span<B>> ()
+	  &&  is_convertible <B (&)[1], span<B>> ()
+	  && !is_convertible <C (&)[1], span<B>> ()
 
 	  /* elem->view  */
 
-	  &&  is_convertible <A, array_view<A>> ()
-	  && !is_convertible <B, array_view<A>> ()
-	  && !is_convertible <C, array_view<A>> ()
+	  &&  is_convertible <A, span<A>> ()
+	  && !is_convertible <B, span<A>> ()
+	  && !is_convertible <C, span<A>> ()
 
-	  && !is_convertible <A, array_view<B>> ()
-	  &&  is_convertible <B, array_view<B>> ()
-	  && !is_convertible <C, array_view<B>> ());
+	  && !is_convertible <A, span<B>> ()
+	  &&  is_convertible <B, span<B>> ()
+	  && !is_convertible <C, span<B>> ());
 }
 
 /* Check that there's no container->view conversion for containers of derived
@@ -119,15 +119,15 @@  template<template<typename ...> class Container>
 static constexpr bool
 check_ctor_from_container ()
 {
-  using gdb::array_view;
+  using gdb::span;
 
-  return (    is_convertible <Container<A>, array_view<A>> ()
-	  && !is_convertible <Container<B>, array_view<A>> ()
-	  && !is_convertible <Container<C>, array_view<A>> ()
+  return (    is_convertible <Container<A>, span<A>> ()
+	  && !is_convertible <Container<B>, span<A>> ()
+	  && !is_convertible <Container<C>, span<A>> ()
 
-	  && !is_convertible <Container<A>, array_view<B>> ()
-	  &&  is_convertible <Container<B>, array_view<B>> ()
-	  && !is_convertible <Container<C>, array_view<B>> ());
+	  && !is_convertible <Container<A>, span<B>> ()
+	  &&  is_convertible <Container<B>, span<B>> ()
+	  && !is_convertible <Container<C>, span<B>> ());
 }
 
 } /* namespace no_slicing */
@@ -139,40 +139,40 @@  template<typename T> using StdArray1 = std::array<T, 1>;
 static_assert (no_slicing::check (), "");
 static_assert (no_slicing::check_ctor_from_container<std::vector> (), "");
 static_assert (no_slicing::check_ctor_from_container<StdArray1> (), "");
-static_assert (no_slicing::check_ctor_from_container<gdb::array_view> (), "");
+static_assert (no_slicing::check_ctor_from_container<gdb::span> (), "");
 
-/* Check that array_view implicitly converts from std::vector.  */
+/* Check that span implicitly converts from std::vector.  */
 
 static constexpr bool
 check_convertible_from_std_vector ()
 {
-  using gdb::array_view;
+  using gdb::span;
   using T = gdb_byte;
 
   /* Note there's no such thing as std::vector<const T>.  */
 
   return (true
-	  &&  is_convertible <std::vector<T>, array_view<T>> ()
-	  &&  is_convertible <std::vector<T>, array_view<const T>> ());
+	  &&  is_convertible <std::vector<T>, span<T>> ()
+	  &&  is_convertible <std::vector<T>, span<const T>> ());
 }
 
 static_assert (check_convertible_from_std_vector (), "");
 
-/* Check that array_view implicitly converts from std::array.  */
+/* Check that span implicitly converts from std::array.  */
 
 static constexpr bool
 check_convertible_from_std_array ()
 {
-  using gdb::array_view;
+  using gdb::span;
   using T = gdb_byte;
 
   /* Note: a non-const T view can't refer to a const T array.  */
 
   return (true
-	  &&  is_convertible <std::array<T, 1>,		array_view<T>> ()
-	  &&  is_convertible <std::array<T, 1>,		array_view<const T>> ()
-	  && !is_convertible <std::array<const T, 1>,	array_view<T>> ()
-	  &&  is_convertible <std::array<const T, 1>,	array_view<const T>> ());
+	  &&  is_convertible <std::array<T, 1>,		span<T>> ()
+	  &&  is_convertible <std::array<T, 1>,		span<const T>> ()
+	  && !is_convertible <std::array<const T, 1>,	span<T>> ()
+	  &&  is_convertible <std::array<const T, 1>,	span<const T>> ());
 }
 
 static_assert (check_convertible_from_std_array (), "");
@@ -250,7 +250,7 @@  check_ptr_size_ctor ()
 {
   T data[] = {0x11, 0x22, 0x33, 0x44};
 
-  gdb::array_view<T> view (data + 1, 2);
+  gdb::span<T> view (data + 1, 2);
 
   SELF_CHECK (!view.empty ());
   SELF_CHECK (view.size () == 2);
@@ -258,7 +258,7 @@  check_ptr_size_ctor ()
   SELF_CHECK (view[0] == data[1]);
   SELF_CHECK (view[1] == data[2]);
 
-  gdb::array_view<const T> cview (data + 1, 2);
+  gdb::span<const T> cview (data + 1, 2);
   SELF_CHECK (!cview.empty ());
   SELF_CHECK (cview.size () == 2);
   SELF_CHECK (cview.data () == &data[1]);
@@ -278,7 +278,7 @@  require_not_constructible ()
   return true;
 };
 
-/* Check the array_view<T>(PTR, SIZE) ctor, when T is a pointer.  */
+/* Check the span<T>(PTR, SIZE) ctor, when T is a pointer.  */
 
 static void
 check_ptr_size_ctor2 ()
@@ -289,12 +289,12 @@  check_ptr_size_ctor2 ()
   A *array[] = { &an_a };
   const A * const carray[] = { &an_a };
 
-  gdb::array_view<A *> v1 = {array, ARRAY_SIZE (array)};
-  gdb::array_view<A *> v2 = {array, (char) ARRAY_SIZE (array)};
-  gdb::array_view<A * const> v3 = {array, ARRAY_SIZE (array)};
-  gdb::array_view<const A * const> cv1 = {carray, ARRAY_SIZE (carray)};
+  gdb::span<A *> v1 = {array, ARRAY_SIZE (array)};
+  gdb::span<A *> v2 = {array, (char) ARRAY_SIZE (array)};
+  gdb::span<A * const> v3 = {array, ARRAY_SIZE (array)};
+  gdb::span<const A * const> cv1 = {carray, ARRAY_SIZE (carray)};
 
-  require_not_constructible<gdb::array_view<A *>, decltype (carray), size_t> ();
+  require_not_constructible<gdb::span<A *>, decltype (carray), size_t> ();
 
   SELF_CHECK (v1[0] == array[0]);
   SELF_CHECK (v2[0] == array[0]);
@@ -320,7 +320,7 @@  check_ptr_ptr_ctor ()
 {
   T data[] = {0x11, 0x22, 0x33, 0x44};
 
-  gdb::array_view<T> view (data + 1, data + 3);
+  gdb::span<T> view (data + 1, data + 3);
 
   SELF_CHECK (!view.empty ());
   SELF_CHECK (view.size () == 2);
@@ -331,7 +331,7 @@  check_ptr_ptr_ctor ()
   gdb_byte array[] = {0x11, 0x22, 0x33, 0x44};
   const gdb_byte *p1 = array;
   gdb_byte *p2 = array + ARRAY_SIZE (array);
-  gdb::array_view<const gdb_byte> view2 (p1, p2);
+  gdb::span<const gdb_byte> view2 (p1, p2);
 }
 
 /* Check construction with a pair of pointers of mixed constness.  */
@@ -342,8 +342,8 @@  check_ptr_ptr_mixed_cv ()
   gdb_byte array[] = {0x11, 0x22, 0x33, 0x44};
   const gdb_byte *cp = array;
   gdb_byte *p = array;
-  gdb::array_view<const gdb_byte> view1 (cp, p);
-  gdb::array_view<const gdb_byte> view2 (p, cp);
+  gdb::span<const gdb_byte> view1 (cp, p);
+  gdb::span<const gdb_byte> view2 (p, cp);
   SELF_CHECK (view1.empty ());
   SELF_CHECK (view2.empty ());
 }
@@ -356,7 +356,7 @@  static void
 check_range_for ()
 {
   T data[] = {1, 2, 3, 4};
-  gdb::array_view<T> view (data);
+  gdb::span<T> view (data);
 
   typename std::decay<T>::type sum = 0;
   for (auto &elem : view)
@@ -369,10 +369,10 @@  static void
 check_iterator ()
 {
   T data[] = {1, 2, 3, 4};
-  gdb::array_view<T> view (data);
+  gdb::span<T> view (data);
 
   typename std::decay<T>::type sum = 0;
-  for (typename gdb::array_view<T>::iterator it = view.begin ();
+  for (typename gdb::span<T>::iterator it = view.begin ();
        it != view.end (); it++)
     {
       *it *= 2;
@@ -387,10 +387,10 @@  static void
 check_const_iterator ()
 {
   T data[] = {1, 2, 3, 4};
-  gdb::array_view<T> view (data);
+  gdb::span<T> view (data);
 
   typename std::decay<T>::type sum = 0;
-  for (typename gdb::array_view<T>::const_iterator it = view.cbegin ();
+  for (typename gdb::span<T>::const_iterator it = view.cbegin ();
        it != view.cend (); it++)
     sum += *it;
 
@@ -404,8 +404,8 @@  run_tests ()
 {
   /* Empty views.  */
   {
-    constexpr gdb::array_view<gdb_byte> view1;
-    constexpr gdb::array_view<const gdb_byte> view2;
+    constexpr gdb::span<gdb_byte> view1;
+    constexpr gdb::span<const gdb_byte> view2;
 
     static_assert (view1.empty (), "");
     static_assert (view1.data () == nullptr, "");
@@ -420,23 +420,23 @@  run_tests ()
 
   /* Various tests of views over std::vector.  */
   {
-    gdb::array_view<gdb_byte> view = vec;
+    gdb::span<gdb_byte> view = vec;
     SELF_CHECK (check_container_view (view, vec));
-    gdb::array_view<const gdb_byte> cview = vec;
+    gdb::span<const gdb_byte> cview = vec;
     SELF_CHECK (check_container_view (cview, vec));
   }
 
   /* Likewise, over std::array.  */
   {
-    gdb::array_view<gdb_byte> view = array;
+    gdb::span<gdb_byte> view = array;
     SELF_CHECK (check_container_view (view, array));
-    gdb::array_view<gdb_byte> cview = array;
+    gdb::span<gdb_byte> cview = array;
     SELF_CHECK (check_container_view (cview, array));
   }
 
   /* op=(std::vector/std::array/elem) */
   {
-    gdb::array_view<gdb_byte> view;
+    gdb::span<gdb_byte> view;
 
     view = vec;
     SELF_CHECK (check_container_view (view, vec));
@@ -458,12 +458,12 @@  run_tests ()
   /* Test copy/move ctor and mutable->immutable conversion.  */
   {
     gdb_byte data[] = {0x11, 0x22, 0x33, 0x44};
-    gdb::array_view<gdb_byte> view1 = data;
-    gdb::array_view<gdb_byte> view2 = view1;
-    gdb::array_view<gdb_byte> view3 = std::move (view1);
-    gdb::array_view<const gdb_byte> cview1 = data;
-    gdb::array_view<const gdb_byte> cview2 = cview1;
-    gdb::array_view<const gdb_byte> cview3 = std::move (cview1);
+    gdb::span<gdb_byte> view1 = data;
+    gdb::span<gdb_byte> view2 = view1;
+    gdb::span<gdb_byte> view3 = std::move (view1);
+    gdb::span<const gdb_byte> cview1 = data;
+    gdb::span<const gdb_byte> cview2 = cview1;
+    gdb::span<const gdb_byte> cview3 = std::move (cview1);
     SELF_CHECK (view1[0] == data[0]);
     SELF_CHECK (view2[0] == data[0]);
     SELF_CHECK (view3[0] == data[0]);
@@ -475,12 +475,12 @@  run_tests ()
   /* Same, but op=(view).  */
   {
     gdb_byte data[] = {0x55, 0x66, 0x77, 0x88};
-    gdb::array_view<gdb_byte> view1;
-    gdb::array_view<gdb_byte> view2;
-    gdb::array_view<gdb_byte> view3;
-    gdb::array_view<const gdb_byte> cview1;
-    gdb::array_view<const gdb_byte> cview2;
-    gdb::array_view<const gdb_byte> cview3;
+    gdb::span<gdb_byte> view1;
+    gdb::span<gdb_byte> view2;
+    gdb::span<gdb_byte> view3;
+    gdb::span<const gdb_byte> cview1;
+    gdb::span<const gdb_byte> cview2;
+    gdb::span<const gdb_byte> cview3;
 
     view1 = data;
     view2 = view1;
@@ -499,8 +499,8 @@  run_tests ()
   /* op[] */
   {
     std::vector<gdb_byte> vec2 = {0x11, 0x22};
-    gdb::array_view<gdb_byte> view = vec2;
-    gdb::array_view<const gdb_byte> cview = vec2;
+    gdb::span<gdb_byte> view = vec2;
+    gdb::span<const gdb_byte> cview = vec2;
 
     /* Check that op[] on a non-const view of non-const T returns a
        mutable reference.  */
@@ -533,11 +533,11 @@  run_tests ()
     using Vec = std::vector<gdb_byte>;
     Vec vecs[3];
 
-    gdb::array_view<Vec> view_array = vecs;
+    gdb::span<Vec> view_array = vecs;
     SELF_CHECK (view_array.size () == 3);
 
     Vec elem;
-    gdb::array_view<Vec> view_elem = elem;
+    gdb::span<Vec> view_elem = elem;
     SELF_CHECK (view_elem.size () == 1);
   }
 
@@ -570,7 +570,7 @@  run_tests ()
   /* Test slicing.  */
   {
     gdb_byte data[] = {0x55, 0x66, 0x77, 0x88, 0x99};
-    gdb::array_view<gdb_byte> view = data;
+    gdb::span<gdb_byte> view = data;
 
     {
       auto slc = view.slice (1, 3);
@@ -600,14 +600,14 @@  run_copy_test ()
     std::vector<T> dest_v (4, -1);
 
     SELF_CHECK (dest_v != src_v);
-    copy (gdb::array_view<const T> (src_v), gdb::array_view<T> (dest_v));
+    copy (gdb::span<const T> (src_v), gdb::span<T> (dest_v));
     SELF_CHECK (dest_v == src_v);
   }
 
   /* Test overlapping copy, where the source is before the destination.  */
   {
     std::vector<T> vec = {1, 2, 3, 4, 5, 6, 7, 8};
-    gdb::array_view<T> v = vec;
+    gdb::span<T> v = vec;
 
     copy (v.slice (1, 4),
 	  v.slice (2, 4));
@@ -619,7 +619,7 @@  run_copy_test ()
   /* Test overlapping copy, where the source is after the destination.  */
   {
     std::vector<T> vec = {1, 2, 3, 4, 5, 6, 7, 8};
-    gdb::array_view<T> v = vec;
+    gdb::span<T> v = vec;
 
     copy (v.slice (2, 4),
 	  v.slice (1, 4));
@@ -631,7 +631,7 @@  run_copy_test ()
   /* Test overlapping copy, where the source is the same as the destination.  */
   {
     std::vector<T> vec = {1, 2, 3, 4, 5, 6, 7, 8};
-    gdb::array_view<T> v = vec;
+    gdb::span<T> v = vec;
 
     copy (v.slice (2, 4),
 	  v.slice (2, 4));
@@ -642,12 +642,12 @@  run_copy_test ()
 }
 
 /* Class with a non-trivial copy assignment operator, used to test the
-   array_view copy function.  */
+   span copy function.  */
 struct foo
 {
   /* Can be implicitly constructed from an int, such that we can use the same
-     templated test function to test against array_view<int> and
-     array_view<foo>.  */
+     templated test function to test against span<int> and
+     span<foo>.  */
   foo (int n)
     : n (n)
   {}
@@ -675,7 +675,7 @@  struct foo
 
 int foo::n_assign_op_called = 0;
 
-/* Test the array_view copy free function.  */
+/* Test the span copy free function.  */
 
 static void
 run_copy_tests ()
@@ -692,13 +692,13 @@  run_copy_tests ()
   SELF_CHECK (foo::n_assign_op_called == 12);
 }
 
-} /* namespace array_view_tests */
+} /* namespace span_tests */
 } /* namespace selftests */
 
 INIT_GDB_FILE (span_selftests)
 {
-  selftests::register_test ("array_view",
-			    selftests::array_view_tests::run_tests);
-  selftests::register_test ("array_view-copy",
-			    selftests::array_view_tests::run_copy_tests);
+  selftests::register_test ("span",
+			    selftests::span_tests::run_tests);
+  selftests::register_test ("span-copy",
+			    selftests::span_tests::run_copy_tests);
 }
diff --git a/gdb/utils.c b/gdb/utils.c
index 4d03ccd5c2d..3091ca29d60 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -3234,7 +3234,7 @@  gdb_argv_as_array_view_test ()
   {
     gdb_argv argv;
 
-    gdb::array_view<char *> view = argv.as_array_view ();
+    gdb::span<char *> view = argv.as_array_view ();
 
     SELF_CHECK (view.data () == nullptr);
     SELF_CHECK (view.size () == 0);
@@ -3242,7 +3242,7 @@  gdb_argv_as_array_view_test ()
   {
     gdb_argv argv ("une bonne 50");
 
-    gdb::array_view<char *> view = argv.as_array_view ();
+    gdb::span<char *> view = argv.as_array_view ();
 
     SELF_CHECK (view.size () == 3);
     SELF_CHECK (streq (view[0], "une"));
diff --git a/gdb/valarith.c b/gdb/valarith.c
index 62a35841f1f..20d5719fe13 100644
--- a/gdb/valarith.c
+++ b/gdb/valarith.c
@@ -336,7 +336,7 @@  unop_user_defined_p (enum exp_opcode op, struct value *arg1)
    situations or combinations thereof.  */
 
 static struct value *
-value_user_defined_cpp_op (gdb::array_view<value *> args, char *oper,
+value_user_defined_cpp_op (gdb::span<value *> args, char *oper,
 			   int *static_memfuncp, enum noside noside)
 {
 
@@ -367,7 +367,7 @@  value_user_defined_cpp_op (gdb::array_view<value *> args, char *oper,
    function, otherwise return NULL.  */
 
 static struct value *
-value_user_defined_op (struct value **argp, gdb::array_view<value *> args,
+value_user_defined_op (struct value **argp, gdb::span<value *> args,
 		       char *name, int *static_memfuncp, enum noside noside)
 {
   struct value *result = NULL;
@@ -411,7 +411,7 @@  value_x_binop (struct value *arg1, struct value *arg2, enum exp_opcode op,
     error (_("Can't do that binary op on that type"));	/* FIXME be explicit */
 
   value *argvec_storage[3];
-  gdb::array_view<value *> argvec = argvec_storage;
+  gdb::span<value *> argvec = argvec_storage;
 
   argvec[1] = value_addr (arg1);
   argvec[2] = arg2;
@@ -587,7 +587,7 @@  value_x_unop (struct value *arg1, enum exp_opcode op, enum noside noside)
     error (_("Can't do that unary op on that type"));	/* FIXME be explicit */
 
   value *argvec_storage[3];
-  gdb::array_view<value *> argvec = argvec_storage;
+  gdb::span<value *> argvec = argvec_storage;
 
   argvec[1] = value_addr (arg1);
   argvec[2] = 0;
@@ -732,9 +732,9 @@  value_concat (struct value *arg1, struct value *arg2)
 						lowbound + n_elts - 1);
 
   struct value *result = value::allocate (atype);
-  gdb::array_view<gdb_byte> contents = result->contents_raw ();
-  gdb::array_view<const gdb_byte> lhs_contents = arg1->contents ();
-  gdb::array_view<const gdb_byte> rhs_contents = arg2->contents ();
+  gdb::span<gdb_byte> contents = result->contents_raw ();
+  gdb::span<const gdb_byte> lhs_contents = arg1->contents ();
+  gdb::span<const gdb_byte> rhs_contents = arg2->contents ();
   gdb::copy (lhs_contents, contents.slice (0, lhs_contents.size ()));
   gdb::copy (rhs_contents, contents.slice (lhs_contents.size ()));
 
@@ -1415,7 +1415,7 @@  value_vector_widen (struct value *scalar_value, struct type *vector_type)
     error (_("conversion of scalar to vector involves truncation"));
 
   value *val = value::allocate (vector_type);
-  gdb::array_view<gdb_byte> val_contents = val->contents_writeable ();
+  gdb::span<gdb_byte> val_contents = val->contents_writeable ();
   int elt_len = eltype->length ();
 
   for (i = 0; i < high_bound - low_bound + 1; i++)
@@ -1462,7 +1462,7 @@  vector_binop (struct value *val1, struct value *val2, enum exp_opcode op)
     error (_("Cannot perform operation on vectors with different types"));
 
   value *val = value::allocate (type1);
-  gdb::array_view<gdb_byte> val_contents = val->contents_writeable ();
+  gdb::span<gdb_byte> val_contents = val->contents_writeable ();
   scoped_value_mark mark;
   for (i = 0; i < high_bound1 - low_bound1 + 1; i++)
     {
@@ -1757,7 +1757,7 @@  value_neg (struct value *arg1)
       if (!get_array_bounds (type, &low_bound, &high_bound))
 	error (_("Could not determine the vector bounds"));
 
-      gdb::array_view<gdb_byte> val_contents = val->contents_writeable ();
+      gdb::span<gdb_byte> val_contents = val->contents_writeable ();
       int elt_len = eltype->length ();
 
       for (i = 0; i < high_bound - low_bound + 1; i++)
@@ -1808,7 +1808,7 @@  value_complement (struct value *arg1)
 	error (_("Could not determine the vector bounds"));
 
       val = value::allocate (type);
-      gdb::array_view<gdb_byte> val_contents = val->contents_writeable ();
+      gdb::span<gdb_byte> val_contents = val->contents_writeable ();
       int elt_len = eltype->length ();
 
       for (i = 0; i < high_bound - low_bound + 1; i++)
diff --git a/gdb/valops.c b/gdb/valops.c
index f9d83ce81f8..65045993538 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -48,22 +48,22 @@  static struct value *search_struct_field (const char *, struct value *,
 					  struct type *, int);
 
 static struct value *search_struct_method (const char *, struct value **,
-					   std::optional<gdb::array_view<value *>>,
+					   std::optional<gdb::span<value *>>,
 					   LONGEST, int *, struct type *);
 
-static int find_oload_champ_namespace (gdb::array_view<value *> args,
+static int find_oload_champ_namespace (gdb::span<value *> args,
 				       const char *, const char *,
 				       std::vector<symbol *> *oload_syms,
 				       badness_vector *,
 				       const int no_adl);
 
-static int find_oload_champ_namespace_loop (gdb::array_view<value *> args,
+static int find_oload_champ_namespace_loop (gdb::span<value *> args,
 					    const char *, const char *,
 					    int, std::vector<symbol *> *oload_syms,
 					    badness_vector *, int *,
 					    const int no_adl);
 
-static int find_oload_champ (gdb::array_view<value *> args,
+static int find_oload_champ (gdb::span<value *> args,
 			     size_t num_fns,
 			     fn_field *methods,
 			     xmethod_worker_up *xmethods,
@@ -977,7 +977,7 @@  value_one (struct type *type)
 	error (_("Could not determine the vector bounds"));
 
       val = value::allocate (type);
-      gdb::array_view<gdb_byte> val_contents = val->contents_writeable ();
+      gdb::span<gdb_byte> val_contents = val->contents_writeable ();
       int elt_len = eltype->length ();
 
       for (i = 0; i < high_bound - low_bound + 1; i++)
@@ -1698,7 +1698,7 @@  value_ind (struct value *arg1)
    don't currently enforce any restriction on their types).  */
 
 struct value *
-value_array (int lowbound, gdb::array_view<struct value *> elemvec)
+value_array (int lowbound, gdb::span<struct value *> elemvec)
 {
   int idx;
   ULONGEST typelength;
@@ -1779,7 +1779,7 @@  value_string (const gdb_byte *ptr, ssize_t count, struct type *char_type)
 
 
 /* See if we can pass arguments in T2 to a function which takes arguments
-   of types T1.  T1 is an array_view of arguments, and T2 is an array_view
+   of types T1.  T1 is a span of arguments, and T2 is a span
    of the values we're trying to pass.  If some arguments need coercion of
    some sort, then the coerced values are written into T2.  Return value is
    0 if the arguments could be matched, or the position at which they
@@ -1797,7 +1797,7 @@  value_string (const gdb_byte *ptr, ssize_t count, struct type *char_type)
 
 static int
 typecmp (bool staticp, bool varargs,
-	 gdb::array_view<struct field> t1, gdb::array_view<value *> t2)
+	 gdb::span<struct field> t1, gdb::span<value *> t2)
 {
   int i;
 
@@ -2205,7 +2205,7 @@  search_struct_field (const char *name, struct value *arg1,
 
 static struct value *
 search_struct_method (const char *name, struct value **arg1p,
-		      std::optional<gdb::array_view<value *>> args,
+		      std::optional<gdb::span<value *>> args,
 		      LONGEST offset, int *static_memfuncp,
 		      struct type *type)
 {
@@ -2339,7 +2339,7 @@  search_struct_method (const char *name, struct value **arg1p,
 
 struct value *
 value_struct_elt (struct value **argp,
-		  std::optional<gdb::array_view<value *>> args,
+		  std::optional<gdb::span<value *>> args,
 		  const char *name, int *static_memfuncp, const char *err)
 {
   struct type *t;
@@ -2494,7 +2494,7 @@  value_struct_elt_bitpos (struct value *val, int bitpos, struct type *ftype)
 static void
 find_method_list (struct value **argp, const char *method,
 		  LONGEST offset, struct type *type,
-		  gdb::array_view<fn_field> *methods,
+		  gdb::span<fn_field> *methods,
 		  std::vector<xmethod_worker_up> *xmethods,
 		  struct type **basetype, LONGEST *boffset)
 {
@@ -2583,7 +2583,7 @@  find_method_list (struct value **argp, const char *method,
 static void
 value_find_oload_method_list (struct value **argp, const char *method,
 			      LONGEST offset,
-			      gdb::array_view<fn_field> *methods,
+			      gdb::span<fn_field> *methods,
 			      std::vector<xmethod_worker_up> *xmethods,
 			      struct type **basetype, LONGEST *boffset)
 {
@@ -2623,7 +2623,7 @@  value_find_oload_method_list (struct value **argp, const char *method,
 
    If no incomplete types are present, an empty string is returned.  */
 static std::string
-incomplete_type_hint (gdb::array_view<value *> args)
+incomplete_type_hint (gdb::span<value *> args)
 {
   int incomplete_types = 0;
   std::string incomplete_arg_names;
@@ -2706,7 +2706,7 @@  incomplete_type_hint (gdb::array_view<value *> args)
    resolution is permitted.  */
 
 int
-find_overload_match (gdb::array_view<value *> args,
+find_overload_match (gdb::span<value *> args,
 		     const char *name, enum oload_search_type method,
 		     struct value **objp, struct symbol *fsym,
 		     struct value **valp, struct symbol **symp,
@@ -2729,7 +2729,7 @@  find_overload_match (gdb::array_view<value *> args,
 
   struct value *temp = obj;
   /* For methods, the list of overloaded methods.  */
-  gdb::array_view<fn_field> methods;
+  gdb::span<fn_field> methods;
   /* For non-methods, the list of overloaded function symbols.  */
   std::vector<symbol *> functions;
   /* For xmethods, the vector of xmethod workers.  */
@@ -3058,7 +3058,7 @@  find_overload_match (gdb::array_view<value *> args,
    argument dependent lookup is not performed.  */
 
 static int
-find_oload_champ_namespace (gdb::array_view<value *> args,
+find_oload_champ_namespace (gdb::span<value *> args,
 			    const char *func_name,
 			    const char *qualified_name,
 			    std::vector<symbol *> *oload_syms,
@@ -3084,7 +3084,7 @@  find_oload_champ_namespace (gdb::array_view<value *> args,
    find_oload_champ_namespace.  */
 
 static int
-find_oload_champ_namespace_loop (gdb::array_view<value *> args,
+find_oload_champ_namespace_loop (gdb::span<value *> args,
 				 const char *func_name,
 				 const char *qualified_name,
 				 int namespace_len,
@@ -3200,7 +3200,7 @@  find_oload_champ_namespace_loop (gdb::array_view<value *> args,
    quality of the match in OLOAD_CHAMP_BV.  */
 
 static int
-find_oload_champ (gdb::array_view<value *> args,
+find_oload_champ (gdb::span<value *> args,
 		  size_t num_fns,
 		  fn_field *methods,
 		  xmethod_worker_up *xmethods,
diff --git a/gdb/value.c b/gdb/value.c
index 6241c0b3601..c9f21ae8c5b 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -1056,7 +1056,7 @@  value::allocate_optimized_out (struct type *type)
 
 /* Accessor methods.  */
 
-gdb::array_view<gdb_byte>
+gdb::span<gdb_byte>
 value::contents_raw ()
 {
   int unit_size = gdbarch_addressable_memory_unit_size (arch ());
@@ -1068,7 +1068,7 @@  value::contents_raw ()
     (m_contents.get () + m_embedded_offset * unit_size, length);
 }
 
-gdb::array_view<gdb_byte>
+gdb::span<gdb_byte>
 value::contents_all_raw ()
 {
   allocate_contents (true);
@@ -1151,7 +1151,7 @@  value::require_available () const
     error_value_not_available ();
 }
 
-gdb::array_view<const gdb_byte>
+gdb::span<const gdb_byte>
 value::contents_for_printing ()
 {
   if (m_lazy)
@@ -1161,7 +1161,7 @@  value::contents_for_printing ()
   return gdb::make_array_view (m_contents.get (), length);
 }
 
-gdb::array_view<const gdb_byte>
+gdb::span<const gdb_byte>
 value::contents_for_printing () const
 {
   gdb_assert (!m_lazy);
@@ -1170,10 +1170,10 @@  value::contents_for_printing () const
   return gdb::make_array_view (m_contents.get (), length);
 }
 
-gdb::array_view<const gdb_byte>
+gdb::span<const gdb_byte>
 value::contents_all ()
 {
-  gdb::array_view<const gdb_byte> result = contents_for_printing ();
+  gdb::span<const gdb_byte> result = contents_for_printing ();
   require_not_optimized_out ();
   require_available ();
   return result;
@@ -1247,10 +1247,10 @@  value::contents_copy_raw (struct value *dst, LONGEST dst_offset,
     error (_("access outside bounds of object"));
 
   /* Copy the data.  */
-  gdb::array_view<gdb_byte> dst_contents
+  gdb::span<gdb_byte> dst_contents
     = dst->contents_all_raw ().slice (dst_offset * unit_size,
 				      copy_length * unit_size);
-  gdb::array_view<const gdb_byte> src_contents
+  gdb::span<const gdb_byte> src_contents
     = contents_all_raw ().slice (src_offset * unit_size,
 				 copy_length * unit_size);
   gdb::copy (src_contents, dst_contents);
@@ -1293,8 +1293,8 @@  value::contents_copy_raw_bitwise (struct value *dst, LONGEST dst_bit_offset,
 					    bit_length));
 
   /* Copy the data.  */
-  gdb::array_view<gdb_byte> dst_contents = dst->contents_all_raw ();
-  gdb::array_view<const gdb_byte> src_contents = contents_all_raw ();
+  gdb::span<gdb_byte> dst_contents = dst->contents_all_raw ();
+  gdb::span<const gdb_byte> src_contents = contents_all_raw ();
   copy_bitwise (dst_contents.data (), dst_bit_offset,
 		src_contents.data (), src_bit_offset,
 		copy_bit_length,
@@ -1316,16 +1316,16 @@  value::contents_copy (struct value *dst, LONGEST dst_offset,
   contents_copy_raw (dst, dst_offset, src_offset, length);
 }
 
-gdb::array_view<const gdb_byte>
+gdb::span<const gdb_byte>
 value::contents ()
 {
-  gdb::array_view<const gdb_byte> result = contents_writeable ();
+  gdb::span<const gdb_byte> result = contents_writeable ();
   require_not_optimized_out ();
   require_available ();
   return result;
 }
 
-gdb::array_view<gdb_byte>
+gdb::span<gdb_byte>
 value::contents_writeable ()
 {
   if (m_lazy)
@@ -1576,7 +1576,7 @@  value::copy () const
 	= gdb::make_array_view (m_contents.get (), length);
 
       val->allocate_contents (false);
-      gdb::array_view<gdb_byte> val_contents
+      gdb::span<gdb_byte> val_contents
 	= val->contents_all_raw ().slice (0, length);
 
       gdb::copy (arg_view, val_contents);
@@ -2622,7 +2622,7 @@  value::from_xmethod (xmethod_worker_up &&worker)
 /* See value.h.  */
 
 struct type *
-value::result_type_of_xmethod (gdb::array_view<value *> argv)
+value::result_type_of_xmethod (gdb::span<value *> argv)
 {
   gdb_assert (type ()->code () == TYPE_CODE_XMETHOD
 	      && m_lval == lval_xcallable && !argv.empty ());
@@ -2633,7 +2633,7 @@  value::result_type_of_xmethod (gdb::array_view<value *> argv)
 /* See value.h.  */
 
 struct value *
-value::call_xmethod (gdb::array_view<value *> argv)
+value::call_xmethod (gdb::span<value *> argv)
 {
   gdb_assert (type ()->code () == TYPE_CODE_XMETHOD
 	      && m_lval == lval_xcallable && !argv.empty ());
@@ -2679,7 +2679,7 @@  value_as_mpz (struct value *val)
 
   gdb_mpz result;
 
-  gdb::array_view<const gdb_byte> valbytes = val->contents ();
+  gdb::span<const gdb_byte> valbytes = val->contents ();
   enum bfd_endian byte_order = type_byte_order (type);
 
   /* Handle integers that are either not a multiple of the word size,
@@ -3652,7 +3652,7 @@  value_from_contents_and_address (struct type *type,
 				 CORE_ADDR address,
 				 const frame_info_ptr &frame)
 {
-  gdb::array_view<const gdb_byte> view;
+  gdb::span<const gdb_byte> view;
   if (valaddr != nullptr)
     view = gdb::make_array_view (valaddr, type->length ());
   struct type *resolved_type = resolve_dynamic_type (type, view, address,
@@ -3840,7 +3840,7 @@  readjust_indirect_value_type (struct value *value, struct type *enc_type,
   gdb_assert (original_type->is_pointer_or_reference ());
 
   struct type *original_target_type = original_type->target_type ();
-  gdb::array_view<const gdb_byte> view;
+  gdb::span<const gdb_byte> view;
   struct type *resolved_original_target_type
     = resolve_dynamic_type (original_target_type, view,
 			    original_value_address);
@@ -4085,7 +4085,7 @@  value::fetch_lazy_register ()
 	  if (new_val->entirely_available ())
 	    {
 	      int i;
-	      gdb::array_view<const gdb_byte> buf = new_val->contents ();
+	      gdb::span<const gdb_byte> buf = new_val->contents ();
 
 	      gdb_printf (&debug_file, " bytes=");
 	      gdb_printf (&debug_file, "[");
@@ -4154,7 +4154,7 @@  pseudo_from_raw_part (const frame_info_ptr &next_frame, int pseudo_reg_num,
 
 void
 pseudo_to_raw_part (const frame_info_ptr &next_frame,
-		    gdb::array_view<const gdb_byte> pseudo_buf,
+		    gdb::span<const gdb_byte> pseudo_buf,
 		    int raw_reg_num, int raw_offset)
 {
   int raw_reg_size
@@ -4196,7 +4196,7 @@  pseudo_from_concat_raw (const frame_info_ptr &next_frame, int pseudo_reg_num,
 
 void
 pseudo_to_concat_raw (const frame_info_ptr &next_frame,
-		      gdb::array_view<const gdb_byte> pseudo_buf,
+		      gdb::span<const gdb_byte> pseudo_buf,
 		      int raw_reg_1_num, int raw_reg_2_num)
 {
   int src_offset = 0;
@@ -4250,7 +4250,7 @@  pseudo_from_concat_raw (const frame_info_ptr &next_frame, int pseudo_reg_num,
 
 void
 pseudo_to_concat_raw (const frame_info_ptr &next_frame,
-		      gdb::array_view<const gdb_byte> pseudo_buf,
+		      gdb::span<const gdb_byte> pseudo_buf,
 		      int raw_reg_1_num, int raw_reg_2_num, int raw_reg_3_num)
 {
   int src_offset = 0;
@@ -4384,8 +4384,8 @@  test_ranges_contain ()
 /* Check that RANGES contains the same ranges as EXPECTED.  */
 
 static bool
-check_ranges_vector (gdb::array_view<const range> ranges,
-		     gdb::array_view<const range> expected)
+check_ranges_vector (gdb::span<const range> ranges,
+		     gdb::span<const range> expected)
 {
   return ranges == expected;
 }
diff --git a/gdb/value.h b/gdb/value.h
index 598d252abac..bc9146a2c21 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -414,31 +414,31 @@  struct value
      Note: The contents pointer is adjusted by the offset required to
      get to the real subobject, if the value happens to represent
      something embedded in a larger run-time object.  */
-  gdb::array_view<gdb_byte> contents_raw ();
+  gdb::span<gdb_byte> contents_raw ();
 
   /* Actual contents of the value.  For use of this value; setting it
      uses the stuff above.  Not valid if lazy is nonzero.  Target
      byte-order.  We force it to be aligned properly for any possible
      value.  Note that a value therefore extends beyond what is
      declared here.  */
-  gdb::array_view<const gdb_byte> contents ();
+  gdb::span<const gdb_byte> contents ();
 
   /* The ALL variants of the above two methods do not adjust the
      returned pointer by the embedded_offset value.  */
-  gdb::array_view<const gdb_byte> contents_all ();
-  gdb::array_view<gdb_byte> contents_all_raw ();
+  gdb::span<const gdb_byte> contents_all ();
+  gdb::span<gdb_byte> contents_all_raw ();
 
-  gdb::array_view<gdb_byte> contents_writeable ();
+  gdb::span<gdb_byte> contents_writeable ();
 
   /* Like contents_all, but does not require that the returned bits be
      valid.  This should only be used in situations where you plan to
      check the validity manually.  */
-  gdb::array_view<const gdb_byte> contents_for_printing ();
+  gdb::span<const gdb_byte> contents_for_printing ();
 
   /* Like contents_for_printing, but accepts a constant value pointer.
      Unlike contents_for_printing however, the pointed value must
      _not_ be lazy.  */
-  gdb::array_view<const gdb_byte> contents_for_printing () const;
+  gdb::span<const gdb_byte> contents_for_printing () const;
 
   /* Load the actual content of a lazy value.  Fetch the data from the
      user's process and clear the lazy flag to indicate that the data in
@@ -592,11 +592,11 @@  struct value
   static struct value *from_xmethod (xmethod_worker_up &&worker);
 
   /* Return the type of the result of TYPE_CODE_XMETHOD value METHOD.  */
-  struct type *result_type_of_xmethod (gdb::array_view<value *> argv);
+  struct type *result_type_of_xmethod (gdb::span<value *> argv);
 
   /* Call the xmethod corresponding to the TYPE_CODE_XMETHOD value
      METHOD.  */
-  struct value *call_xmethod (gdb::array_view<value *> argv);
+  struct value *call_xmethod (gdb::span<value *> argv);
 
   /* Update this value before discarding OBJFILE.  COPIED_TYPES is
      used to prevent cycles / duplicates.  */
@@ -1284,7 +1284,7 @@  inline struct value *value_string (const char *ptr, ssize_t count,
 }
 
 extern struct value *value_array (int lowbound,
-				  gdb::array_view<struct value *> elemvec);
+				  gdb::span<struct value *> elemvec);
 
 extern struct value *value_concat (struct value *arg1, struct value *arg2);
 
@@ -1327,7 +1327,7 @@  extern struct value *value_neg (struct value *arg1);
 extern struct value *value_complement (struct value *arg1);
 
 extern struct value *value_struct_elt (struct value **argp,
-				       std::optional<gdb::array_view <value *>> args,
+				       std::optional<gdb::span <value *>> args,
 				       const char *name, int *static_memfuncp,
 				       const char *err);
 
@@ -1345,7 +1345,7 @@  extern struct value *value_static_field (struct type *type, int fieldno);
 
 enum oload_search_type { NON_METHOD, METHOD, BOTH };
 
-extern int find_overload_match (gdb::array_view<value *> args,
+extern int find_overload_match (gdb::span<value *> args,
 				const char *name,
 				enum oload_search_type method,
 				struct value **objp, struct symbol *fsym,
@@ -1758,7 +1758,7 @@  value *pseudo_from_raw_part (const frame_info_ptr &next_frame, int pseudo_reg_nu
    RAW_REG_NUM starting at RAW_OFFSET.  */
 
 void pseudo_to_raw_part (const frame_info_ptr &next_frame,
-			 gdb::array_view<const gdb_byte> pseudo_buf,
+			 gdb::span<const gdb_byte> pseudo_buf,
 			 int raw_reg_num, int raw_offset);
 
 /* Create a value for pseudo register PSEUDO_REG_NUM by concatenating raw
@@ -1774,7 +1774,7 @@  value *pseudo_from_concat_raw (const frame_info_ptr &next_frame, int pseudo_reg_
    RAW_REG_1_NUM and RAW_REG_2_NUM.  */
 
 void pseudo_to_concat_raw (const frame_info_ptr &next_frame,
-			   gdb::array_view<const gdb_byte> pseudo_buf,
+			   gdb::span<const gdb_byte> pseudo_buf,
 			   int raw_reg_1_num, int raw_reg_2_num);
 
 /* Same as the above, but with three raw registers.  */
@@ -1787,7 +1787,7 @@  value *pseudo_from_concat_raw (const frame_info_ptr &next_frame, int pseudo_reg_
    registers RAW_REG_1_NUM, RAW_REG_2_NUM and RAW_REG_3_NUM.  */
 
 void pseudo_to_concat_raw (const frame_info_ptr &next_frame,
-			   gdb::array_view<const gdb_byte> pseudo_buf,
+			   gdb::span<const gdb_byte> pseudo_buf,
 			   int raw_reg_1_num, int raw_reg_2_num,
 			   int raw_reg_3_num);
 
diff --git a/gdb/windows-tdep.c b/gdb/windows-tdep.c
index e9bf4398d83..86e7ea6dd59 100644
--- a/gdb/windows-tdep.c
+++ b/gdb/windows-tdep.c
@@ -1284,7 +1284,7 @@  struct cygwin_sigwrapper_frame_cache
 
 static bool
 insns_match_pattern (CORE_ADDR pc,
-		     const gdb::array_view<const gdb_byte> pattern)
+		     const gdb::span<const gdb_byte> pattern)
 {
   for (size_t i = 0; i < pattern.size (); i++)
     {
@@ -1306,7 +1306,7 @@  static void
 cygwin_sigwrapper_frame_analyze
   (struct gdbarch *gdbarch,
    CORE_ADDR start, CORE_ADDR end,
-   gdb::array_view<const gdb::array_view<const gdb_byte>> patterns_list,
+   gdb::span<const gdb::span<const gdb_byte>> patterns_list,
    int *tlsoffset)
 {
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
@@ -1449,7 +1449,7 @@  cygwin_sigwrapper_frame_unwind::sniff (const frame_info_ptr &this_frame,
 /* Cygwin sigwapper unwinder.  */
 
 cygwin_sigwrapper_frame_unwind::cygwin_sigwrapper_frame_unwind
-  (gdb::array_view<const gdb::array_view<const gdb_byte>> patterns_list)
+  (gdb::span<const gdb::span<const gdb_byte>> patterns_list)
     : frame_unwind ("cygwin sigwrapper", NORMAL_FRAME, FRAME_UNWIND_GDB,
 		    nullptr), patterns_list (patterns_list)
 {
diff --git a/gdb/windows-tdep.h b/gdb/windows-tdep.h
index 7cbc6ea9334..6f71ce5ce4d 100644
--- a/gdb/windows-tdep.h
+++ b/gdb/windows-tdep.h
@@ -66,7 +66,7 @@  class cygwin_sigwrapper_frame_unwind : public frame_unwind
 {
 public:
   explicit cygwin_sigwrapper_frame_unwind
-    (gdb::array_view<const gdb::array_view<const gdb_byte>> patterns_list);
+    (gdb::span<const gdb::span<const gdb_byte>> patterns_list);
 
   /* Architecture-specific list of instruction patterns to match.
      It's a list of patterns instead of single pattern because some
@@ -75,7 +75,7 @@  class cygwin_sigwrapper_frame_unwind : public frame_unwind
      sequence is assumed to be followed by 4 bytes for tls::stackptr.
      If any pattern in the list matches, then the frame is assumed to
      be a sigwrapper frame.  */
-  gdb::array_view<const gdb::array_view<const gdb_byte>> patterns_list;
+  gdb::span<const gdb::span<const gdb_byte>> patterns_list;
 
   /* Calculate the frame ID of a cygwin wrapper.  */
   void this_id (const frame_info_ptr &this_frame, void **this_prologue_cache,
diff --git a/gdb/x86-linux-nat.c b/gdb/x86-linux-nat.c
index 9c49b3bed47..e64069ef70d 100644
--- a/gdb/x86-linux-nat.c
+++ b/gdb/x86-linux-nat.c
@@ -259,7 +259,7 @@  x86_linux_store_ssp (const regcache *regcache, const int tid)
 
 static void
 i386_supply_tls_regs (regcache *regcache, int regnum,
-		      gdb::array_view<user_desc> buffer)
+		      gdb::span<user_desc> buffer)
 {
   gdb_assert (buffer.size () == 3);
 
@@ -276,7 +276,7 @@  i386_supply_tls_regs (regcache *regcache, int regnum,
 
 static void
 i386_collect_tls_regs (regcache *regcache, int regnum,
-			gdb::array_view<user_desc> buffer)
+			gdb::span<user_desc> buffer)
 {
   gdb_assert (buffer.size () == 3);
 
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
index 08d5d810c6f..f92f4f703aa 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -249,7 +249,7 @@  read_xcoff_minimal_symbols (objfile *objfile)
 {
   bfd *abfd = objfile->obfd.get ();
 
-  gdb::array_view<asymbol *> symbol_table
+  gdb::span<asymbol *> symbol_table
     = gdb_bfd_canonicalize_symtab (abfd, false);
   /* Get the number of symbols we need.  */
   int number_of_symbols = symbol_table.size ();
diff --git a/gdbserver/linux-x86-low.cc b/gdbserver/linux-x86-low.cc
index f893821fa48..e867f98036e 100644
--- a/gdbserver/linux-x86-low.cc
+++ b/gdbserver/linux-x86-low.cc
@@ -114,7 +114,7 @@  public:
 
   bool supports_z_point_type (char z_type) override;
 
-  void process_qsupported (gdb::array_view<const char * const> features) override;
+  void process_qsupported (gdb::span<const char * const> features) override;
 
   bool supports_tracepoints () override;
 
@@ -1068,7 +1068,7 @@  x86_target::update_xmltarget ()
    PTRACE_GETREGSET.  */
 
 void
-x86_target::process_qsupported (gdb::array_view<const char * const> features)
+x86_target::process_qsupported (gdb::span<const char * const> features)
 {
   /* Return if gdb doesn't support XML.  If gdb sends "xmlRegisters="
      with "i386" in qSupported query, it supports x86 XML target
diff --git a/gdbserver/regcache.cc b/gdbserver/regcache.cc
index 7e1fd9a82e0..0879fa4559a 100644
--- a/gdbserver/regcache.cc
+++ b/gdbserver/regcache.cc
@@ -278,7 +278,7 @@  regcache::register_size (int regnum) const
   return ::register_size (tdesc, regnum);
 }
 
-static gdb::array_view<gdb_byte>
+static gdb::span<gdb_byte>
 register_data (const struct regcache *regcache, int n)
 {
   const gdb::reg &reg = find_register_by_number (regcache->tdesc, n);
@@ -297,7 +297,7 @@  supply_register (struct regcache *regcache, int n, const void *vbuf)
 /* See gdbsupport/common-regcache.h.  */
 
 void
-regcache::raw_supply (int n, gdb::array_view<const gdb_byte> src)
+regcache::raw_supply (int n, gdb::span<const gdb_byte> src)
 {
   auto dst = register_data (this, n);
 
@@ -390,7 +390,7 @@  collect_register (struct regcache *regcache, int n, void *vbuf)
 /* See gdbsupport/common-regcache.h.  */
 
 void
-regcache::raw_collect (int n, gdb::array_view<gdb_byte> dst) const
+regcache::raw_collect (int n, gdb::span<gdb_byte> dst) const
 {
   auto src = register_data (this, n);
   copy (src, dst);
@@ -501,7 +501,7 @@  regcache::raw_compare (int regnum, const void *buf, int offset) const
 {
   gdb_assert (buf != NULL);
 
-  gdb::array_view<const gdb_byte> regbuf = register_data (this, regnum);
+  gdb::span<const gdb_byte> regbuf = register_data (this, regnum);
   gdb_assert (offset <= regbuf.size ());
   regbuf = regbuf.slice (offset);
 
diff --git a/gdbserver/regcache.h b/gdbserver/regcache.h
index 2f0fac6e7d0..094f6d1afdf 100644
--- a/gdbserver/regcache.h
+++ b/gdbserver/regcache.h
@@ -75,13 +75,13 @@  struct regcache : public reg_buffer_common
   int register_size (int regnum) const override;
 
   /* See gdbsupport/common-regcache.h.  */
-  void raw_supply (int regnum, gdb::array_view<const gdb_byte> src) override;
+  void raw_supply (int regnum, gdb::span<const gdb_byte> src) override;
 
   /* See gdbsupport/common-regcache.h.  */
   void raw_supply_part_zeroed (int regnum, int offset, size_t size) override;
 
   /* See gdbsupport/common-regcache.h.  */
-  void raw_collect (int regnum, gdb::array_view<gdb_byte> dst) const override;
+  void raw_collect (int regnum, gdb::span<gdb_byte> dst) const override;
 
   /* See gdbsupport/common-regcache.h.  */
   bool raw_compare (int regnum, const void *buf, int offset) const override;
diff --git a/gdbserver/server.cc b/gdbserver/server.cc
index 74774fcde7c..7bd725f81ed 100644
--- a/gdbserver/server.cc
+++ b/gdbserver/server.cc
@@ -4573,7 +4573,7 @@  captured_main (int argc, char *argv[])
 	error (_("No program to debug"));
 
       int n = argc - (next_arg - argv);
-      gdb::array_view<char * const> args_view (&next_arg[1], &next_arg[n]);
+      gdb::span<char * const> args_view (&next_arg[1], &next_arg[n]);
       program_args = construct_inferior_arguments (args_view, escape_args);
 
       /* Wait till we are at first instruction in program.  */
diff --git a/gdbserver/target.cc b/gdbserver/target.cc
index 43ef421df74..7fea01e4540 100644
--- a/gdbserver/target.cc
+++ b/gdbserver/target.cc
@@ -578,7 +578,7 @@  process_stratum_target::read_loadmap (const char *annex,
 
 void
 process_stratum_target::process_qsupported
-  (gdb::array_view<const char * const> features)
+  (gdb::span<const char * const> features)
 {
   /* Nop.  */
 }
diff --git a/gdbserver/target.h b/gdbserver/target.h
index 2fe5896a9ff..b6fdfb674c6 100644
--- a/gdbserver/target.h
+++ b/gdbserver/target.h
@@ -303,7 +303,7 @@  class process_stratum_target
   /* Target specific qSupported support.  FEATURES is an array of
      features unsupported by the core of GDBserver.  */
   virtual void process_qsupported
-    (gdb::array_view<const char * const> features);
+    (gdb::span<const char * const> features);
 
   /* Return true if the target supports tracepoints, false otherwise.  */
   virtual bool supports_tracepoints ();
diff --git a/gdbsupport/buildargv.h b/gdbsupport/buildargv.h
index 788c1e38730..d49f5aa8273 100644
--- a/gdbsupport/buildargv.h
+++ b/gdbsupport/buildargv.h
@@ -126,14 +126,14 @@  class gdb_argv
 
   /* Return the arguments array as an array view.  */
 
-  gdb::array_view<char *> as_array_view ()
+  gdb::span<char *> as_array_view ()
   {
-    return gdb::array_view<char *> (this->get (), this->count ());
+    return gdb::span<char *> (this->get (), this->count ());
   }
 
-  gdb::array_view<const char * const> as_array_view () const
+  gdb::span<const char * const> as_array_view () const
   {
-    return gdb::array_view<const char * const> (this->get (), this->count ());
+    return gdb::span<const char * const> (this->get (), this->count ());
   }
 
   /* Append arguments to this array.  */
diff --git a/gdbsupport/common-inferior.cc b/gdbsupport/common-inferior.cc
index e8783e55bc8..5aebbc2160b 100644
--- a/gdbsupport/common-inferior.cc
+++ b/gdbsupport/common-inferior.cc
@@ -156,7 +156,7 @@  to_char_ptr (const std::string &arg)
 
 template<typename T>
 std::string
-construct_inferior_arguments (gdb::array_view<T const> argv,
+construct_inferior_arguments (gdb::span<T const> argv,
 			      bool escape_shell_char)
 {
   /* Select the desired escape function.  */
@@ -182,19 +182,19 @@  construct_inferior_arguments (gdb::array_view<T const> argv,
 template
 std::string
 construct_inferior_arguments
-  (gdb::array_view<gdb::unique_xmalloc_ptr<char> const> argv,
+  (gdb::span<gdb::unique_xmalloc_ptr<char> const> argv,
    bool escape_shell_char);
 
 /* Instantiate for T = 'char *'.  */
 
 template
 std::string
-construct_inferior_arguments (gdb::array_view<char * const> argv,
+construct_inferior_arguments (gdb::span<char * const> argv,
 			      bool escape_shell_char);
 
 /* Instantiate for T = 'std::string'.  */
 
 template
 std::string
-construct_inferior_arguments (gdb::array_view<std::string const> argv,
+construct_inferior_arguments (gdb::span<std::string const> argv,
 			      bool escape_shell_char);
diff --git a/gdbsupport/common-inferior.h b/gdbsupport/common-inferior.h
index 53d78b7bc23..87a6971cabe 100644
--- a/gdbsupport/common-inferior.h
+++ b/gdbsupport/common-inferior.h
@@ -64,6 +64,6 @@  extern bool startup_with_shell;
 template<typename T>
 extern std::string
 construct_inferior_arguments
-	(gdb::array_view<T const> argv, bool escape_shell_char);
+	(gdb::span<T const> argv, bool escape_shell_char);
 
 #endif /* GDBSUPPORT_COMMON_INFERIOR_H */
diff --git a/gdbsupport/common-regcache.h b/gdbsupport/common-regcache.h
index d944bd5254d..c9ca493689e 100644
--- a/gdbsupport/common-regcache.h
+++ b/gdbsupport/common-regcache.h
@@ -78,7 +78,7 @@  struct reg_buffer_common
 
   /* Supply register REGNUM, whose contents are stored in SRC, to this register
      buffer.  */
-  virtual void raw_supply (int regnum, gdb::array_view<const gdb_byte> src)
+  virtual void raw_supply (int regnum, gdb::span<const gdb_byte> src)
     = 0;
 
   void raw_supply (int regnum, const uint64_t *src)
@@ -98,7 +98,7 @@  struct reg_buffer_common
 
   /* Collect register REGNUM from this register buffer and store its contents in
      DST.  */
-  virtual void raw_collect (int regnum, gdb::array_view<gdb_byte> dst) const
+  virtual void raw_collect (int regnum, gdb::span<gdb_byte> dst) const
     = 0;
 
   void raw_collect (int regnum, uint64_t *dst) const
diff --git a/gdbsupport/common-utils.cc b/gdbsupport/common-utils.cc
index f31699be13a..8d6606dd3f5 100644
--- a/gdbsupport/common-utils.cc
+++ b/gdbsupport/common-utils.cc
@@ -484,7 +484,7 @@  hex2bin (const char *hex)
 /* See gdbsupport/common-utils.h.  */
 
 std::string
-bytes_to_string (gdb::array_view<const gdb_byte> bytes)
+bytes_to_string (gdb::span<const gdb_byte> bytes)
 {
   std::string ret;
 
diff --git a/gdbsupport/common-utils.h b/gdbsupport/common-utils.h
index c6077fd3196..61f9b04495e 100644
--- a/gdbsupport/common-utils.h
+++ b/gdbsupport/common-utils.h
@@ -236,7 +236,7 @@  gdb::byte_vector hex2bin (const char *hex);
    represented as a 2 character hex string, with spaces separating each
    individual byte.  */
 
-extern std::string bytes_to_string (gdb::array_view<const gdb_byte> bytes);
+extern std::string bytes_to_string (gdb::span<const gdb_byte> bytes);
 
 /* See bytes_to_string above.  This takes a BUFFER pointer and LENGTH
    rather than an array view.  */
diff --git a/gdbsupport/pathstuff.cc b/gdbsupport/pathstuff.cc
index d301c6fe5c2..fe0152b52bc 100644
--- a/gdbsupport/pathstuff.cc
+++ b/gdbsupport/pathstuff.cc
@@ -193,7 +193,7 @@  child_path (const char *parent, const char *child)
 /* See gdbsupport/pathstuff.h.  */
 
 std::string
-path_join (gdb::array_view<const char *> paths)
+path_join (gdb::span<const char *> paths)
 {
   std::string ret;
 
diff --git a/gdbsupport/pathstuff.h b/gdbsupport/pathstuff.h
index 0d8f7b8a1f9..12049733232 100644
--- a/gdbsupport/pathstuff.h
+++ b/gdbsupport/pathstuff.h
@@ -93,7 +93,7 @@  extern const char *child_path (const char *parent, const char *child);
    with a directory separator, or an element starts with a directory
    separator, then these will be collapsed into a single separator.  */
 
-extern std::string path_join (gdb::array_view<const char *> paths);
+extern std::string path_join (gdb::span<const char *> paths);
 
 /* Same as the above, but accept paths as distinct parameters.  */
 
@@ -107,7 +107,7 @@  path_join (Args... paths)
   std::array<const char *, sizeof... (Args)> path_array
     { paths... };
 
-  return path_join (gdb::array_view<const char *> (path_array));
+  return path_join (gdb::span<const char *> (path_array));
 }
 
 /* Return whether PATH contains a directory separator character.  */
diff --git a/gdbsupport/remote-args.h b/gdbsupport/remote-args.h
index b39eb20eeb7..c700471619d 100644
--- a/gdbsupport/remote-args.h
+++ b/gdbsupport/remote-args.h
@@ -62,7 +62,7 @@  template<typename T>
 inline std::string
 join (const std::vector<T> &args)
 {
-  return construct_inferior_arguments (gdb::array_view<const T> (args), false);
+  return construct_inferior_arguments (gdb::span<const T> (args), false);
 }
 
 } /* namespace remote_args */
diff --git a/gdbsupport/rsp-low.cc b/gdbsupport/rsp-low.cc
index 9ad8d98d484..5635d3456bc 100644
--- a/gdbsupport/rsp-low.cc
+++ b/gdbsupport/rsp-low.cc
@@ -143,7 +143,7 @@  bin2hex (const gdb_byte *bin, char *hex, int count)
 /* See rsp-low.h.  */
 
 int
-bin2hex (gdb::array_view<gdb_byte> bin, char *hex)
+bin2hex (gdb::span<gdb_byte> bin, char *hex)
 {
   return bin2hex (bin.data (), hex, bin.size ());
 }
diff --git a/gdbsupport/rsp-low.h b/gdbsupport/rsp-low.h
index 1a68cb4567f..6f4faecbc6b 100644
--- a/gdbsupport/rsp-low.h
+++ b/gdbsupport/rsp-low.h
@@ -54,7 +54,7 @@  extern std::string hex2str (const char *hex, int count);
 
 extern int bin2hex (const gdb_byte *bin, char *hex, int count);
 
-extern int bin2hex (gdb::array_view<gdb_byte> bin, char *hex);
+extern int bin2hex (gdb::span<gdb_byte> bin, char *hex);
 
 /* Overloaded version of bin2hex that returns a std::string.  */
 
diff --git a/gdbsupport/selftest.cc b/gdbsupport/selftest.cc
index 611bb990a0e..d4120f5c4c6 100644
--- a/gdbsupport/selftest.cc
+++ b/gdbsupport/selftest.cc
@@ -69,7 +69,7 @@  run_verbose ()
 /* See selftest.h.  */
 
 void
-run_tests (gdb::array_view<const char *const> filters, bool verbose)
+run_tests (gdb::span<const char *const> filters, bool verbose)
 {
   int ran = 0;
   run_verbose_ = verbose;
diff --git a/gdbsupport/selftest.h b/gdbsupport/selftest.h
index d8a1e106594..7b537184d0d 100644
--- a/gdbsupport/selftest.h
+++ b/gdbsupport/selftest.h
@@ -78,7 +78,7 @@  extern void add_lazy_generator (selftests_generator generator);
    If FILTERS is not empty, only run tests with names containing one of the
    element of FILTERS.  */
 
-extern void run_tests (gdb::array_view<const char *const> filters,
+extern void run_tests (gdb::span<const char *const> filters,
 		       bool verbose = false);
 
 /* Reset GDB or GDBserver's internal state.  */
diff --git a/gdbsupport/span.h b/gdbsupport/span.h
index 9708020b06a..41f4f0625ee 100644
--- a/gdbsupport/span.h
+++ b/gdbsupport/span.h
@@ -23,14 +23,14 @@ 
 #include <type_traits>
 #include "gdbsupport/gdb_assert.h"
 
-/* An array_view is an abstraction that provides a non-owning view
+/* An span is an abstraction that provides a non-owning view
    over a sequence of contiguous objects.
 
-   A way to put it is that array_view is to std::vector (and
+   A way to put it is that span is to std::vector (and
    std::array and built-in arrays with rank==1) like std::string_view
    is to std::string.
 
-   The main intent of array_view is to use it as function input
+   The main intent of span is to use it as function input
    parameter type, making it possible to pass in any sequence of
    contiguous objects, irrespective of whether the objects live on the
    stack or heap and what actual container owns them.  Implicit
@@ -39,7 +39,7 @@ 
    have one element (usually on the stack).  For example:
 
     struct A { .... };
-    void function (gdb::array_view<A> as);
+    void function (gdb::span<A> as);
 
     std::vector<A> std_vec = ...;
     std::array<A, N> std_array = ...;
@@ -52,13 +52,13 @@ 
     function (elem);
 
    Views can be either mutable or const.  A const view is simply
-   created by specifying a const T as array_view template parameter,
-   in which case operator[] of non-const array_view objects ends up
-   returning const references.  Making the array_view itself const is
+   created by specifying a const T as span template parameter,
+   in which case operator[] of non-const span objects ends up
+   returning const references.  Making the span itself const is
    analogous to making a pointer itself be const.  I.e., disables
    re-seating the view/pointer.
 
-   Since array_view objects are small (pointer plus size), and
+   Since span objects are small (pointer plus size), and
    designed to be trivially copyable, they should generally be passed
    around by value.
 
@@ -68,7 +68,7 @@ 
 namespace gdb {
 
 template <typename T>
-class array_view
+class span
 {
   /* True iff decayed T is the same as decayed U.  E.g., we want to
      say that 'T&' is the same as 'const T'.  */
@@ -92,53 +92,53 @@  class array_view
   using iterator = T *;
 
   /* Default construction creates an empty view.  */
-  constexpr array_view () noexcept
+  constexpr span () noexcept
     : m_array (nullptr), m_size (0)
   {}
 
-  /* Create an array view over a single object of the type of an
-     array_view element.  The created view as size==1.  This is
-     templated on U to allow constructing a array_view<const T> over a
+  /* Create a span over a single object of the type of an
+     span element.  The created view as size==1.  This is
+     templated on U to allow constructing a span<const T> over a
      (non-const) T.  The "convertible" requirement makes sure that you
-     can't create an array_view<T> over a const T.  */
+     can't create an span<T> over a const T.  */
   template<typename U,
 	   typename = Requires<DecayedConvertible<U>>>
-  constexpr array_view (U &elem) noexcept
+  constexpr span (U &elem) noexcept
     : m_array (&elem), m_size (1)
   {}
 
   /* Same as above, for rvalue references.  */
   template<typename U,
 	   typename = Requires<DecayedConvertible<U>>>
-  constexpr array_view (U &&elem) noexcept
+  constexpr span (U &&elem) noexcept
     : m_array (&elem), m_size (1)
   {}
 
-  /* Create an array view from a pointer to an array and an element
+  /* Create a span from a pointer to an array and an element
      count.  */
   template<typename U,
 	   typename = Requires<DecayedConvertible<U>>>
-  constexpr array_view (U *array, size_t size) noexcept
+  constexpr span (U *array, size_t size) noexcept
     : m_array (array), m_size (size)
   {}
 
-  /* Create an array view from a range.  This is templated on both U
+  /* Create a span from a range.  This is templated on both U
      an V to allow passing in a mix of 'const T *' and 'T *'.  */
   template<typename U, typename V,
 	   typename = Requires<DecayedConvertible<U>>,
 	   typename = Requires<DecayedConvertible<V>>>
-  constexpr array_view (U *begin, V *end) noexcept
+  constexpr span (U *begin, V *end) noexcept
     : m_array (begin), m_size (end - begin)
   {}
 
-  /* Create an array view from an array.  */
+  /* Create a span from an array.  */
   template<typename U, size_t Size,
 	   typename = Requires<DecayedConvertible<U>>>
-  constexpr array_view (U (&array)[Size]) noexcept
+  constexpr span (U (&array)[Size]) noexcept
     : m_array (array), m_size (Size)
   {}
 
-  /* Create an array view from a contiguous container.  E.g.,
+  /* Create a span from a contiguous container.  E.g.,
      std::vector and std::array.  */
   template<typename Container,
 	   typename = Requires<gdb::Not<IsDecayedT<Container>>>,
@@ -151,7 +151,7 @@  class array_view
 	     = Requires<std::is_convertible
 			<decltype (std::declval<Container> ().size ()),
 			 size_type>>>
-  constexpr array_view (Container &&c) noexcept
+  constexpr span (Container &&c) noexcept
     : m_array (c.data ()), m_size (c.size ())
   {}
 
@@ -183,11 +183,11 @@  class array_view
   constexpr size_type size () const noexcept { return m_size; }
   constexpr bool empty () const noexcept { return m_size == 0; }
 
-  /* Slice an array view.  */
+  /* Slice a span.  */
 
-  /* Return a new array view over SIZE elements starting at START.  */
+  /* Return a new span over SIZE elements starting at START.  */
   [[nodiscard]]
-  constexpr array_view<T> slice (size_type start, size_type size) const noexcept
+  constexpr span<T> slice (size_type start, size_type size) const noexcept
   {
 #if defined(_GLIBCXX_DEBUG)
     gdb_assert (start + size <= m_size);
@@ -195,10 +195,10 @@  class array_view
     return {m_array + start, size};
   }
 
-  /* Return a new array view over all the elements after START,
+  /* Return a new span over all the elements after START,
      inclusive.  */
   [[nodiscard]]
-  constexpr array_view<T> slice (size_type start) const noexcept
+  constexpr span<T> slice (size_type start) const noexcept
   {
 #if defined(_GLIBCXX_DEBUG)
     gdb_assert (start <= m_size);
@@ -216,7 +216,7 @@  class array_view
    The two array views must have the same length.  */
 
 template <typename U, typename T>
-void copy (gdb::array_view<U> src, gdb::array_view<T> dest)
+void copy (gdb::span<U> src, gdb::span<T> dest)
 {
   gdb_assert (dest.size () == src.size ());
   if (dest.data () < src.data ())
@@ -231,7 +231,7 @@  void copy (gdb::array_view<U> src, gdb::array_view<T> dest)
 
 template <typename T>
 bool
-operator== (const gdb::array_view<T> &lhs, const gdb::array_view<T> &rhs)
+operator== (const gdb::span<T> &lhs, const gdb::span<T> &rhs)
 {
   if (lhs.size () != rhs.size ())
     return false;
@@ -243,26 +243,26 @@  operator== (const gdb::array_view<T> &lhs, const gdb::array_view<T> &rhs)
   return true;
 }
 
-/* Compare two array_views for inequality.  */
+/* Compare two spans for inequality.  */
 
 template <typename T>
 bool
-operator!= (const gdb::array_view<T> &lhs, const gdb::array_view<T> &rhs)
+operator!= (const gdb::span<T> &lhs, const gdb::span<T> &rhs)
 {
   return !(lhs == rhs);
 }
 
-/* Create an array view from a pointer to an array and an element
+/* Create a span from a pointer to an array and an element
    count.
 
-   This is useful as alternative to constructing an array_view using
+   This is useful as alternative to constructing an span using
    brace initialization when the size variable you have handy is of
    signed type, since otherwise without an explicit cast the code
    would be ill-formed.
 
    For example, with:
 
-     extern void foo (int, int, gdb::array_view<value *>);
+     extern void foo (int, int, gdb::span<value *>);
 
      value *args[2];
      int nargs;
@@ -277,27 +277,27 @@  operator!= (const gdb::array_view<T> &lhs, const gdb::array_view<T> &rhs)
 
      foo (1, 2, {values, (size_t) nargs});
 
-   Or by instantiating an array_view explicitly:
+   Or by instantiating an span explicitly:
 
-     foo (1, 2, gdb::array_view<value *>(values, nargs));
+     foo (1, 2, gdb::span<value *>(values, nargs));
 
-   Or, better, using make_array_view, which has the advantage of
-   inferring the array_view element's type:
+   Or, better, using make_span, which has the advantage of
+   inferring the span element's type:
 
-     foo (1, 2, gdb::make_array_view (values, nargs));
+     foo (1, 2, gdb::make_span (values, nargs));
 */
 
 template<typename U>
-constexpr inline array_view<U>
+constexpr inline span<U>
 make_array_view (U *array, size_t size) noexcept
 {
   return {array, size};
 }
 
-/* Create an array view from an array.  */
+/* Create a span from an array.  */
 
 template <typename U, std::size_t Size>
-constexpr inline array_view<U>
+constexpr inline span<U>
 make_array_view (U (&array)[Size])
 {
   return {array};