From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@adacore.com>
Subject: [PATCH v3 04/17] Rename gdb_argv::as_array_view
Date: Tue, 17 Nov 2026 15:10:00 -0700 [thread overview]
Message-ID: <20261117-span-part-1-v3-4-40b8b11d2d8c@adacore.com> (raw)
In-Reply-To: <20261117-span-part-1-v3-0-40b8b11d2d8c@adacore.com>
This renames gdb_argv::as_array_view to gdb_argv::as_span.
---
gdb/maint.c | 2 +-
gdb/utils.c | 10 +++++-----
gdbsupport/buildargv.h | 6 +++---
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/gdb/maint.c b/gdb/maint.c
index f5711d978fa..8a5a2030be6 100644
--- a/gdb/maint.c
+++ b/gdb/maint.c
@@ -1275,7 +1275,7 @@ maintenance_selftest (const char *args, int from_tty)
gdb::option::process_options
(&args, gdb::option::PROCESS_OPTIONS_UNKNOWN_IS_ERROR, grp);
const gdb_argv argv (args);
- selftests::run_tests (argv.as_array_view (), opts.verbose);
+ selftests::run_tests (argv.as_span (), opts.verbose);
#else
gdb_printf (_("\
Selftests have been disabled for this build.\n"));
diff --git a/gdb/utils.c b/gdb/utils.c
index d39e4a97f48..ccaeda7c96f 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -3226,15 +3226,15 @@ gdb_realpath_tests ()
gdb_realpath_check_trailer ("", "");
}
-/* Test the gdb_argv::as_array_view method. */
+/* Test the gdb_argv::as_span method. */
static void
-gdb_argv_as_array_view_test ()
+gdb_argv_as_span_test ()
{
{
gdb_argv argv;
- gdb::span<char *> view = argv.as_array_view ();
+ gdb::span<char *> view = argv.as_span ();
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::span<char *> view = argv.as_array_view ();
+ gdb::span<char *> view = argv.as_span ();
SELF_CHECK (view.size () == 3);
SELF_CHECK (streq (view[0], "une"));
@@ -3710,7 +3710,7 @@ When set, debugging messages will be marked with seconds and microseconds."),
#if GDB_SELF_TEST
selftests::register_test ("gdb_realpath", gdb_realpath_tests);
- selftests::register_test ("gdb_argv_array_view", gdb_argv_as_array_view_test);
+ selftests::register_test ("gdb_argv_span", gdb_argv_as_span_test);
selftests::register_test ("strncmp_iw_with_mode",
strncmp_iw_with_mode_tests);
selftests::register_test ("pager", test_pager);
diff --git a/gdbsupport/buildargv.h b/gdbsupport/buildargv.h
index d49f5aa8273..0e2ca6a6594 100644
--- a/gdbsupport/buildargv.h
+++ b/gdbsupport/buildargv.h
@@ -124,14 +124,14 @@ class gdb_argv
return m_argv[arg];
}
- /* Return the arguments array as an array view. */
+ /* Return the arguments array as a span. */
- gdb::span<char *> as_array_view ()
+ gdb::span<char *> as_span ()
{
return gdb::span<char *> (this->get (), this->count ());
}
- gdb::span<const char * const> as_array_view () const
+ gdb::span<const char * const> as_span () const
{
return gdb::span<const char * const> (this->get (), this->count ());
}
--
2.56.0
next prev parent reply other threads:[~2026-11-17 22:11 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 22:09 [PATCH v3 00/17] Rename gdb::array_view to gdb::span Tom Tromey
2026-11-17 22:09 ` [PATCH v3 01/17] Rename array_view files Tom Tromey
2026-11-17 22:09 ` [PATCH v3 02/17] Rename gdb::array_view to gdb::span Tom Tromey
2026-11-17 22:09 ` [PATCH v3 03/17] Rename gdb::make_array_view to gdb::make_span Tom Tromey
2026-11-17 22:10 ` Tom Tromey [this message]
2026-11-17 22:10 ` [PATCH v3 05/17] Remove operator== and operator!= from gdb::span Tom Tromey
2026-11-17 22:10 ` [PATCH v3 06/17] Rename span::slice to span::subspan Tom Tromey
2026-11-17 22:10 ` [PATCH v3 07/17] Qualify calls to gdb::copy Tom Tromey
2026-11-17 22:10 ` [PATCH v3 08/17] Add single-argument overloads of process_options et al Tom Tromey
2026-11-17 22:10 ` [PATCH v3 09/17] Remove span from cli-option.c:build_help_option Tom Tromey
2026-11-17 22:10 ` [PATCH v3 10/17] Don't use the single-argument gdb::span constructor Tom Tromey
2026-11-17 22:10 ` [PATCH v3 11/17] Don't turn rvalue reference into a span Tom Tromey
2026-11-17 22:10 ` [PATCH v3 12/17] gdb/unittests: use one static_assert per check in span-selftests.c Tom Tromey
2026-11-17 22:10 ` [PATCH v3 13/17] Change span-selftests.c for C++20 Tom Tromey
2026-11-17 22:10 ` [PATCH v3 14/17] Make gdb::span conform more closely to C++20 Tom Tromey
2026-11-17 22:10 ` [PATCH v3 15/17] Allow the use of C++20 std::ranges in gdbsupport/ranges.h Tom Tromey
2026-11-17 22:10 ` [PATCH v3 16/17] Allow the use of C++20 std::span in gdbsupport/span.h Tom Tromey
2026-11-17 22:10 ` [PATCH v3 17/17] Move gdb::ranges::equal to gdbsupport/ranges.h Tom Tromey
2026-11-18 15:04 ` [PATCH v3 00/17] Rename gdb::array_view to gdb::span Tom Tromey
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=20261117-span-part-1-v3-4-40b8b11d2d8c@adacore.com \
--to=tromey@adacore.com \
--cc=gdb-patches@sourceware.org \
/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