* 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