From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32637 invoked by alias); 25 Mar 2009 21:44:56 -0000 Received: (qmail 32208 invoked by uid 22791); 25 Mar 2009 21:44:55 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 25 Mar 2009 21:44:48 +0000 Received: (qmail 25748 invoked from network); 25 Mar 2009 21:44:47 -0000 Received: from unknown (HELO orlando) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 25 Mar 2009 21:44:47 -0000 From: Pedro Alves To: tromey@redhat.com Subject: Re: Process exit in multi-process, and gdb's selected thread. Date: Wed, 25 Mar 2009 21:46:00 -0000 User-Agent: KMail/1.9.10 Cc: gdb-patches@sourceware.org, Marc Khouzam References: <200902170058.33653.pedro@codesourcery.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200903252144.43357.pedro@codesourcery.com> 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: 2009-03/txt/msg00566.txt.bz2 On Tuesday 24 February 2009 19:56:17, Tom Tromey wrote: > >>>>> "Pedro" == Pedro Alves writes: > > I meant to reply to this earlier... > Makes two of us now. :-) > Pedro> What would you think if GDB could get into this state, > Pedro> after a process exit? : > Pedro> (gdb) info threads > Pedro> 2 Thread 31176.31176 0x00007f0706154796 in ?? () > [...] > > I think it is a reasonable outcome given the model. If users find it > too confusing, we can try to add some extra output somewhere -- for > instance, when gdb says "The program is not being run.", it could > check for multiple inferiors and print something about how to switch > to another inferior. > > I tend to doubt that we will need to do this, though, because I think > this is the most logical way for multi-inferior debugging to work. > > Pedro> In the past, I had solved this by spreading around some hacks > Pedro> that tried to detect the current inferior exiting, and switching > Pedro> to any other random live thread, but, that turned out to be: first, > Pedro> surprising in non-stop mode, in the case mentioned above; and > Pedro> second, surprisingly difficult to get right. I think this usually > Pedro> means that GDB shouldn't try to be smart (well, or I shouldn't). > > I agree. > > Pedro> What do you think of all this, am I making sense? > > Yeah, I think your choices here make sense, particularly not having > gdb switch contexts behind the user's back, and that what you wrote up > is the logical outcome of this decision. Great then. Since there were no objections to this, and Marc has been using this patch against his multi-process aware system for a while now without problems, I checked it in. -- Pedro Alves