From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9983 invoked by alias); 20 Nov 2008 15:19:12 -0000 Received: (qmail 9915 invoked by uid 22791); 20 Nov 2008 15:19:11 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 20 Nov 2008 15:18:36 +0000 Received: (qmail 15487 invoked from network); 20 Nov 2008 15:18:34 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 20 Nov 2008 15:18:34 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: GDB loses running state of inferior Date: Fri, 21 Nov 2008 01:38:00 -0000 User-Agent: KMail/1.9.10 Cc: Andreas Schwab References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200811201518.44548.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: 2008-11/txt/msg00561.txt.bz2 On Thursday 20 November 2008 14:33:14, Andreas Schwab wrote: > When an error occurs during startup of the child the running state of > the child is lost and gdb is refusing to continue it: > (gdb) c > Continuing. > Cannot execute this command while the selected thread is running. > > 2008-11-20 Andreas Schwab > > * fork-child.c (startup_inferior): Don't lose running state of > inferior. Thanks. Could you hold on to this a bit? This will make it so that MI outputs more *running, *stopped notifications when going through the shell on startup. This a problem that can happen in several other places, and I've been solving them with a cleanup and a new function that sets the threads' running state (tp->state_) from the tp->executing_ property. I'll have to clean it up a bit to submit, then we can fix this too. > > --- gdb/fork-child.c.~1.47.~ 2008-11-10 11:25:09.000000000 +0100 > +++ gdb/fork-child.c 2008-11-20 14:27:26.000000000 +0100 > @@ -494,6 +494,9 @@ startup_inferior (int ntraps) > resume_ptid = pid_to_ptid (-1); > else > resume_ptid = event_ptid; > + /* Update running state now, in case an error occurs during > + resume. */ > + set_running (resume_ptid, 0); > > if (resume_signal != TARGET_SIGNAL_TRAP) > { -- Pedro Alves