From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12463 invoked by alias); 22 Dec 2010 18:32:17 -0000 Received: (qmail 12427 invoked by uid 22791); 22 Dec 2010 18:32:14 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from imr3.ericy.com (HELO imr3.ericy.com) (198.24.6.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 22 Dec 2010 18:32:05 +0000 Received: from eusaamw0712.eamcs.ericsson.se ([147.117.20.181]) by imr3.ericy.com (8.13.8/8.13.8) with ESMTP id oBMIVr8K001555 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Wed, 22 Dec 2010 12:31:53 -0600 Received: from EUSAACMS0703.eamcs.ericsson.se ([169.254.1.66]) by eusaamw0712.eamcs.ericsson.se ([147.117.20.181]) with mapi; Wed, 22 Dec 2010 13:31:52 -0500 From: Marc Khouzam To: "'Pedro Alves'" , "'gdb-patches@sourceware.org'" CC: "'Tom Tromey'" Date: Wed, 22 Dec 2010 22:02:00 -0000 Subject: RE: segfault: what should happen when I remove an inferior that is running? Message-ID: References: <201012221210.30198.pedro@codesourcery.com> <201012221817.17271.pedro@codesourcery.com> In-Reply-To: <201012221817.17271.pedro@codesourcery.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-12/txt/msg00411.txt.bz2 > -----Original Message----- > From: Pedro Alves [mailto:pedro@codesourcery.com]=20 > Sent: Wednesday, December 22, 2010 1:17 PM > To: gdb-patches@sourceware.org > Cc: Marc Khouzam; 'Tom Tromey' > Subject: Re: segfault: what should happen when I remove an=20 > inferior that is running? >=20 > On Wednesday 22 December 2010 18:11:45, Marc Khouzam wrote: > > > > If it is ok, please let me know if you want it only in HEAD or > > > > also in 7_2. > > >=20 > > > "running inferior" will sound a bit odd for cores, but, > > > since I don't have a better suggestion that wouldn't involve > > > more coding, this is okay with me (HEAD and 7_2). > >=20 > > Would "Can not remove a an active inferior." be better? >=20 > Fine with me. I committed the following to 7_2 and HEAD.=20 Thanks Marc 2010-12-22 Marc Khouzam * inferior.c (remove_inferior_command): Don't remove an active infer= ior. * mi/mi-main.c (mi_cmd_remove_inferior): Ditto. ### Eclipse Workspace Patch 1.0 #P src Index: gdb/inferior.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/inferior.c,v retrieving revision 1.18 diff -u -r1.18 inferior.c --- gdb/inferior.c 14 May 2010 21:25:51 -0000 1.18 +++ gdb/inferior.c 22 Dec 2010 18:18:55 -0000 @@ -741,6 +741,9 @@ =20 if (inf =3D=3D current_inferior ()) error (_("Can not remove current symbol inferior.")); +=20=20=20=20 + if (inf->pid !=3D 0) + error (_("Can not remove an active inferior.")); =20 delete_inferior_1 (inf, 1); } Index: gdb/mi/mi-main.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/mi/mi-main.c,v retrieving revision 1.178.2.5 diff -u -r1.178.2.5 mi-main.c --- gdb/mi/mi-main.c 18 Dec 2010 01:56:07 -0000 1.178.2.5 +++ gdb/mi/mi-main.c 22 Dec 2010 18:18:55 -0000 @@ -1651,6 +1651,9 @@ if (!inf) error ("the specified thread group does not exist"); =20 + if (inf->pid !=3D 0) + error ("can not remove an active inferior"); + if (inf =3D=3D current_inferior ()) { struct thread_info *tp =3D 0;