aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi/mi-main.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2014-09-29 16:33:10 -0400
committerSimon Marchi <simon.marchi@ericsson.com>2015-07-08 11:26:32 -0400
commit0560c645c02eba2828a053039dcfdf676cdd1d00 (patch)
treec653662e7db277cadc193512e25d2c0341ebed12 /gdb/mi/mi-main.c
parent084641963dba63283bf2eca227f4f77c2598b172 (diff)
downloadgdb-0560c645c02eba2828a053039dcfdf676cdd1d00.zip
gdb-0560c645c02eba2828a053039dcfdf676cdd1d00.tar.gz
gdb-0560c645c02eba2828a053039dcfdf676cdd1d00.tar.bz2
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_silent and delete_inferior were unused, which allowed renaming delete_inferior_1 to delete_inferior. Also, since all calls to it were with silent=1, I removed that parameter completely. 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. This obsoletes my previous patch "Add call to prune_program_spaces in mi_cmd_remove_inferior" [1]. [1] https://sourceware.org/ml/gdb-patches/2014-09/msg00717.html 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.
Diffstat (limited to 'gdb/mi/mi-main.c')
-rw-r--r--gdb/mi/mi-main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index ddfc9d9..66bcd88 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -1964,7 +1964,7 @@ mi_cmd_remove_inferior (char *command, char **argv, int argc)
set_current_program_space (new_inferior->pspace);
}
- delete_inferior_1 (inf, 1 /* silent */);
+ delete_inferior (inf);
}