This is the mail archive of the gdb-patches@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]

Re: [PATCH 2/2] gdb: Remove C++ symbol aliases from completion list


>>>>> "Andrew" == Andrew Burgess <andrew.burgess@embecosm.com> writes:

Andrew> This commit builds on the previous commit which reworked the
Andrew> completion_tracker class.  It is now trivial to add a
Andrew> remove_completion member function

Wasn't this just as easy with the htab_t implementation?

I suppose I'm fine with either.

Andrew> gdb/ChangeLog:

Andrew> 	* completer.c (completion_tracker::remove_completion): Define new
Andrew> 	function.
Andrew> 	* completer.h (completion_tracker::remove_completion): Declare new
Andrew> 	function.
Andrew> 	* symtab.c (completion_list_add_symbol): Remove aliasing msymbols
Andrew> 	when adding a C++ function symbol.

This seems like a good idea to me.

Andrew> +/* See completer.h.  */
Andrew> +
Andrew> +void
Andrew> +completion_tracker::remove_completion (const char *name)
Andrew> +{
Andrew> +  m_entries_hash.erase (name);

IIUC, the hash owns the pointers, so this would leak some memory.

Tom


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