From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@adacore.com>,
Simon Marchi <simon.marchi@efficios.com>,
Simon Marchi <simon.marchi@polymtl.ca>
Subject: [PATCH v4 00/16] Rename gdb::array_view to gdb::span
Date: Wed, 18 Nov 2026 15:56:01 -0700 [thread overview]
Message-ID: <20261118-span-part-1-v4-0-5ecf901e570b@adacore.com> (raw)
In the longer term, when gdb switches to C++20, I think we should
replace gdb::array_view with std::span.
This series moves in that direction. It renames gdb::array_view to
gdb::span and makes a couple of other related changes. It also
removes the operator==, in favor of a standards-esque
gdb::ranges::equal.
This version of the series lets gdb use the real std::span via an
alias.
I've built this series with 'g++' and 'g++ -std=c++20'.
Regression tested on x86-64 Fedora 43.
Signed-off-by: Tom Tromey <tromey@adacore.com>
---
Changes in v4:
- Merged test case updates into their corresponding patches
- Added a patch to reject construction from rvalue containers
- I built each commit the usual way and with -std=c++20
- Link to v3: https://inbox.sourceware.org/gdb-patches/20261117-span-part-1-v3-0-40b8b11d2d8c@adacore.com
Changes in v3:
- Review comments
- Added Simon's patch
- Added patch to rename gdb_argv::as_array_view
- Link to v2: https://inbox.sourceware.org/gdb-patches/20261111-span-part-1-v2-0-cd4e33a8a723@adacore.com
Changes in v2:
- Rebased
- Review comments
- New patches
- Link to v1: https://inbox.sourceware.org/gdb-patches/20261103-span-part-1-v1-0-133180dd43a5@adacore.com
---
Simon Marchi (1):
gdb/unittests: use one static_assert per check in span-selftests.c
Tom Tromey (15):
Rename array_view files
Rename gdb::array_view to gdb::span
Rename gdb::make_array_view to gdb::make_span
Rename gdb_argv::as_array_view
Remove operator== and operator!= from gdb::span
Rename span::slice to span::subspan
Qualify calls to gdb::copy
Add single-argument overloads of process_options et al
Remove span from cli-option.c:build_help_option
Don't use the single-argument gdb::span constructor
Don't turn rvalue reference into a span
Make gdb::span conform more closely to C++20
Allow the use of C++20 std::ranges in gdbsupport/ranges.h
Allow the use of C++20 std::span in gdbsupport/span.h
Move gdb::ranges::equal to gdbsupport/ranges.h
gdb/Makefile.in | 2 +-
gdb/aarch64-tdep.c | 30 +-
gdb/ada-exp-parser.c | 2 +-
gdb/ada-lang.c | 15 +-
gdb/ada-typeprint.c | 4 +-
gdb/ada-valprint.c | 4 +-
gdb/alpha-tdep.c | 2 +-
gdb/amd-dbgapi-target.c | 2 +-
gdb/amd64-tdep.c | 2 +-
gdb/amd64-windows-tdep.c | 8 +-
gdb/arch/arm-get-next-pcs.c | 2 +-
gdb/arm-pikeos-tdep.c | 2 +-
gdb/arm-tdep.c | 14 +-
gdb/block.c | 4 +-
gdb/block.h | 22 +-
gdb/breakpoint.c | 32 +--
gdb/breakpoint.h | 8 +-
gdb/cli/cli-cmds.c | 4 +-
gdb/cli/cli-option.c | 46 ++-
gdb/cli/cli-option.h | 53 +++-
gdb/compile/compile-loc2c.c | 12 +-
gdb/compile/compile-object-load.c | 4 +-
gdb/compile/compile-object-run.c | 2 +-
gdb/compile/compile.h | 4 +-
gdb/corelow.c | 2 +-
gdb/cp-support.c | 2 +-
gdb/cp-support.h | 4 +-
gdb/dicos-tdep.c | 2 +-
gdb/disasm-selftests.c | 6 +-
gdb/disasm.c | 6 +-
gdb/displaced-stepping.h | 9 +-
gdb/dwarf2/attribute.h | 4 +-
gdb/dwarf2/call-site.h | 8 +-
gdb/dwarf2/expr.c | 22 +-
gdb/dwarf2/expr.h | 16 +-
gdb/dwarf2/frame.c | 6 +-
gdb/dwarf2/frame.h | 8 +-
gdb/dwarf2/index-cache.c | 6 +-
gdb/dwarf2/index-cache.h | 14 +-
gdb/dwarf2/index-write.c | 2 +-
gdb/dwarf2/loc.c | 40 +--
gdb/dwarf2/loc.h | 22 +-
gdb/dwarf2/read-debug-names.c | 12 +-
gdb/dwarf2/read-gdb-index.c | 28 +-
gdb/dwarf2/read-gdb-index.h | 4 +-
gdb/dwarf2/read.c | 60 ++--
gdb/dwarf2/read.h | 2 +-
gdb/elfread.c | 9 +-
gdb/eval.c | 22 +-
gdb/expression.h | 2 +-
gdb/extension.c | 2 +-
gdb/extension.h | 8 +-
gdb/extract-store-integer.c | 18 +-
gdb/extract-store-integer.h | 22 +-
gdb/f-lang.c | 4 +-
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 | 36 +--
gdb/frame.h | 18 +-
gdb/gcore.c | 2 +-
gdb/gdb-gdb.gdb | 2 +-
gdb/gdb_bfd.c | 6 +-
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 | 22 +-
gdb/gdbtypes.h | 28 +-
gdb/gmp-utils.c | 8 +-
gdb/gmp-utils.h | 14 +-
gdb/gnu-v3-abi.c | 2 +-
gdb/guile/scm-value.c | 2 +-
gdb/i386-tdep.c | 6 +-
gdb/i386-tdep.h | 2 +-
gdb/i386-windows-tdep.c | 2 +-
gdb/i387-tdep.c | 4 +-
gdb/ia64-tdep.c | 4 +-
gdb/infcall.c | 12 +-
gdb/infcall.h | 6 +-
gdb/inferior.h | 2 +-
gdb/jit.c | 2 +-
gdb/linux-nat.c | 4 +-
gdb/linux-nat.h | 4 +-
gdb/linux-thread-db.c | 4 +-
gdb/m68k-tdep.c | 4 +-
gdb/main.c | 2 +-
gdb/maint.c | 2 +-
gdb/minsyms.c | 6 +-
gdb/mips-tdep.c | 18 +-
gdb/nat/x86-linux.c | 4 +-
gdb/nat/x86-linux.h | 4 +-
gdb/netbsd-nat.c | 2 +-
gdb/netbsd-nat.h | 2 +-
gdb/objc-lang.c | 22 +-
gdb/objfiles.c | 4 +-
gdb/objfiles.h | 2 +-
gdb/ppc-sysv-tdep.c | 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 | 6 +-
gdb/python/py-wrappers.h | 2 +-
gdb/python/py-xmethods.c | 8 +-
gdb/python/python.c | 14 +-
gdb/ravenscar-thread.h | 4 +-
gdb/regcache.c | 108 +++----
gdb/regcache.h | 48 ++--
gdb/remote.c | 30 +-
gdb/remote.h | 6 +-
gdb/riscv-ravenscar-thread.c | 2 +-
gdb/riscv-tdep.c | 2 +-
gdb/rs6000-tdep.c | 4 +-
gdb/rust-lang.c | 7 +-
gdb/solib-darwin.c | 2 +-
gdb/solib.c | 2 +-
gdb/source.c | 13 +-
gdb/symtab.c | 4 +-
gdb/symtab.h | 6 +-
gdb/target-debug.h | 10 +-
gdb/target-delegates-gen.c | 48 ++--
gdb/target.c | 8 +-
gdb/target.h | 18 +-
gdb/thread.c | 4 +-
gdb/trad-frame.c | 2 +-
gdb/trad-frame.h | 6 +-
gdb/unittests/intrusive_list-selftests.c | 2 +-
gdb/unittests/ranges-selftests.c | 4 +-
.../{array-view-selftests.c => span-selftests.c} | 314 +++++++++------------
gdb/utils.c | 10 +-
gdb/valarith.c | 63 +++--
gdb/valops.c | 68 ++---
gdb/valprint.c | 2 +-
gdb/value.c | 95 ++++---
gdb/value.h | 30 +-
gdb/windows-tdep.c | 6 +-
gdb/windows-tdep.h | 4 +-
gdb/x86-linux-nat.c | 8 +-
gdb/xcoffread.c | 2 +-
gdbserver/linux-x86-low.cc | 4 +-
gdbserver/regcache.cc | 22 +-
gdbserver/regcache.h | 4 +-
gdbserver/server.cc | 2 +-
gdbserver/target.cc | 2 +-
gdbserver/target.h | 4 +-
gdbsupport/buildargv.h | 10 +-
gdbsupport/common-inferior.cc | 8 +-
gdbsupport/common-inferior.h | 4 +-
gdbsupport/common-regcache.h | 12 +-
gdbsupport/common-utils.cc | 2 +-
gdbsupport/common-utils.h | 6 +-
gdbsupport/pathstuff.cc | 2 +-
gdbsupport/pathstuff.h | 6 +-
gdbsupport/ranges.h | 33 +++
gdbsupport/remote-args.h | 2 +-
gdbsupport/rsp-low.cc | 2 +-
gdbsupport/rsp-low.h | 2 +-
gdbsupport/selftest.cc | 2 +-
gdbsupport/selftest.h | 4 +-
gdbsupport/{array-view.h => span.h} | 171 +++++------
165 files changed, 1130 insertions(+), 1108 deletions(-)
---
base-commit: f318ccd4761fb960a9584a404be3c61e5405f077
change-id: 20261103-span-part-1-34e000e1fc40
Best regards,
--
Tom Tromey <tromey@adacore.com>
next 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 Tom Tromey [this message]
2026-11-18 22:56 ` [PATCH v4 01/16] Rename array_view files Tom Tromey
2026-11-18 22:56 ` [PATCH v4 02/16] Rename gdb::array_view to gdb::span 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-0-5ecf901e570b@adacore.com \
--to=tromey@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@efficios.com \
--cc=simon.marchi@polymtl.ca \
/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