From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2438 invoked by alias); 20 Nov 2008 14:33:57 -0000 Received: (qmail 2394 invoked by uid 22791); 20 Nov 2008 14:33:57 -0000 X-Spam-Check-By: sourceware.org Received: from ns1.suse.de (HELO mx1.suse.de) (195.135.220.2) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 20 Nov 2008 14:33:17 +0000 Received: from Relay2.suse.de (relay-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 2EED942993 for ; Thu, 20 Nov 2008 15:33:15 +0100 (CET) From: Andreas Schwab To: gdb-patches@sourceware.org Subject: GDB loses running state of inferior X-Yow: It's strange, but I'm only TRULY ALIVE when I'm covered in POLKA DOTS and TACO SAUCE... Date: Fri, 21 Nov 2008 00:17:00 -0000 Message-ID: User-Agent: Gnus/5.110009 (No Gnus v0.9) Emacs/22.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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/msg00556.txt.bz2 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) b *0 Breakpoint 1 at 0x0 (gdb) r Starting program: /bin/cat Warning: Cannot insert breakpoint 1. Error accessing memory address 0x0: Input/output error. (gdb) c Continuing. Cannot execute this command while the selected thread is running. Andreas. 2008-11-20 Andreas Schwab * fork-child.c (startup_inferior): Don't lose running state of inferior. --- 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) { -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."