From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17913 invoked by alias); 5 May 2009 20:28:32 -0000 Received: (qmail 17902 invoked by uid 22791); 5 May 2009 20:28:32 -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; Tue, 05 May 2009 20:28:26 +0000 Received: (qmail 7973 invoked from network); 5 May 2009 20:28:24 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 5 May 2009 20:28:24 -0000 From: Pedro Alves To: gdb@sourceware.org Subject: Re: Missing new inferior notification for core files Date: Tue, 05 May 2009 20:28:00 -0000 User-Agent: KMail/1.9.10 Cc: "Marc Khouzam" References: <6D19CA8D71C89C43A057926FE0D4ADAA0762F13E@ecamlmw720.eamcs.ericsson.se> In-Reply-To: <6D19CA8D71C89C43A057926FE0D4ADAA0762F13E@ecamlmw720.eamcs.ericsson.se> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200905052129.01749.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-05/txt/msg00022.txt.bz2 A Tuesday 05 May 2009 21:15:23, Marc Khouzam wrote: > with HEAD of April 30th, I noticed that there is no notification > of a new inferior when connecting to a core file. This is on Linux. > > Note that the session below uses MI, but I also tried > plain CLI and used 'set print inferior-events 1'; > in that case still, no [New inferior ] event was shown. > So, inferior.c#add_inferior() does not seem to get called for a core > file. > > This causes a problem for DSF-GDB because it is not made > aware that a new inferior must be shown to the user. The observer_notify_new_inferior call should move from add_inferior to add_inferior_silent. corelow.c:core_open should probably also be made a bit smarter to only delay adding the new inferior until the pid of the core file is known. As is currently, on some targets, (e.g., solaris), the thread group's target pid will always start as `1' and immediately changes to the pid the process had when it crashed, if that pid is retrievable (although the gdb inferior id never changes) --- there's no defined MI notification for this id change. This last bit doesn't currently affect linux though. > Maybe this is a simple fix that can get in before branch time for 7.0? Patch and/or a bugzilla PR is welcome. -- Pedro Alves