This is the mail archive of the gdb-testers@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Change search_symbols to return std::vector


*** TEST RESULTS FOR COMMIT b9c04fb2681dd5706d2cafa5dcc6bdcd99016cf4 ***

Author: Tom Tromey <tom@tromey.com>
Branch: master
Commit: b9c04fb2681dd5706d2cafa5dcc6bdcd99016cf4

Change search_symbols to return std::vector

This changes search_symbols to return a std::vector, replacing the
previous linked list approach.  This allows the removal of some
cleanups, as well as the use of std::sort and std::unique, saving some
code and extra allocations in sort_search_symbols_remove_dups.

Regression tested by the buildbot.

gdb/ChangeLog
2017-10-08  Tom Tromey  <tom@tromey.com>

	* symtab.c (free_search_symbols, do_free_search_symbols_cleanup)
	(make_cleanup_free_search_symbols): Remove.
	(search_symbols): Return std::vector.
	(symbol_search::compare_search_syms): Now member of
	symbol_search.  Change arguments.
	(sort_search_symbols_remove_dups): Change arguments.  Rewrite.
	(symtab_symbol_info, rbreak_command): Update.
	* symtab.h (struct symbol_search) <next>: Remove.
	Add constructors.
	(symbol_search::operator<): New function.
	(symbol_search::operator==): New function.
	(search_symbols): Remove std::vector.
	(free_search_symbols, make_cleanup_free_search_symbols): Remove.
	(symbol_search::compare_search_syms): Declare.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]