Re: [PATCH v2 09/28] Remove dwarf2_per_cu_data::mark

Simon Marchi
2025-04-21T03:09:40Z

On 2025-04-02 19:45, Tom Tromey wrote:
> This removes dwarf2_per_cu_data::mark, replacing it with a
> locally-allocated boolean vector. It also inverts the sense of the
> flag -- now, the flag is true when a CU should be skipped, and false
> when the CU should be further examined. Also, the validity of the
> flag is no longer dependent on 'file_matcher != NULL'.
>
> This patch makes the subsequent patch to searching a bit simpler, so
> I've separated it out.
>
> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=16994
> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=16998
> ---
> gdb/dwarf2/read-gdb-index.c | 14 +++++-----
> gdb/dwarf2/read.c | 64 ++++++++++++++++++++++++++-------------------
> gdb/dwarf2/read.h | 35 +++++++++++++++++++++----
> 3 files changed, 75 insertions(+), 38 deletions(-)
>
> diff --git a/gdb/dwarf2/read-gdb-index.c b/gdb/dwarf2/read-gdb-index.c
> index eeaa38a502c09a0acdd1b60a1c0b8403843aa9fe..7bcf50d347609f0b27068228cd78633dd57e1556 100644
> --- a/gdb/dwarf2/read-gdb-index.c
> +++ b/gdb/dwarf2/read-gdb-index.c
> @@ -1030,6 +1030,7 @@ dwarf2_gdb_index::dump (struct objfile *objfile)
>
> static bool
> dw2_expand_marked_cus (dwarf2_per_objfile *per_objfile, offset_type idx,
> + auto_bool_vector &marked,
> expand_symtabs_file_matcher file_matcher,
> expand_symtabs_expansion_listener expansion_notify,
> block_search_flags search_flags,

Can you choose a different name for these "marked" parameters? That
name doesn't convey what a mark means. Perhaps "visited_cus", or
something like that.

Also, does the "marked" in "dw2_expand_marked_cus" have the same meaning
as the "marked" that changed meaning in this patch? If so, does this
function need to be renamed (does it do the opposite of the what its
name imply now)?

Simon