From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14611 invoked by alias); 8 Jun 2009 14:39:32 -0000 Received: (qmail 14600 invoked by uid 22791); 8 Jun 2009 14:39:31 -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; Mon, 08 Jun 2009 14:39:22 +0000 Received: (qmail 32372 invoked from network); 8 Jun 2009 14:39:20 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 8 Jun 2009 14:39:20 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: Refuse following the vfork parent if not letting the child run. Date: Mon, 08 Jun 2009 14:39:00 -0000 User-Agent: KMail/1.9.10 Cc: Daniel Jacobowitz References: <200906081431.38913.pedro@codesourcery.com> <20090608143111.GA14456@caradoc.them.org> In-Reply-To: <20090608143111.GA14456@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906081540.24300.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-06/txt/msg00176.txt.bz2 On Monday 08 June 2009 15:31:11, Daniel Jacobowitz wrote: > On Mon, Jun 08, 2009 at 02:31:38PM +0100, Pedro Alves wrote: > > A patched GDB shows this: > > > > (gdb) set detach-on-fork off > > (gdb) start > > Temporary breakpoint 1 at 0x4005c0: file ../../../src/gdb/testsuite/gdb.base/foll-vfork.c, line 12. > > Starting program: /home/pedro/gdb/sspaces/build/gdb/testsuite/gdb.base/foll-vfork > > > > Temporary breakpoint 1, main () at ../../../src/gdb/testsuite/gdb.base/foll-vfork.c:12 > > 12 pid = vfork (); > > (gdb) n > > warning: Can not debug the parent of a vfork in the foreground if not letting > > the child run until it execs or exits, as it would deadlock the terminal. > > 0x00007ffff789aee4 in vfork () from /lib/libc.so.6 > > (gdb) > > None of your explanation, the patch, or the example output tells me > what GDB is doing instead :-) I suck at output messages and docs. It's sort of in the patch :-). Returning 1 from follow_fork makes the caller not carry on with resuming. > IOW, I think a "warning" about the > situation here is strange; something has happened, and we don't say > what. > Is this actually a fork-following error, and we've stopped execution? I guess you could call it an error. We can't satisfy the users request, so we kind of stopped execution --- in reality, we're refusing to continue execution, as the inferior is stopped already. -- Pedro Alves