From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17164 invoked by alias); 8 Aug 2006 08:49:55 -0000 Received: (qmail 17155 invoked by uid 22791); 8 Aug 2006 08:49:54 -0000 X-Spam-Check-By: sourceware.org Received: from nf-out-0910.google.com (HELO nf-out-0910.google.com) (64.233.182.186) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 08 Aug 2006 08:49:51 +0000 Received: by nf-out-0910.google.com with SMTP id m19so166020nfc for ; Tue, 08 Aug 2006 01:49:48 -0700 (PDT) Received: by 10.49.29.2 with SMTP id g2mr264477nfj; Tue, 08 Aug 2006 01:49:48 -0700 (PDT) Received: from localhost ( [80.171.131.106]) by mx.gmail.com with ESMTP id c28sm535132nfb.2006.08.08.01.49.48; Tue, 08 Aug 2006 01:49:48 -0700 (PDT) To: Richard Cc: Richard , gdb@sources.redhat.com Subject: Re: fork debugging : back to parent. References: <5693501.post@talk.nabble.com> <20060807210740.GA28579@nevyn.them.org> <87slk8xlpk.fsf@mail.com> <20060808000358.GA744@nevyn.them.org> Date: Tue, 08 Aug 2006 08:49:00 -0000 In-Reply-To: <20060808000358.GA744@nevyn.them.org> (Daniel Jacobowitz's message of "Mon, 7 Aug 2006 20:03:58 -0400") Message-ID: <87zmef393u.fsf@mail.com> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii From: Richard Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-08/txt/msg00046.txt.bz2 Daniel Jacobowitz writes: > On Mon, Aug 07, 2006 at 11:47:03PM +0200, Richard wrote: >> set follow-fork-mode to both is not supported: > > Sorry, try turning off detach-on-fork. See "help set". > >> Sorry, if I'm missing something obvious. How owuld I browse "recent >> features" in CVS? > > Take a look at the NEWS file. > > -- > Daniel Jacobowitz > CodeSourcery > I think I answered my own question: By setting follow to parent and detach to off, one can use info fork in the parent thread in order to switch to the child thread. If follow is set to child and detach is off, then there is no fork info in the child for some reason so you cant switch back to the parent. Is this a bug? (1) follow parent and then switch to the child fork - we end up at our childs breakpoint "pit_t par=" etc... ,---- | >set follow parent | >set detach off | >c | Continuing. | % date | Breakpoint 3, main () at forkcmd.c:31 | 31 if ((pid = waitpid(pid, &status, 0)) < 0) | >info fork | 1 process 11319 at 0xffffe410, <__kernel_vsyscall> | * 0 process 11308 (main process) at 0x80487e6, file forkcmd.c, line 31 | >fork 1 | Reading in symbols for ../sysdeps/i386/elf/start.S...done. | Switching to process 11319 | #0 __kernel_vsyscall () | >c | Continuing. | | Breakpoint 2, main () at forkcmd.c:23 | 23 pid_t par = getppid(); | > `---- (2) try to follow child to a break and switch back to parent fork : not possible. ,---- | >set follow child | >run | The program being debugged has been started already. | Start it from the beginning? (y or n) y | Starting program: etc | Reading symbols from system-supplied DSO at 0xffffe000...done. | Reading symbols from /lib/tls/i686/cmov/libc.so.6...done. | Reading symbols from /lib/ld-linux.so.2...done. | | Breakpoint 1, main () at forkcmd.c:11 | 11 printf("%% "); /* print prompt (printf requires %% to print %) */ | >c | Continuing. | % date | [New process 11385] | | Program received signal SIGINT, Interrupt. | __kernel_vsyscall () | >c | Continuing. | c | | Program received signal SIGINT, Interrupt. | __kernel_vsyscall () | >info fork | * 2 process 11385 at 0xffffe410, <__kernel_vsyscall> `---- Am I misunderstandong something? Thanks for any help. --