From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7084 invoked by alias); 31 Mar 2005 10:44:12 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 7034 invoked from network); 31 Mar 2005 10:44:03 -0000 Received: from unknown (HELO mail.netspace.net.au) (203.10.110.71) by sourceware.org with SMTP; 31 Mar 2005 10:44:03 -0000 Received: from [192.168.1.11] (220-253-3-149.VIC.netspace.net.au [220.253.3.149]) by mail.netspace.net.au (Postfix) with ESMTP id 3D9FB42C2A for ; Thu, 31 Mar 2005 20:44:01 +1000 (EST) Message-ID: <424BD532.50606@netspace.net.au> Date: Thu, 31 Mar 2005 10:44:00 -0000 From: Russell Shaw User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20050105 Debian/1.7.5-1 MIME-Version: 1.0 Cc: GDB Subject: Re: fork() References: <424B92B9.8020300@netspace.net.au> <424BC412.5070802@netspace.net.au> <424BC58A.3040603@codito.com> In-Reply-To: <424BC58A.3040603@codito.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2005-03/txt/msg00315.txt.bz2 Ramana Radhakrishnan wrote: > Russell Shaw wrote: > >> Siddharth Choudhary Kode wrote: >> >>> Check the info doc, sec. 4.10. This is only supported on GNU/Linux >>> 2.5.60+ and HP-UX 11.x+. If your platform doesn't support it, the >>> best option is to insert a sleep() statement at the beginning of your >>> child code and then have a new gdb session attach to the child >>> process before the sleep expires. >> >> >> >> Hi, >> I'm using 2.6.10 on debian sid. >> >>> On Thu, 31 Mar 2005, Russell Shaw wrote: >>> >>>> Hi, >>>> >>>> I was debugging a program with gdb-6.3 and did: set follow-fork-mode >>>> child but fork() still returns the PID meaning that it is still following >>>> the parent. > > Can you show the context in which you are getting this ? I was debugging ttink (a utility for monitoring epson printers). It doesn't matter much now because i found a different utilty. cmd.c: /* no server, create the shared memory */ /* and the sub process for port /dev/... */ if ( pid == -1 && ! connectedOnServer ) { *shmem->function = '\0'; shmem->printerState = 4; shmem->mode = mode; shmem->command = command; shmem->pass = pass; shmem->choice = choice; *shmem->buf = '\0'; shmem->ready = 0; switch((pid=fork())) <<<-------------------- here { case 0: doCommands(NULL); break; case -1: break; default: /* allow to react on child dead */ signal(SIGCHLD, sigChild); } #endif }