From owner-freebsd-hackers Wed Jan 3 15:34:41 2001 From owner-freebsd-hackers@FreeBSD.ORG Wed Jan 3 15:34:38 2001 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from beastie.localdomain (c215563-a.stcla1.sfba.home.com [24.19.158.41]) by hub.freebsd.org (Postfix) with ESMTP id 7E31A37B400 for ; Wed, 3 Jan 2001 15:34:38 -0800 (PST) Received: (from brian@localhost) by beastie.localdomain (8.9.3/8.9.3) id PAA01674; Wed, 3 Jan 2001 15:37:14 -0800 (PST) (envelope-from brian) Date: Wed, 3 Jan 2001 15:37:14 -0800 From: "Brian O'Shea" To: Thierry Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: gdb question Message-ID: <20010103153714.B637@beastie.localdomain> Reply-To: boshea@ricochet.net Mail-Followup-To: Thierry , freebsd-hackers@FreeBSD.ORG References: <01010312453500.00430@FreeBSD.eicon.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <01010312453500.00430@FreeBSD.eicon.com>; from tjmsdn@ifrance.com on Wed, Jan 03, 2001 at 12:37:21PM -0500 Sender: brian@beastie.localdomain Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, Jan 03, 2001 at 12:37:21PM -0500, Thierry wrote: > > Hi, > > I use the "fork" function to call another function "foo( )" > > In gdb, I would like to put a breakpoint in this function "foo( )", When I > execute, the function "foo( )" is stopped, but gdb doesn't give me the hand. > > How I can put a breakpoint in a function call by a "fork" system ? Since foo() is called in another process (the child process of the one that called fork()), you will have to somehow attach to the child process after the fork() call. I don't know if gdb has support for doing this automatically. I don't think it does, but you might be able to attach to it in another gdb session by having the child process sleep for a while shortly after the fork() call to give you enough time to look up the PID of the child process. > > Thanks in Advance. > Thierry. > -- Brian O'Shea boshea@ricochet.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message