Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH 0/4] Remove some uses of iterate_over_inferiors
@ 2019-09-19 21:28 Tom Tromey
  2019-09-19 21:28 ` [PATCH 4/4] Remove a use of iterate_over_threads from mi-main.c Tom Tromey
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Tom Tromey @ 2019-09-19 21:28 UTC (permalink / raw)
  To: gdb-patches

This series removes some uses of iterate_over_inferiors in favor of
foreach-style iteration.  I find the latter simpler both to debug and
to read.

There are more instances of iterate_over_inferiors, and other
iterate_over_* functions -- this series is just a starter to see
whether others agree, so let me know what you think.

Tested on x86-64 Fedora by the buildbot.

Tom



^ permalink raw reply	[flat|nested] 10+ messages in thread
* [PATCH 0/4] Remove some uses of iterate_over_inferiors
@ 2020-01-15 19:12 Simon Marchi
  2020-01-16 16:23 ` Tom Tromey
  0 siblings, 1 reply; 10+ messages in thread
From: Simon Marchi @ 2020-01-15 19:12 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

Today, it's very easy to iterate over inferiors using a range-based for
loop combined with all_inferiors.  I think it gives simpler and easier
to understand code than iterate_over_inferiors, which uses a void
pointer to pass data from the caller.  I noticed that there were very
few uses of iterate_over_inferiors left, so I think we could convert
them to range-based for loop and get rid of it.

This patch series removes the uses that are in the files I can build
easily, I can take care of the rest later.

Simon Marchi (4):
  gdb: remove use of iterate_over_inferiors in py-inferior.c
  gdb: remove use of iterate_over_inferiors in mi/mi-interp.c
  gdb: remove uses of iterate_over_inferiors in mi/mi-main.c
  gdb: remove uses of iterate_over_inferiors in top.c

 gdb/mi/mi-interp.c       | 40 +++++++++-------------
 gdb/mi/mi-main.c         | 73 +++++++++++++++-------------------------
 gdb/python/py-inferior.c | 24 ++++++-------
 gdb/top.c                | 51 +++++++++++-----------------
 4 files changed, 72 insertions(+), 116 deletions(-)

-- 
2.25.0


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

end of thread, other threads:[~2020-01-16 22:31 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-19 21:28 [PATCH 0/4] Remove some uses of iterate_over_inferiors Tom Tromey
2019-09-19 21:28 ` [PATCH 4/4] Remove a use of iterate_over_threads from mi-main.c Tom Tromey
2019-09-19 21:28 ` [PATCH 2/4] Don't use iterate_over_inferiors in top.c Tom Tromey
2019-09-19 21:28 ` [PATCH 1/4] Use foreach in gdbpy_inferiors Tom Tromey
2019-09-19 21:28 ` [PATCH 3/4] Don't use iterate_over_inferiors in target.c Tom Tromey
2019-09-20  2:16 ` [PATCH 0/4] Remove some uses of iterate_over_inferiors Simon Marchi
2019-09-20 14:02   ` Tom Tromey
2020-01-15 19:12 Simon Marchi
2020-01-16 16:23 ` Tom Tromey
2020-01-16 22:46   ` Simon Marchi

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