Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH v3 00/17] Rename gdb::array_view to gdb::span
@ 2026-11-17 22:09 Tom Tromey
  2026-11-17 22:09 ` [PATCH v3 01/17] Rename array_view files Tom Tromey
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: Tom Tromey @ 2026-11-17 22:09 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey, Simon Marchi, Simon Marchi

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 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 (16):
      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
      Change span-selftests.c for C++20
      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}   | 309 +++++++++------------
 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}                | 157 +++++------
 165 files changed, 1112 insertions(+), 1107 deletions(-)
---
base-commit: f318ccd4761fb960a9584a404be3c61e5405f077
change-id: 20261103-span-part-1-34e000e1fc40

Best regards,
--  
Tom Tromey <tromey@adacore.com>


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2026-11-18 15:05 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH v3 04/17] Rename gdb_argv::as_array_view Tom Tromey
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox