binutils-gdb/gdb/mi
Simon Marchi 7a41607e01 Delete program spaces directly when removing inferiors
When deleting an inferior, delete the associated program space as well
if it becomes unused. This replaces the "pruning" approach, with which
you could forget to call prune_program_spaces (as seen, with the
-remove-inferior command, see [1]).

This allows to remove the prune_program_spaces function. At the same
time, I was able to clean up the delete_inferior* family:

 - delete_inferior is unused
 - delete_inferior_silent is only used in monitor_close, but is replaced
   with discard_all_inferiors [2], so it becomes unused
 - All remaining calls to delete_inferior_1 are with silent=1, so the
   parameter is removed
 - delete_inferior_1 is renamed to delete_inferior

I renamed pspace_empty_p to program_space_empty_p. I prefer if the
"exported" functions have a more explicit and standard name.

Tested on Ubuntu 14.10.

[1] https://sourceware.org/ml/gdb-patches/2014-09/msg00717.html
[2] See https://sourceware.org/ml/gdb-patches/2015-07/msg00228.html and
    follow-ups for details.

gdb/Changelog:

	* inferior.c (delete_inferior_1): Rename to ...
	(delete_inferior): ..., remove 'silent' parameter, delete
	program space when unused and remove call to prune_program_spaces.
	Remove the old, unused, delete_inferior.
	(delete_inferior_silent): Remove.
	(prune_inferiors): Change call from delete_inferior_1 to
	delete_inferior and remove 'silent' parameter. Remove call to
	prune_program_spaces.
	(remove_inferior_command): Idem.
	* inferior.h (delete_inferior_1): Rename to...
	(delete_inferior): ..., remove 'silent' parameter and remove the
	original delete_inferior.
	(delete_inferior_silent): Remove.
	* mi/mi-main.c (mi_cmd_remove_inferior): Change call from
	delete_inferior_1 to delete_inferior and remove 'silent'
	parameter.
	* progspace.c (prune_program_spaces): Remove.
	(pspace_empty_p): Rename to...
	(program_space_empty_p): ... and make non-static.
	(delete_program_space): New.
	* progspace.h (prune_program_spaces): Remove declaration.
	(program_space_empty_p): New declaration.
	(delete_program_space): New declaration.
	* monitor.c (monitor_close): Replace call to
	delete_thread_silent and delete_inferior_silent with
	discard_all_inferiors.
2015-07-08 15:41:01 -04:00
..
ChangeLog-1999-2003
mi-cmd-break.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-cmd-break.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-cmd-catch.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-cmd-disas.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-cmd-env.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-cmd-file.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-cmd-info.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-cmd-stack.c Split TRY_CATCH into TRY + CATCH 2015-03-07 15:14:14 +00:00
mi-cmd-target.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-cmd-var.c C++ keyword cleanliness, mostly auto-generated 2015-02-27 16:33:07 +00:00
mi-cmds.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-cmds.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-common.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-common.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-console.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-console.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-getopt.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-getopt.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-interp.c Split TRY_CATCH into TRY + CATCH 2015-03-07 15:14:14 +00:00
mi-main.c Delete program spaces directly when removing inferiors 2015-07-08 15:41:01 -04:00
mi-main.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-out.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-out.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-parse.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-parse.h Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00
mi-symbol-cmds.c Update year range in copyright notice of all files owned by the GDB project. 2015-01-01 13:32:14 +04:00