[v2,08/11] gdb: update comments of global_symbol_searcher::expand_symtabs

Message ID 20261001020952.698419-9-simon.marchi@polymtl.ca
State New
Headers
Series None |

Commit Message

Simon Marchi Oct. 1, 2026, 2:09 a.m. UTC
  From: Simon Marchi <simon.marchi@efficios.com>

Update the doc comment of expand_symtabs to describe more accurately what
the return value means.  It is true when a matching function msymbol for
which no debug info exists is found.

Update a comment inside expand_symtabs:

 - remove "unconditionally", because it's not quite true
 - use "for variables" instead of "for SEARCH_VAR_DOMAIN".

Change-Id: I7c26c065b31575066ed2398563cdc1dac8869f8b
---
 gdb/symtab.c | 4 ++--
 gdb/symtab.h | 7 ++++---
 2 files changed, 6 insertions(+), 5 deletions(-)
  

Comments

Andrew Burgess Oct. 1, 2026, 3:13 p.m. UTC | #1
simon.marchi@polymtl.ca writes:

> From: Simon Marchi <simon.marchi@efficios.com>
>
> Update the doc comment of expand_symtabs to describe more accurately what
> the return value means.  It is true when a matching function msymbol for
> which no debug info exists is found.
>
> Update a comment inside expand_symtabs:
>
>  - remove "unconditionally", because it's not quite true
>  - use "for variables" instead of "for SEARCH_VAR_DOMAIN".

LGTM.

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

Thanks,
Andrew
  

Patch

diff --git a/gdb/symtab.c b/gdb/symtab.c
index a436e9011626..fc0ff22448ee 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -4779,8 +4779,8 @@  global_symbol_searcher::expand_symtabs
      objfiles.
 
      Variables are not handled here, and looking them up does not expand any
-     symtab.  When no file names were given the caller unconditionally rescans
-     the minimal symbols for SEARCH_VAR_DOMAIN.  */
+     symtab.  When no file names were given the caller rescans the minimal
+     symbols for variables.  */
   if (m_filenames.empty ()
       && m_kind == symbol_search_kind::FUNCTION)
     {
diff --git a/gdb/symtab.h b/gdb/symtab.h
index 7afefaf3a322..28b9d7b4c78d 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -2687,9 +2687,10 @@  class global_symbol_searcher
   /* Compile M_SYMBOL_TYPE_REGEXP, if set.  */
   std::optional<compiled_regex> compile_type_regex () const;
 
-  /* Expand symtabs in OBJFILE that match NAME_REGEX, are of type M_KIND.
-     Return true if any msymbols were seen that we should later consider
-     adding to the results list.  */
+  /* Expand symtabs in OBJFILE that match NAME_REGEX and are of type M_KIND.
+     Return true if a matching function msymbol without debug info was
+     seen, meaning that msymbols should later be considered for the results
+     list.  */
   bool expand_symtabs (objfile *objfile,
 		       const std::optional<compiled_regex> &name_regex) const;