[v2,07/11] gdb: make global_symbol_searcher::is_suitable_msymbol non-static
Commit Message
From: Simon Marchi <simon.marchi@efficios.com>
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
Reviewed-By: Rohr, Stephan <stephan.rohr@intel.com>
---
gdb/symtab.c | 10 +++++-----
gdb/symtab.h | 5 ++---
2 files changed, 7 insertions(+), 8 deletions(-)
Comments
simon.marchi@polymtl.ca writes:
> From: Simon Marchi <simon.marchi@efficios.com>
>
> 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.
LGTM
Approved-By: Andrew Burgess <aburgess@redhat.com>
Thanks,
Andrew
@@ -4720,7 +4720,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 ())
{
@@ -4728,12 +4728,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;
}
@@ -4791,7 +4791,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,
@@ -4909,7 +4909,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,
@@ -2715,9 +2715,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)