From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30683 invoked by alias); 16 Feb 2012 11:44:33 -0000 Received: (qmail 30602 invoked by uid 22791); 16 Feb 2012 11:44:32 -0000 X-SWARE-Spam-Status: No, hits=-6.9 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; Thu, 16 Feb 2012 11:44:16 +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.14.4/8.14.4) with ESMTP id q1GBiG8B026234 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 16 Feb 2012 06:44:16 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q1GBiEIH014403; Thu, 16 Feb 2012 06:44:15 -0500 Message-ID: <4F3CEC0E.4070603@redhat.com> Date: Thu, 16 Feb 2012 12:45:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20120131 Thunderbird/10.0 MIME-Version: 1.0 To: Tom Tromey CC: Jan Kratochvil , gdb-patches@sourceware.org Subject: Re: RFC: fix crash when inferior exits during "continue" References: <20120210144040.GA28038@host2.jankratochvil.net> <87ty2ya1ys.fsf@fleche.redhat.com> <20120214134417.GA6730@redhat.com> <4F3A6D51.5010904@redhat.com> <87d39fn9cq.fsf@fleche.redhat.com> In-Reply-To: <87d39fn9cq.fsf@fleche.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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: 2012-02/txt/msg00323.txt.bz2 On 02/15/2012 08:13 PM, Tom Tromey wrote: >>>>>> "Pedro" == Pedro Alves writes: > Pedro> and the current thread disappears while the user is typing, > Pedro> the command ends up being applied to a random thread, which is > Pedro> not good. > > This makes sense to me if the user entered a background command. > But why not switch if the last command was a foreground command? Yes, agreed. The lame reason is that the original non-stop work didn't care that much about the CLI (and there's no foreground in MI), and I have an old TODO item for that, that I never got around to. :-P > What do you think of the appended? > diff --git a/gdb/testsuite/gdb.base/inferior-died.c b/gdb/testsuite/gdb.base/inferior-died.c > new file mode 100644 > index 0000000..66227cf > --- /dev/null > +++ b/gdb/testsuite/gdb.base/inferior-died.c > +#include Doesn't look necessary. > static void > @@ -1095,6 +1096,8 @@ do_restore_current_thread_cleanup (void *arg) > set_current_inferior (find_inferior_id (old->inf_id)); > } > > + current_inferior ()->removable = old->was_removable; This is unnecessary. restore_current_thread_cleanup_dtor is called when either you run or discard the cleanup. Otherwise looks good. Thanks. -- Pedro Alves