[PATCH 0/4] Remove some uses of iterate_over_inferiors

Simon Marchi simon.marchi@efficios.com
Wed Jan 15 19:12:00 GMT 2020


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



More information about the Gdb-patches mailing list