Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [RFC 1/2] [gdb/symtab] Propagate search domain to process_queue
Date: Wed,  8 Apr 2026 13:08:26 +0200	[thread overview]
Message-ID: <20260408110827.2249311-2-tdevries@suse.de> (raw)
In-Reply-To: <20260408110827.2249311-1-tdevries@suse.de>

Propagate the active search domain to function process_queue.  No functional
changes.
---
 gdb/dwarf2/read.c | 25 ++++++++++++++-----------
 gdb/dwarf2/read.h |  3 ++-
 2 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 4035bba6e45..afd0b60006e 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -935,7 +935,8 @@ static struct type *get_die_type (struct die_info *die, struct dwarf2_cu *cu);
 
 static void queue_comp_unit (dwarf2_cu *cu);
 
-static void process_queue (dwarf2_per_objfile *per_objfile);
+static void process_queue (dwarf2_per_objfile *per_objfile,
+			   domain_search_flags domain = 0);
 
 /* Class, the destructor of which frees all allocated queue entries.  This
    will only have work to do if an error was thrown while processing the
@@ -1481,7 +1482,7 @@ struct readnow_functions : public dwarf2_base_index_functions
 	    || per_objfile->get_compunit_symtab (per_cu.get ()) == nullptr)
 	  continue;
 	if (!search_one (per_cu.get (), per_objfile, cus_to_skip, file_matcher,
-			 listener, lang_matcher))
+			 listener, lang_matcher, domain))
 	  return false;
       }
     return true;
@@ -1532,7 +1533,8 @@ load_cu (dwarf2_per_cu *per_cu, dwarf2_per_objfile *per_objfile,
 
 static void
 dw2_do_instantiate_symtab (dwarf2_per_cu *per_cu,
-			   dwarf2_per_objfile *per_objfile, bool skip_partial)
+			   dwarf2_per_objfile *per_objfile, bool skip_partial,
+			   domain_search_flags domain = 0)
 {
   {
     /* The destructor of dwarf2_queue_guard frees any entries left on
@@ -1560,7 +1562,7 @@ dw2_do_instantiate_symtab (dwarf2_per_cu *per_cu,
 	    && per_objfile->per_bfd->dwp_file == nullptr)
 	  queue_and_load_all_dwo_tus (cu);
 
-	process_queue (per_objfile);
+	process_queue (per_objfile, domain);
       }
   }
 
@@ -1576,7 +1578,7 @@ dw2_do_instantiate_symtab (dwarf2_per_cu *per_cu,
 
 static struct compunit_symtab *
 dw2_instantiate_symtab (dwarf2_per_cu *per_cu, dwarf2_per_objfile *per_objfile,
-			bool skip_partial)
+			bool skip_partial, domain_search_flags domain = 0)
 {
   /* Expand the corresponding canonical outermost CU.  This will
      expand the desired CU as a side effect when following the
@@ -1587,7 +1589,7 @@ dw2_instantiate_symtab (dwarf2_per_cu *per_cu, dwarf2_per_objfile *per_objfile,
     {
       free_cached_comp_units freer (per_objfile);
       scoped_restore decrementer = increment_reading_symtab ();
-      dw2_do_instantiate_symtab (per_cu, per_objfile, skip_partial);
+      dw2_do_instantiate_symtab (per_cu, per_objfile, skip_partial, domain);
     }
 
   return per_objfile->get_compunit_symtab (per_cu);
@@ -1925,7 +1927,8 @@ dwarf2_base_index_functions::search_one
    auto_bool_vector &cus_to_skip,
    search_symtabs_file_matcher file_matcher,
    search_symtabs_expansion_listener listener,
-   search_symtabs_lang_matcher lang_matcher)
+   search_symtabs_lang_matcher lang_matcher,
+   domain_search_flags domain)
 {
   /* Already visited, or intentionally skipped.  */
   if (cus_to_skip.is_set (per_cu->index))
@@ -1941,7 +1944,7 @@ dwarf2_base_index_functions::search_one
     }
 
   compunit_symtab *symtab
-    = dw2_instantiate_symtab (per_cu, per_objfile, false);
+    = dw2_instantiate_symtab (per_cu, per_objfile, false, domain);
   gdb_assert (symtab != nullptr);
 
   if (listener != nullptr)
@@ -3886,7 +3889,7 @@ maybe_queue_comp_unit (dwarf2_cu *cu, dwarf2_cu *dependent_cu)
 /* Process the queue.  */
 
 static void
-process_queue (dwarf2_per_objfile *per_objfile)
+process_queue (dwarf2_per_objfile *per_objfile, domain_search_flags domain)
 {
   DWARF_READ_SCOPED_DEBUG_START_END
     ("Expanding one or more symtabs of objfile %s ...",
@@ -14057,7 +14060,7 @@ cooked_index_functions::search
 	  QUIT;
 
 	  if (!search_one (per_cu, per_objfile, cus_to_skip, file_matcher,
-			   listener, lang_matcher))
+			   listener, lang_matcher, domain))
 	    return false;
 	}
       return true;
@@ -14225,7 +14228,7 @@ cooked_index_functions::search
 	  bool check = entry->visit_defining_cus ([&] (dwarf2_per_cu *per_cu)
 	    {
 	      return search_one (per_cu, per_objfile, cus_to_skip,
-				 file_matcher, listener, nullptr);
+				 file_matcher, listener, nullptr, domain);
 	    });
 	  if (!check)
 	    return false;
diff --git a/gdb/dwarf2/read.h b/gdb/dwarf2/read.h
index 1150c3cfdca..f21a8bd87aa 100644
--- a/gdb/dwarf2/read.h
+++ b/gdb/dwarf2/read.h
@@ -1324,7 +1324,8 @@ struct dwarf2_base_index_functions : public quick_symbol_functions
 		   auto_bool_vector &cus_to_skip,
 		   search_symtabs_file_matcher file_matcher,
 		   search_symtabs_expansion_listener listener,
-		   search_symtabs_lang_matcher lang_matcher);
+		   search_symtabs_lang_matcher lang_matcher,
+		   domain_search_flags domain);
 };
 
 /* Return pointer to string at .debug_str offset STR_OFFSET.  */
-- 
2.51.0


  reply	other threads:[~2026-04-08 11:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-08 11:08 [RFC 0/2] [gdb/symtab] Don't expand type units for breakpoints Tom de Vries
2026-04-08 11:08 ` Tom de Vries [this message]
2026-04-08 11:08 ` [RFC 2/2] " Tom de Vries
2026-04-08 12:07   ` Tom de Vries

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=20260408110827.2249311-2-tdevries@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    /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