Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* GDB- following child process with gdb
@ 2001-02-27  4:22 DEEPAK E P
  2001-02-27  6:58 ` Andrew Cagney
  0 siblings, 1 reply; 2+ messages in thread
From: DEEPAK E P @ 2001-02-27  4:22 UTC (permalink / raw)
  To: gdb

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1875 bytes --]

Hi ,
  I have a red hat linux system. uname 
-a Linux 2.2.14-12smp #1 SMP Tue Apr 25 12:58:06 EDT 2000 i686 
unknown
 
gdb --version GNU gdb 19991004 Copyright 1998 
Free Software Foundation, Inc
   I have not been able to follow the 
child process after a fork call.
 
  Tried the following:
 
(gdb) l 1       
main() 2       
{ 3               
int 
j; 4               
printf("Hello world\n"); 5
6               
if (fork() == 0 ) 
{ 7                       
printf("Chile 
process\n"); 8               
} else 
{ 9                       
printf("Parent 
process\n"); 10              
} (gdb) set follow-fork-mode child (gdb) show follow-fork-mode Debugger 
response to a program call of fork or vfork is "child". (gdb) break 
7 Breakpoint 1 at 0x804841e: file junk.c, line 7. (gdb) r Hello 
world Parent process
 
Program exited with code 017.
Note: I have compiled with -g option 
:       gcc -g -o jk 
junk.c 
Also tried : (gdb) break fork Breakpoint 1 at 
0x804830c (gdb) r Starting program: 
/home/deepakep/local/./jk Breakpoint 1 at 0x400abc90 Hello 
world
 
Breakpoint 1, 0x400abc90 in __libc_fork () from 
/lib/libc.so.6 (gdb) return 0
 
This also doesnt work.
Do i have to pick up a patch etc ??, or is it not 
supported in the current version
of gdb i am using.
Thanks in advance for the help
dk                                    



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: GDB- following child process with gdb
  2001-02-27  4:22 GDB- following child process with gdb DEEPAK E P
@ 2001-02-27  6:58 ` Andrew Cagney
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Cagney @ 2001-02-27  6:58 UTC (permalink / raw)
  To: DEEPAK E P; +Cc: gdb

> DEEPAK E P wrote:
> 
> Hi ,
>   I have a red hat linux system.
> uname -a
> Linux 2.2.14-12smp #1 SMP Tue Apr 25 12:58:06 EDT 2000 i686 unknown
> 
> gdb --version
> GNU gdb 19991004
> Copyright 1998 Free Software Foundation, Inc
>    I have not been able to follow the child process after a fork call.

From memory, this feature currently only works under HP/UX.

	Andrew


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-02-27  6:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-02-27  4:22 GDB- following child process with gdb DEEPAK E P
2001-02-27  6:58 ` Andrew Cagney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox