Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@adacore.com>,
	Simon Marchi <simon.marchi@efficios.com>
Subject: [PATCH v4 01/16] Rename array_view files
Date: Wed, 18 Nov 2026 15:56:02 -0700	[thread overview]
Message-ID: <20261118-span-part-1-v4-1-5ecf901e570b@adacore.com> (raw)
In-Reply-To: <20261118-span-part-1-v4-0-5ecf901e570b@adacore.com>

This renames gdbsupport/array-view.h to gdbsupport/span.h, and also
renames the unit test file.

Minor changes were need in both files: the preprocessor symbol in
span.h; and while not strictly necessary, I changed the name of the
initialization function in the unit test file.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31422
Approved-By: Simon Marchi <simon.marchi@efficios.com>
---
 gdb/Makefile.in                                            | 2 +-
 gdb/block.h                                                | 2 +-
 gdb/breakpoint.c                                           | 2 +-
 gdb/breakpoint.h                                           | 2 +-
 gdb/cli/cli-option.h                                       | 2 +-
 gdb/cp-support.h                                           | 2 +-
 gdb/displaced-stepping.h                                   | 2 +-
 gdb/dwarf2/index-cache.h                                   | 2 +-
 gdb/extension.h                                            | 2 +-
 gdb/gdbtypes.h                                             | 2 +-
 gdb/infcall.h                                              | 2 +-
 gdb/regcache.h                                             | 2 +-
 gdb/unittests/ranges-selftests.c                           | 2 +-
 gdb/unittests/{array-view-selftests.c => span-selftests.c} | 4 ++--
 gdb/value.c                                                | 2 +-
 gdbserver/target.h                                         | 2 +-
 gdbsupport/common-inferior.h                               | 2 +-
 gdbsupport/common-utils.h                                  | 2 +-
 gdbsupport/pathstuff.h                                     | 2 +-
 gdbsupport/selftest.h                                      | 2 +-
 gdbsupport/{array-view.h => span.h}                        | 8 ++++----
 21 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 55c4d012f25..1b7421240c8 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -506,7 +506,6 @@ SELFTESTS_SRCS = \
 	disasm-selftests.c \
 	gdbarch-selftests.c \
 	selftest-arch.c \
-	unittests/array-view-selftests.c \
 	unittests/child-path-selftests.c \
 	unittests/cli-utils-selftests.c \
 	unittests/command-def-selftests.c \
@@ -544,6 +543,7 @@ SELFTESTS_SRCS = \
 	unittests/scoped_mmap-selftests.c \
 	unittests/scoped_restore-selftests.c \
 	unittests/search-memory-selftests.c \
+	unittests/span-selftests.c \
 	unittests/style-selftests.c \
 	unittests/tracepoint-selftests.c \
 	unittests/tui-selftests.c \
diff --git a/gdb/block.h b/gdb/block.h
index 8e87f9b8b23..2fc1bdea919 100644
--- a/gdb/block.h
+++ b/gdb/block.h
@@ -21,7 +21,7 @@
 #define GDB_BLOCK_H
 
 #include "dictionary.h"
-#include "gdbsupport/array-view.h"
+#include "gdbsupport/span.h"
 #include "gdbsupport/next-iterator.h"
 
 /* Opaque declarations.  */
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index a23f5998b20..a90c2de7ab5 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -79,7 +79,7 @@
 #include "extension.h"
 #include <algorithm>
 #include "progspace-and-thread.h"
-#include "gdbsupport/array-view.h"
+#include "gdbsupport/span.h"
 #include <optional>
 #include "gdbsupport/common-utils.h"
 
diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
index ba6eb15a47e..5a70785382a 100644
--- a/gdb/breakpoint.h
+++ b/gdb/breakpoint.h
@@ -27,7 +27,7 @@
 #include "probe.h"
 #include "location.h"
 #include <vector>
-#include "gdbsupport/array-view.h"
+#include "gdbsupport/span.h"
 #include "gdbsupport/filtered-iterator.h"
 #include "gdbsupport/iterator-range.h"
 #include "gdbsupport/refcounted-object.h"
diff --git a/gdb/cli/cli-option.h b/gdb/cli/cli-option.h
index b3c051253b0..99a8db2f8c7 100644
--- a/gdb/cli/cli-option.h
+++ b/gdb/cli/cli-option.h
@@ -21,7 +21,7 @@
 #define GDB_CLI_CLI_OPTION_H
 
 #include <optional>
-#include "gdbsupport/array-view.h"
+#include "gdbsupport/span.h"
 #include "completer.h"
 #include <string>
 #include "command.h"
diff --git a/gdb/cp-support.h b/gdb/cp-support.h
index 00703c52c88..dfb6865831b 100644
--- a/gdb/cp-support.h
+++ b/gdb/cp-support.h
@@ -24,7 +24,7 @@
 
 #include "symtab.h"
 #include "gdbsupport/gdb_obstack.h"
-#include "gdbsupport/array-view.h"
+#include "gdbsupport/span.h"
 #include <vector>
 
 /* Opaque declarations.  */
diff --git a/gdb/displaced-stepping.h b/gdb/displaced-stepping.h
index c85f402e36e..e0bb77a3fff 100644
--- a/gdb/displaced-stepping.h
+++ b/gdb/displaced-stepping.h
@@ -20,7 +20,7 @@
 #ifndef GDB_DISPLACED_STEPPING_H
 #define GDB_DISPLACED_STEPPING_H
 
-#include "gdbsupport/array-view.h"
+#include "gdbsupport/span.h"
 #include "gdbsupport/byte-vector.h"
 
 struct gdbarch;
diff --git a/gdb/dwarf2/index-cache.h b/gdb/dwarf2/index-cache.h
index 4307bf97cf8..9ee51137d3b 100644
--- a/gdb/dwarf2/index-cache.h
+++ b/gdb/dwarf2/index-cache.h
@@ -20,7 +20,7 @@
 #ifndef GDB_DWARF2_INDEX_CACHE_H
 #define GDB_DWARF2_INDEX_CACHE_H
 
-#include "gdbsupport/array-view.h"
+#include "gdbsupport/span.h"
 
 class dwarf2_per_bfd;
 class index_cache;
diff --git a/gdb/extension.h b/gdb/extension.h
index 360c788a41e..cefb7edb267 100644
--- a/gdb/extension.h
+++ b/gdb/extension.h
@@ -21,7 +21,7 @@
 #define GDB_EXTENSION_H
 
 #include "mi/mi-cmds.h"
-#include "gdbsupport/array-view.h"
+#include "gdbsupport/span.h"
 #include <optional>
 #include "gdbtypes.h"
 
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index 2c49b83246c..edae58754f7 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -41,7 +41,7 @@
    written such that they can be used as both rvalues and lvalues.
  */
 
-#include "gdbsupport/array-view.h"
+#include "gdbsupport/span.h"
 #include <optional>
 #include "gdbsupport/enum-flags.h"
 #include "dwarf2.h"
diff --git a/gdb/infcall.h b/gdb/infcall.h
index 9074fecc364..58e40db3509 100644
--- a/gdb/infcall.h
+++ b/gdb/infcall.h
@@ -21,7 +21,7 @@
 #define GDB_INFCALL_H
 
 #include "dummy-frame.h"
-#include "gdbsupport/array-view.h"
+#include "gdbsupport/span.h"
 
 struct value;
 struct type;
diff --git a/gdb/regcache.h b/gdb/regcache.h
index 66e78a7c2fb..adc1e473630 100644
--- a/gdb/regcache.h
+++ b/gdb/regcache.h
@@ -20,7 +20,7 @@
 #ifndef GDB_REGCACHE_H
 #define GDB_REGCACHE_H
 
-#include "gdbsupport/array-view.h"
+#include "gdbsupport/span.h"
 #include "gdbsupport/common-regcache.h"
 #include "gdbsupport/function-view.h"
 #include "gdbsupport/traits.h"
diff --git a/gdb/unittests/ranges-selftests.c b/gdb/unittests/ranges-selftests.c
index 6791502cc1f..d21f321dc36 100644
--- a/gdb/unittests/ranges-selftests.c
+++ b/gdb/unittests/ranges-selftests.c
@@ -18,7 +18,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "gdbsupport/selftest.h"
-#include "gdbsupport/array-view.h"
+#include "gdbsupport/span.h"
 #include "gdbsupport/ranges.h"
 #include <array>
 #include <vector>
diff --git a/gdb/unittests/array-view-selftests.c b/gdb/unittests/span-selftests.c
similarity index 99%
rename from gdb/unittests/array-view-selftests.c
rename to gdb/unittests/span-selftests.c
index ff31912ab03..760fecf9ddc 100644
--- a/gdb/unittests/array-view-selftests.c
+++ b/gdb/unittests/span-selftests.c
@@ -18,7 +18,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "gdbsupport/selftest.h"
-#include "gdbsupport/array-view.h"
+#include "gdbsupport/span.h"
 #include <array>
 #include <vector>
 
@@ -695,7 +695,7 @@ run_copy_tests ()
 } /* namespace array_view_tests */
 } /* namespace selftests */
 
-INIT_GDB_FILE (array_view_selftests)
+INIT_GDB_FILE (span_selftests)
 {
   selftests::register_test ("array_view",
 			    selftests::array_view_tests::run_tests);
diff --git a/gdb/value.c b/gdb/value.c
index 87a1f804c01..22e35ec20d8 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -46,7 +46,7 @@
 #include "completer.h"
 #include "gdbsupport/cleanups.h"
 #include "gdbsupport/selftest.h"
-#include "gdbsupport/array-view.h"
+#include "gdbsupport/span.h"
 #include "cli/cli-style.h"
 #include "expop.h"
 #include "inferior.h"
diff --git a/gdbserver/target.h b/gdbserver/target.h
index 82eab9d1243..2fe5896a9ff 100644
--- a/gdbserver/target.h
+++ b/gdbserver/target.h
@@ -27,7 +27,7 @@
 #include "target/wait.h"
 #include "target/waitstatus.h"
 #include "mem-break.h"
-#include "gdbsupport/array-view.h"
+#include "gdbsupport/span.h"
 #include "gdbsupport/btrace-common.h"
 #include <vector>
 #include "gdbsupport/byte-vector.h"
diff --git a/gdbsupport/common-inferior.h b/gdbsupport/common-inferior.h
index 4645119e451..53d78b7bc23 100644
--- a/gdbsupport/common-inferior.h
+++ b/gdbsupport/common-inferior.h
@@ -21,7 +21,7 @@
 #ifndef GDBSUPPORT_COMMON_INFERIOR_H
 #define GDBSUPPORT_COMMON_INFERIOR_H
 
-#include "gdbsupport/array-view.h"
+#include "gdbsupport/span.h"
 
 /* Return the exec wrapper to be used when starting the inferior, or NULL
    otherwise.  */
diff --git a/gdbsupport/common-utils.h b/gdbsupport/common-utils.h
index de83a715ac4..c6077fd3196 100644
--- a/gdbsupport/common-utils.h
+++ b/gdbsupport/common-utils.h
@@ -24,7 +24,7 @@
 #include <vector>
 #include "gdbsupport/byte-vector.h"
 #include "gdbsupport/gdb_unique_ptr.h"
-#include "gdbsupport/array-view.h"
+#include "gdbsupport/span.h"
 #include "poison.h"
 #include <string_view>
 
diff --git a/gdbsupport/pathstuff.h b/gdbsupport/pathstuff.h
index 819a4bda527..0d8f7b8a1f9 100644
--- a/gdbsupport/pathstuff.h
+++ b/gdbsupport/pathstuff.h
@@ -21,7 +21,7 @@
 #define GDBSUPPORT_PATHSTUFF_H
 
 #include "gdbsupport/byte-vector.h"
-#include "gdbsupport/array-view.h"
+#include "gdbsupport/span.h"
 
 #include <sys/types.h>
 #include <sys/stat.h>
diff --git a/gdbsupport/selftest.h b/gdbsupport/selftest.h
index 2a153982794..d8a1e106594 100644
--- a/gdbsupport/selftest.h
+++ b/gdbsupport/selftest.h
@@ -19,7 +19,7 @@
 #ifndef GDBSUPPORT_SELFTEST_H
 #define GDBSUPPORT_SELFTEST_H
 
-#include "gdbsupport/array-view.h"
+#include "gdbsupport/span.h"
 #include "gdbsupport/function-view.h"
 #include "gdbsupport/iterator-range.h"
 #include <set>
diff --git a/gdbsupport/array-view.h b/gdbsupport/span.h
similarity index 98%
rename from gdbsupport/array-view.h
rename to gdbsupport/span.h
index 8431d7f5add..9708020b06a 100644
--- a/gdbsupport/array-view.h
+++ b/gdbsupport/span.h
@@ -15,8 +15,8 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#ifndef GDBSUPPORT_ARRAY_VIEW_H
-#define GDBSUPPORT_ARRAY_VIEW_H
+#ifndef GDBSUPPORT_SPAN_H
+#define GDBSUPPORT_SPAN_H
 
 #include "traits.h"
 #include <algorithm>
@@ -63,7 +63,7 @@
    around by value.
 
    You can find unit tests covering the whole API in
-   unittests/array-view-selftests.c.  */
+   unittests/span-selftests.c.  */
 
 namespace gdb {
 
@@ -305,4 +305,4 @@ make_array_view (U (&array)[Size])
 
 } /* namespace gdb */
 
-#endif /* GDBSUPPORT_ARRAY_VIEW_H */
+#endif /* GDBSUPPORT_SPAN_H */

-- 
2.56.0


  reply	other threads:[~2026-11-18 22:56 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 22:56 [PATCH v4 00/16] Rename gdb::array_view to gdb::span Tom Tromey
2026-11-18 22:56 ` Tom Tromey [this message]
2026-11-18 22:56 ` [PATCH v4 02/16] " Tom Tromey
2026-11-18 22:56 ` [PATCH v4 03/16] Rename gdb::make_array_view to gdb::make_span Tom Tromey
2026-11-18 22:56 ` [PATCH v4 04/16] Rename gdb_argv::as_array_view Tom Tromey
2026-11-18 22:56 ` [PATCH v4 05/16] Remove operator== and operator!= from gdb::span Tom Tromey
2026-11-18 22:56 ` [PATCH v4 06/16] Rename span::slice to span::subspan Tom Tromey
2026-11-18 22:56 ` [PATCH v4 07/16] Qualify calls to gdb::copy Tom Tromey
2026-11-18 22:56 ` [PATCH v4 08/16] Add single-argument overloads of process_options et al Tom Tromey
2026-11-18 22:56 ` [PATCH v4 09/16] Remove span from cli-option.c:build_help_option Tom Tromey
2026-11-18 22:56 ` [PATCH v4 10/16] gdb/unittests: use one static_assert per check in span-selftests.c Tom Tromey
2026-11-18 22:56 ` [PATCH v4 11/16] Don't use the single-argument gdb::span constructor Tom Tromey
2026-11-19  3:34   ` Simon Marchi
2026-11-19  3:42   ` Simon Marchi
2026-11-18 22:56 ` [PATCH v4 12/16] Don't turn rvalue reference into a span Tom Tromey
2026-11-19  3:50   ` Simon Marchi
2026-11-19 14:56     ` Tom Tromey
2026-11-18 22:56 ` [PATCH v4 13/16] Make gdb::span conform more closely to C++20 Tom Tromey
2026-11-18 22:56 ` [PATCH v4 14/16] Allow the use of C++20 std::ranges in gdbsupport/ranges.h Tom Tromey
2026-11-18 22:56 ` [PATCH v4 15/16] Allow the use of C++20 std::span in gdbsupport/span.h Tom Tromey
2026-11-19  3:52   ` Simon Marchi
2026-11-20 15:52   ` Jan Vrany
2026-11-20 20:15     ` Simon Marchi
2026-11-18 22:56 ` [PATCH v4 16/16] Move gdb::ranges::equal to gdbsupport/ranges.h Tom Tromey
2026-11-19  4:21 ` [PATCH v4 00/16] Rename gdb::array_view to gdb::span Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261118-span-part-1-v4-1-5ecf901e570b@adacore.com \
    --to=tromey@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@efficios.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox