diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2019-12-02 11:36:45 +0000 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2019-12-04 10:25:09 +0000 |
commit | f97a63c5aa5203994447b3cf8e48f184078f379b (patch) | |
tree | b13666c9c194b2609e3f0dd14b76997cbe5cb8c0 /gdb/symtab.h | |
parent | 293b38d60f15422cf7e3d3ba06fdbc5cc90aee67 (diff) | |
download | binutils-f97a63c5aa5203994447b3cf8e48f184078f379b.zip binutils-f97a63c5aa5203994447b3cf8e48f184078f379b.tar.gz binutils-f97a63c5aa5203994447b3cf8e48f184078f379b.tar.bz2 |
gdb: Split global symbol search into separate functions
In preparation for the next commit, this commit restructures the code
by splitting global_symbol_searcher::search into separate functions.
There should be no functional changes after this commit.
gdb/ChangeLog:
* symtab.c (symbol_search::compare_search_syms): Update header
comment.
(global_symbol_searcher::is_suitable_msymbol): New function.
(global_symbol_searcher::expand_symtabs): New function.
(global_symbol_searcher::add_matching_symbols): New function.
(global_symbol_searcher::add_matching_msymbols): New function.
(global_symbol_searcher::search): Move most of the content
into the new functions above, and call them as needed.
* symtab.h (global_symbol_searcher) <expand_symtabs>: New member
function.
(global_symbol_searcher) <add_matching_symbols>: New member
function.
(global_symbol_searcher) <add_matching_msymbols>: New member
function.
(global_symbol_searcher) <is_suitable_msymbol>: New member
function.
Change-Id: I06b26920f35c268f7a38d8203dc2c2813aa501c6
Diffstat (limited to 'gdb/symtab.h')
-rw-r--r-- | gdb/symtab.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gdb/symtab.h b/gdb/symtab.h index 4cfdf06..41abf1f 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -2124,6 +2124,29 @@ private: /* When this flag is false then minsyms that match M_SYMBOL_REGEXP will be included in the results, otherwise they are excluded. */ bool m_exclude_minsyms = false; + + /* Expand symtabs in OBJFILE that match PREG, are of type M_KIND. Return + true if any msymbols were seen that we should later consider adding to + the results list. */ + bool expand_symtabs (objfile *objfile, + const gdb::optional<compiled_regex> &preg) const; + + /* Add symbols from symtabs in OBJFILE that match PREG, and TREG, and are + of type M_KIND, to the results vector RESULTS. */ + void add_matching_symbols (objfile *objfile, + const gdb::optional<compiled_regex> &preg, + const gdb::optional<compiled_regex> &treg, + std::vector<symbol_search> *results) const; + + /* Add msymbols from OBJFILE that match PREG and M_KIND, to the + results vector RESULTS. */ + void add_matching_msymbols (objfile *objfile, + const gdb::optional<compiled_regex> &preg, + std::vector<symbol_search> *results) const; + + /* Return true if MSYMBOL is of type KIND. */ + static bool is_suitable_msymbol (const enum search_domain kind, + const minimal_symbol *msymbol); }; /* When searching for Fortran symbols within modules (functions/variables) |