This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/2] gdb: Remove C++ symbol aliases from completion list
- From: Tom Tromey <tom at tromey dot com>
- To: Andrew Burgess <andrew dot burgess at embecosm dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 24 Jan 2020 12:03:44 -0700
- Subject: Re: [PATCH 2/2] gdb: Remove C++ symbol aliases from completion list
- References: <cover.1577481992.git.andrew.burgess@embecosm.com> <ccdba1135695ee907774a458c5a1f04bfaceee30.1577481993.git.andrew.burgess@embecosm.com>
>>>>> "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