[5/9] gdb: make global_symbol_searcher::is_suitable_msymbol non-static
Checks
| Context |
Check |
Description |
| linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 |
success
|
Build passed
|
| linaro-tcwg-bot/tcwg_gdb_build--master-arm |
success
|
Build passed
|
Commit Message
is_suitable_msymbol is a static method taking the search kind as a
parameter, but all callers pass m_kind. Make it a const non-static
method that uses m_kind directly.
Change-Id: I803e7cddbb317a8af35a82ea9e528c64f6326f31
---
gdb/symtab.c | 10 +++++-----
gdb/symtab.h | 5 ++---
2 files changed, 7 insertions(+), 8 deletions(-)
Comments
This looks good to me.
Reviewed-By: Rohr, Stephan <stephan.rohr@intel.com>
> -----Original Message-----
> From: Simon Marchi <simon.marchi@efficios.com>
> Sent: Tuesday, 29 September 2026 21:39
> To: gdb-patches@sourceware.org
> Cc: Simon Marchi <simon.marchi@efficios.com>
> Subject: [PATCH 5/9] gdb: make
> global_symbol_searcher::is_suitable_msymbol non-static
>
> is_suitable_msymbol is a static method taking the search kind as a
> parameter, but all callers pass m_kind. Make it a const non-static
> method that uses m_kind directly.
>
> Change-Id: I803e7cddbb317a8af35a82ea9e528c64f6326f31
> ---
> gdb/symtab.c | 10 +++++-----
> gdb/symtab.h | 5 ++---
> 2 files changed, 7 insertions(+), 8 deletions(-)
>
> diff --git a/gdb/symtab.c b/gdb/symtab.c
> index 2bb1cbf1b9ad..9ce6911666c6 100644
> --- a/gdb/symtab.c
> +++ b/gdb/symtab.c
> @@ -4722,7 +4722,7 @@ to_search_flags (symbol_search_kind kind)
>
> bool
> global_symbol_searcher::is_suitable_msymbol
> - (symbol_search_kind kind, const minimal_symbol *msymbol)
> + (const minimal_symbol *msymbol) const
> {
> switch (msymbol->type ())
> {
> @@ -4730,12 +4730,12 @@ global_symbol_searcher::is_suitable_msymbol
> case mst_bss:
> case mst_file_data:
> case mst_file_bss:
> - return kind == symbol_search_kind::VARIABLE;
> + return m_kind == symbol_search_kind::VARIABLE;
> case mst_text:
> case mst_file_text:
> case mst_solib_trampoline:
> case mst_text_gnu_ifunc:
> - return kind == symbol_search_kind::FUNCTION;
> + return m_kind == symbol_search_kind::FUNCTION;
> default:
> return false;
> }
> @@ -4793,7 +4793,7 @@ global_symbol_searcher::expand_symtabs
> if (msymbol->created_by_gdb)
> continue;
>
> - if (is_suitable_msymbol (m_kind, msymbol))
> + if (is_suitable_msymbol (msymbol))
> {
> if (!name_regex.has_value ()
> || name_regex->exec (msymbol->natural_name (), 0,
> @@ -4911,7 +4911,7 @@
> global_symbol_searcher::add_matching_msymbols
> if (msymbol->created_by_gdb)
> continue;
>
> - if (is_suitable_msymbol (m_kind, msymbol))
> + if (is_suitable_msymbol (msymbol))
> {
> if (!name_regex.has_value ()
> || name_regex->exec (msymbol->natural_name (), 0,
> diff --git a/gdb/symtab.h b/gdb/symtab.h
> index 1675b126b19d..50d7000681df 100644
> --- a/gdb/symtab.h
> +++ b/gdb/symtab.h
> @@ -2703,9 +2703,8 @@ class global_symbol_searcher
> const std::optional<compiled_regex>
> &name_regex,
> std::vector<symbol_search> *results) const;
>
> - /* Return true if MSYMBOL is of type KIND. */
> - static bool is_suitable_msymbol (symbol_search_kind kind,
> - const minimal_symbol *msymbol);
> + /* Return true if MSYMBOL is of type M_KIND. */
> + bool is_suitable_msymbol (const minimal_symbol *msymbol) const;
> };
>
> /* When searching for Fortran symbols within modules (functions/variables)
> --
> 2.55.0
________________________________________
Intel Deutschland GmbH
Registered Address: Dornacher Strasse 1, 85622 Feldkirchen, Germany
Tel: +49 (89) 99143-0
www.intel.de
Managing Directors: Candice Moore, Jeffrey Schneiderman, Ramachandran Sitaraman
Chairperson of the Supervisory Board: Sonja Pierer
Registered Seat: Munich Commercial Register B: Amtsgericht Munich HRB 186928
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
@@ -4722,7 +4722,7 @@ to_search_flags (symbol_search_kind kind)
bool
global_symbol_searcher::is_suitable_msymbol
- (symbol_search_kind kind, const minimal_symbol *msymbol)
+ (const minimal_symbol *msymbol) const
{
switch (msymbol->type ())
{
@@ -4730,12 +4730,12 @@ global_symbol_searcher::is_suitable_msymbol
case mst_bss:
case mst_file_data:
case mst_file_bss:
- return kind == symbol_search_kind::VARIABLE;
+ return m_kind == symbol_search_kind::VARIABLE;
case mst_text:
case mst_file_text:
case mst_solib_trampoline:
case mst_text_gnu_ifunc:
- return kind == symbol_search_kind::FUNCTION;
+ return m_kind == symbol_search_kind::FUNCTION;
default:
return false;
}
@@ -4793,7 +4793,7 @@ global_symbol_searcher::expand_symtabs
if (msymbol->created_by_gdb)
continue;
- if (is_suitable_msymbol (m_kind, msymbol))
+ if (is_suitable_msymbol (msymbol))
{
if (!name_regex.has_value ()
|| name_regex->exec (msymbol->natural_name (), 0,
@@ -4911,7 +4911,7 @@ global_symbol_searcher::add_matching_msymbols
if (msymbol->created_by_gdb)
continue;
- if (is_suitable_msymbol (m_kind, msymbol))
+ if (is_suitable_msymbol (msymbol))
{
if (!name_regex.has_value ()
|| name_regex->exec (msymbol->natural_name (), 0,
@@ -2703,9 +2703,8 @@ class global_symbol_searcher
const std::optional<compiled_regex> &name_regex,
std::vector<symbol_search> *results) const;
- /* Return true if MSYMBOL is of type KIND. */
- static bool is_suitable_msymbol (symbol_search_kind kind,
- const minimal_symbol *msymbol);
+ /* Return true if MSYMBOL is of type M_KIND. */
+ bool is_suitable_msymbol (const minimal_symbol *msymbol) const;
};
/* When searching for Fortran symbols within modules (functions/variables)