From: "DEEPAK E P" <deepak.embar@wipro.com>
To: <gdb@sources.redhat.com>
Subject: GDB- following child process with gdb
Date: Tue, 27 Feb 2001 04:22:00 -0000 [thread overview]
Message-ID: <012d01c0a0b7$2c1f9320$af97a8c0@Wipro.com> (raw)
[-- 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                                  Â
next reply other threads:[~2001-02-27 4:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-02-27 4:22 DEEPAK E P [this message]
2001-02-27 6:58 ` Andrew Cagney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='012d01c0a0b7$2c1f9320$af97a8c0@Wipro.com' \
--to=deepak.embar@wipro.com \
--cc=gdb@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox