From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23123 invoked by alias); 24 Feb 2009 19:58:42 -0000 Received: (qmail 23110 invoked by uid 22791); 24 Feb 2009 19:58:41 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 24 Feb 2009 19:58:32 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n1OJuK2h026994; Tue, 24 Feb 2009 14:56:20 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n1OJuKNN032336; Tue, 24 Feb 2009 14:56:20 -0500 Received: from opsy.redhat.com (vpn-12-148.rdu.redhat.com [10.11.12.148]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n1OJuJAK012024; Tue, 24 Feb 2009 14:56:19 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id A5698508295; Tue, 24 Feb 2009 12:56:17 -0700 (MST) To: Pedro Alves Cc: gdb-patches@sourceware.org, Marc Khouzam Subject: Re: Process exit in multi-process, and gdb's selected thread. References: <200902170058.33653.pedro@codesourcery.com> From: Tom Tromey Reply-To: tromey@redhat.com Date: Tue, 24 Feb 2009 20:23:00 -0000 In-Reply-To: <200902170058.33653.pedro@codesourcery.com> (Pedro Alves's message of "Tue\, 17 Feb 2009 00\:58\:33 +0000") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.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: 2009-02/txt/msg00473.txt.bz2 >>>>> "Pedro" == Pedro Alves writes: I meant to reply to this earlier... 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. Tom