From 8fa067afb27618ea0b54d76b8096faca0d7ab0e7 Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Wed, 22 Dec 2010 18:30:19 +0000 Subject: [PATCH] * inferior.c (remove_inferior_command): Don't remove an active inferior. * mi/mi-main.c (mi_cmd_remove_inferior): Ditto. --- gdb/ChangeLog | 5 +++++ gdb/inferior.c | 3 +++ gdb/mi/mi-main.c | 3 +++ 3 files changed, 11 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1f473ae11cf..bf9f525c636 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2010-12-22 Marc Khouzam + + * inferior.c (remove_inferior_command): Don't remove an active inferior. + * mi/mi-main.c (mi_cmd_remove_inferior): Ditto. + 2010-12-21 Tom Tromey * thread.c (print_thread_info): Make a ui-out table in CLI mode. diff --git a/gdb/inferior.c b/gdb/inferior.c index cad7e55d3c9..3493c16037b 100644 --- a/gdb/inferior.c +++ b/gdb/inferior.c @@ -754,6 +754,9 @@ remove_inferior_command (char *args, int from_tty) if (inf == current_inferior ()) error (_("Can not remove current symbol inferior.")); + + if (inf->pid != 0) + error (_("Can not remove an active inferior.")); delete_inferior_1 (inf, 1); } diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index b03a8b95238..6f66e89ecbc 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -1772,6 +1772,9 @@ mi_cmd_remove_inferior (char *command, char **argv, int argc) if (!inf) error ("the specified thread group does not exist"); + if (inf->pid != 0) + error ("can not remove an active inferior"); + if (inf == current_inferior ()) { struct thread_info *tp = 0; -- 2.30.2