diff options
author | Tom Tromey <tom@tromey.com> | 2018-03-31 10:32:00 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2018-04-05 07:39:33 -0600 |
commit | 41c1efc614472cdc74397e734f5a66018362a80a (patch) | |
tree | 97d77b6582dcdfbec4f3436251c058c9243411cf /gdb/minsyms.h | |
parent | 65bd20451fc7e5aea1f0283433f95fb2fe60771d (diff) | |
download | gdb-41c1efc614472cdc74397e734f5a66018362a80a.zip gdb-41c1efc614472cdc74397e734f5a66018362a80a.tar.gz gdb-41c1efc614472cdc74397e734f5a66018362a80a.tar.bz2 |
Remove some cleanups from search_minsyms_for_name
This changes struct collect_minsyms to use a std::vector, which
enables the removal of a cleanup from search_minsyms_for_name. This
also changes iterate_over_minimal_symbols to take a
gdb::function_view, which makes a function in linespec.c more
type-safe.
ChangeLog
2018-04-05 Tom Tromey <tom@tromey.com>
* minsyms.h (iterate_over_minimal_symbols): Update.
* minsyms.c (iterate_over_minimal_symbols): Take a
gdb::function_view.
* linespec.c (struct collect_minsyms): Remove.
(compare_msyms): Now a std::sort comparator.
(add_minsym): Add parameters.
(search_minsyms_for_name): Update. Use std::vector.
Diffstat (limited to 'gdb/minsyms.h')
-rw-r--r-- | gdb/minsyms.h | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/gdb/minsyms.h b/gdb/minsyms.h index 11a2020..a2b7ddd 100644 --- a/gdb/minsyms.h +++ b/gdb/minsyms.h @@ -265,14 +265,11 @@ struct bound_minimal_symbol lookup_minimal_symbol_by_pc (CORE_ADDR); are considered. The caller is responsible for canonicalizing NAME, should that need to be done. - For each matching symbol, CALLBACK is called with the symbol and - USER_DATA as arguments. */ - -void iterate_over_minimal_symbols (struct objfile *objf, - const lookup_name_info &name, - void (*callback) (struct minimal_symbol *, - void *), - void *user_data); + For each matching symbol, CALLBACK is called with the symbol. */ + +void iterate_over_minimal_symbols + (struct objfile *objf, const lookup_name_info &name, + gdb::function_view<void (struct minimal_symbol *)> callback); /* Compute the upper bound of MINSYM. The upper bound is the last address thought to be part of the symbol. If the symbol has a |