Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH 00/10] [gdb] Add superblocks range loops
@ 2026-05-01 12:44 Tom de Vries
  2026-05-01 12:44 ` [PATCH 01/10] [gdb] Use block::containing_function Tom de Vries
                   ` (10 more replies)
  0 siblings, 11 replies; 14+ messages in thread
From: Tom de Vries @ 2026-05-01 12:44 UTC (permalink / raw)
  To: gdb-patches

This series attempts to rewrite code like this:
...
  while (block != NULL)
    {
      ...
      block = block->superblock ();
    }
...
using range loops.

I haven't rewritten loops in block.c itself.

An RFC was submitted here [1].

Changes in v1:
- commit first two patches of RFC
- add a patch adding uses of block::containing_function
- add patches adding and using block::containing_function_block
- add next_iterator unit test, also excercising incomplete type case
- modernize next_iterator by replacing typedef with using
- rewrite base_next_iterator to use Curiously Recurring Template Pattern
- use using to import constructors in next_iterator
- move comment part showing "using a pointer-to-member template argument
  T::next" to commit message
- change names to block_and_superblocks block_and_superblocks_in_fn
- add some missing comments
- complete the refactoring using the range loops
- clarify behaviour of block_and_superblocks_in_fn in relation to static and
  global blocks in commit message
- also avoid static and global blocks in function_block_iterator::next

[1] https://sourceware.org/pipermail/gdb-patches/2026-April/226720.html

Tom de Vries (10):
  [gdb] Use block::containing_function
  [gdb] Factor out block::containing_function_block
  [gdb] Use block::containing_function_block
  [gdb] Add unit test for next_iterator
  [gdbsupport] Use using instead of typedef in next_iterator
  [gdbsupport] Factor out base_next_iterator
  [gdb] Add block::block_and_superblocks
  [gdb] Use block::block_and_superblocks
  [gdb] Add block::block_and_superblocks_in_fn
  [gdb] Use block::block_and_superblocks_in_fn

 gdb/Makefile.in                         |   1 +
 gdb/ada-lang.c                          |  61 ++++------
 gdb/block.c                             |  18 ++-
 gdb/block.h                             | 102 ++++++++++++++++
 gdb/blockframe.c                        |  11 +-
 gdb/compile/compile-c-symbols.c         |  10 +-
 gdb/compile/compile-object-load.c       |   8 +-
 gdb/cp-namespace.c                      |   6 +-
 gdb/cp-support.c                        |   8 +-
 gdb/d-namespace.c                       |   6 +-
 gdb/dwarf2/line-program.c               |  24 ++--
 gdb/f-valprint.c                        |  19 ++-
 gdb/go-lang.c                           |  31 ++---
 gdb/guile/scm-frame.c                   |  13 +-
 gdb/infrun.c                            |  10 +-
 gdb/inline-frame.c                      |  45 ++++---
 gdb/linespec.c                          |  22 ++--
 gdb/mi/mi-cmd-stack.c                   | 155 +++++++++++-------------
 gdb/python/py-frame.c                   |  13 +-
 gdb/python/py-unwind.c                  |  15 +--
 gdb/stack.c                             |  15 +--
 gdb/symmisc.c                           |   9 +-
 gdb/symtab.c                            |  69 ++++++-----
 gdb/tracepoint.c                        |   9 +-
 gdb/unittests/next-iterator-selftests.c | 105 ++++++++++++++++
 gdbsupport/next-iterator.h              |  48 +++++---
 gdbsupport/safe-iterator.h              |  12 +-
 27 files changed, 511 insertions(+), 334 deletions(-)
 create mode 100644 gdb/unittests/next-iterator-selftests.c


base-commit: 27d21139e356aca4b77d32e81105c465f1e6650c
-- 
2.51.0


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

end of thread, other threads:[~2026-06-09 12:41 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-01 12:44 [PATCH 00/10] [gdb] Add superblocks range loops Tom de Vries
2026-05-01 12:44 ` [PATCH 01/10] [gdb] Use block::containing_function Tom de Vries
2026-05-01 12:44 ` [PATCH 02/10] [gdb] Factor out block::containing_function_block Tom de Vries
2026-05-01 12:44 ` [PATCH 03/10] [gdb] Use block::containing_function_block Tom de Vries
2026-05-01 12:44 ` [PATCH 04/10] [gdb] Add unit test for next_iterator Tom de Vries
2026-05-01 12:44 ` [PATCH 05/10] [gdbsupport] Use using instead of typedef in next_iterator Tom de Vries
2026-05-01 12:45 ` [PATCH 06/10] [gdbsupport] Factor out base_next_iterator Tom de Vries
2026-05-08 19:17   ` Tom Tromey
2026-05-01 12:45 ` [PATCH 07/10] [gdb] Add block::block_and_superblocks Tom de Vries
2026-05-01 12:45 ` [PATCH 08/10] [gdb] Use block::block_and_superblocks Tom de Vries
2026-05-08 19:41   ` Tom Tromey
2026-05-01 12:45 ` [PATCH 09/10] [gdb] Add block::block_and_superblocks_in_fn Tom de Vries
2026-05-01 12:45 ` [PATCH 10/10] [gdb] Use block::block_and_superblocks_in_fn Tom de Vries
2026-06-09 12:40 ` [PATCH 00/10] [gdb] Add superblocks range loops Tom de Vries

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