Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@redhat.com>
To: Simon Marchi <simon.marchi@efficios.com>, gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@polymtl.ca>
Subject: Re: [PATCH 11/11] gdb: make iterate_over_symbols return void, rename to for_each_symbol
Date: Fri, 17 Apr 2026 15:05:26 +0100	[thread overview]
Message-ID: <87340tel7d.fsf@redhat.com> (raw)
In-Reply-To: <20260416202408.422441-12-simon.marchi@efficios.com>

Simon Marchi <simon.marchi@efficios.com> writes:

> From: Simon Marchi <simon.marchi@polymtl.ca>
>
> Nothing really uses the return value of iterate_over_symbols and
> language::iterate_over_symbols.  Also, all provided callback always
> return true, iterating on all matching symbols.  Simplify them to not
> return a value and not have the "stop iterating" feature.
>
> Rename to for_each_symbol, just to be consistent with previous patches.
>
> Also rename symbol_found_callback_ftype to
> for_each_symbol_callback_ftype for consistency.
>
> Change-Id: I55ff3162098bb069dc1de1afca10dd9abfc05c34
> ---
>  gdb/ada-lang.c | 26 ++++++++------------------
>  gdb/language.h | 13 ++++---------
>  gdb/linespec.c | 38 ++++++++++++++++----------------------
>  gdb/symtab.c   | 23 +++++++++--------------
>  gdb/symtab.h   | 22 +++++++---------------
>  5 files changed, 44 insertions(+), 78 deletions(-)
>

> @@ -5665,7 +5660,7 @@ ada_add_all_symbols (std::vector<struct block_symbol> &result,
>        else
>  	{
>  	  /* In the !full_search case we're are being called by
> -	     iterate_over_symbols, and we don't want to search
> +	     for_each_symbol, and we don't want to search

As you're touching this comment anyway, could you fix the first line
please, the 'are' is not necessary:

  In the !full_search case we're being called by ...

> @@ -2806,26 +2806,18 @@ using find_symtab_callback_ftype = std::function<bool (symtab *)>;
>  std::vector<const linetable_entry *> find_linetable_entries_for_symtab_line
>      (struct symtab *symtab, int line, const linetable_entry **best_entry);
>  
> -/* Prototype for callbacks for LA_ITERATE_OVER_SYMBOLS.  The callback
> -   is called once per matching symbol SYM.  The callback should return
> -   true to indicate that LA_ITERATE_OVER_SYMBOLS should continue
> -   iterating, or false to indicate that the iteration should end.  */

And again, I complained about this in the previous patch review, but
you've now removed it.  So again, apologies.

Approved-By: Andrew Burgess <aburgess@redhat.com>

Thanks,
Andrew


  reply	other threads:[~2026-04-17 14:06 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-16 20:16 [PATCH 00/11] Readability improvements of some iteration functions Simon Marchi
2026-04-16 20:16 ` [PATCH 01/11] gdb/dwarf: remove unused file_match parameter from dwarf2_base_index_functions::search_one Simon Marchi
2026-04-17 11:11   ` Andrew Burgess
2026-04-16 20:16 ` [PATCH 02/11] gdb: rename search_symtabs_expansion_listener -> compunit_symtab_iteration_callback Simon Marchi
2026-04-17 15:08   ` Simon Marchi
2026-04-17 17:17   ` Tom Tromey
2026-04-17 19:34     ` Simon Marchi
2026-04-16 20:16 ` [PATCH 03/11] gdb: introduce iteration_status enum, use it for search callbacks Simon Marchi
2026-04-17 11:01   ` Andrew Burgess
2026-04-17 14:33     ` Simon Marchi
2026-04-17 14:34   ` Tom Tromey
2026-04-16 20:16 ` [PATCH 04/11] gdb, gdbserver: make iterate_over_lwps_ftype a function_view Simon Marchi
2026-04-17 11:09   ` Andrew Burgess
2026-04-17 14:37     ` Simon Marchi
2026-04-16 20:16 ` [PATCH 05/11] gdb, gdbserver: split iterate_over_lwps in for_each_lwp and find_lwp Simon Marchi
2026-04-17 11:25   ` Andrew Burgess
2026-04-17 14:53     ` Simon Marchi
2026-04-16 20:16 ` [PATCH 06/11] gdb: split iterate_over_threads in for_each_thread and find_thread Simon Marchi
2026-04-17 11:33   ` Andrew Burgess
2026-04-16 20:16 ` [PATCH 07/11] gdb: split iterate_over_minimal_symbols in for_each_minimal_symbol and find_minimal_symbol Simon Marchi
2026-04-17 12:13   ` Andrew Burgess
2026-04-16 20:16 ` [PATCH 08/11] gdb: split iterate_over_symtabs in for_each_symtab and find_symtab Simon Marchi
2026-04-17 13:31   ` Andrew Burgess
2026-04-17 14:54     ` Simon Marchi
2026-04-16 20:16 ` [PATCH 09/11] gdb: change objfile::map_symtabs_matching_filename to find_symtab_matching_filename Simon Marchi
2026-04-17 13:50   ` Andrew Burgess
2026-04-17 15:03     ` Simon Marchi
2026-04-16 20:16 ` [PATCH 10/11] gdb: make symbol_found_callback_ftype a function_view Simon Marchi
2026-04-17 13:55   ` Andrew Burgess
2026-04-17 15:04     ` Simon Marchi
2026-04-16 20:16 ` [PATCH 11/11] gdb: make iterate_over_symbols return void, rename to for_each_symbol Simon Marchi
2026-04-17 14:05   ` Andrew Burgess [this message]
2026-04-17 15:06     ` 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=87340tel7d.fsf@redhat.com \
    --to=aburgess@redhat.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