From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12486 invoked by alias); 7 Dec 2010 18:54:07 -0000 Received: (qmail 12477 invoked by uid 22791); 7 Dec 2010 18:54:06 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 07 Dec 2010 18:54:00 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oB7Iru4x000387 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 7 Dec 2010 13:53:56 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oB7Irt9J020946; Tue, 7 Dec 2010 13:53:55 -0500 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id oB7Irsbv021587; Tue, 7 Dec 2010 13:53:55 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id 9C0303780EF; Tue, 7 Dec 2010 11:53:54 -0700 (MST) From: Tom Tromey To: Marc Khouzam Cc: "gdb-patches\@sourceware.org" Subject: Re: Assertion failure because of missing inferior References: Date: Tue, 07 Dec 2010 18:54:00 -0000 In-Reply-To: (Marc Khouzam's message of "Sat, 4 Dec 2010 14:10:54 -0500") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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/msg00072.txt.bz2 >>>>> "Marc" == Marc Khouzam writes: Marc> So, I was thinking that since a frontend shouldn't care which Marc> inferior is the current one, then '-remove-inferior' could change Marc> the current inferior to another inferior, before doing the Marc> removal. This is pretty much what the frontend would have to do Marc> anyway. Removing the very last inferior would not be allowed. Marc> The patch below does this. What do you think of this approach? This makes sense to me. Marc> +/* Callback used to find the first inferior other than the Marc> + current one. */ Marc> +static int Blank line between comment and function start. Marc> + if (inf == current_inferior ()) Marc> + { Marc> + struct inferior *new_inferior = iterate_over_inferiors (get_other_inferior, NULL); This line should be broken somewhere, probably before the '='. Marc> + if (new_inferior == NULL) Marc> + error ("Cannot remove last inferior"); Need _() around the text. Tom