binutils-gdb/gdb/cli
Tom Tromey 3ea16160a6 Let commands free "name"
This adds a "name_allocated" field to cmd_list_element, so that
commands can own their "name" when necessary.  Then, this changes a
few spots in gdb that currently free the name by hand to instead use
this facility.

gdb/ChangeLog
2019-11-26  Tom Tromey  <tom@tromey.com>

	* python/py-function.c (fnpy_init): Update.
	* value.h (add_internal_function): Adjust declaration.
	* value.c (function_destroyer): Remove.
	(do_add_internal_function): Don't set destroyer or copy name.
	(add_internal_function): Take unique_xmalloc_ptr<char> for name.
	Set name_allocated.
	* python/py-cmd.c (cmdpy_destroyer): Don't free "name".
	(cmdpy_init): Set name_allocated.
	* cli/cli-decode.h (struct cmd_list_element) <name_allocated>: New
	member.
	(~cmd_list_element): Free "name" if needed.

Change-Id: Ie1435cea5bbf4bd92056125f112917c607cbb761
2019-11-26 14:20:30 -07:00
..
cli-cmds.c Replace SYMBOL_*_NAME accessors with member functions 2019-11-22 12:05:14 -06:00
cli-cmds.h Move declaration of max_user_call_depth to header 2019-10-12 14:31:26 -05:00
cli-decode.c [gdb] Fix more typos in comments (2) 2019-10-26 09:55:32 +02:00
cli-decode.h Let commands free "name" 2019-11-26 14:20:30 -07:00
cli-dump.c Remove some includes of readline.h 2019-11-06 07:29:43 -07:00
cli-interp.c Add debug redirect option 2019-05-17 14:21:47 +01:00
cli-interp.h Add debug redirect option 2019-05-17 14:21:47 +01:00
cli-logging.c Use styled_string for "show logging filename" 2019-10-01 15:12:41 -06:00
cli-option.c Make first and last lines of 'command help documentation' consistent. 2019-08-07 00:04:33 +02:00
cli-option.h Change boolean options to bool instead of int 2019-09-18 09:35:12 +09:00
cli-script.c [gdb] Only force INTERP_CONSOLE ui_out for breakpoint commands in MI mode 2019-11-21 11:02:27 +01:00
cli-script.h Don't include gdbarch.h from defs.h 2019-07-10 14:53:53 -06:00
cli-setshow.c Implement convenience functions to examine GDB settings. 2019-10-31 23:31:43 +01:00
cli-setshow.h Implement convenience functions to examine GDB settings. 2019-10-31 23:31:43 +01:00
cli-style.c [gdb] Fix set/show style metadata help text 2019-10-03 10:15:39 +02:00
cli-style.h Remove unused constructor declaration from cli_style_option 2019-11-10 09:48:42 -07:00
cli-utils.c gdb: Add new -n flag to some info commands 2019-08-27 16:21:42 +01:00
cli-utils.h [gdb] Fix more typos in comments (2) 2019-10-26 09:55:32 +02:00