[PATCH v2] gdb: make gdbpy_parse_command_name return a unique_xmalloc_ptr
Tom Tromey
tom@tromey.com
Thu Apr 1 17:56:23 GMT 2021
>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:
Simon> * python/python-internal.h (gdbpy_parse_command_name): Return
Simon> gdb::unique_xmalloc_ptr.
Simon> * python/py-cmd.c (gdbpy_parse_command_name): Likewise.
Simon> (cmdpy_init): Adjust.
Simon> * python/py-param.c (parmpy_init): Adjust.
Simon> (add_setshow_generic): Take gdb::unique_xmalloc_ptr, release it
Simon> when done.
Looks good.
Simon> + /* We (unfortunately) currently leak the command name. */
Simon> + cmd_name.release ();
I wonder if the issue here is that two copies would need to be made,
because add_setshow_* makes two commands.
Tom
More information about the Gdb-patches
mailing list