Find the answer to your Linux question:
Results 1 to 2 of 2
Hi every one... i using gdb with debugging code.. i am debugging a program which have lines like this... ........... ........... if((childpid=fork())<0) exit(1); // fork error terminate program with error. ...
  1. #1
    Just Joined!
    Join Date
    Jan 2007
    Location
    India
    Posts
    10

    Question GDP with Fork() attach.. how to do??

    Hi every one...

    i using gdb with debugging code.. i am debugging a program which have lines like this...

    ...........
    ...........
    if((childpid=fork())<0)
    exit(1); // fork error terminate program with error.
    elseif(childpid>0)
    exit(0); // child is fine. kill the parent process.
    ..........
    ..........
    ..........

    when i am invoking with "gdb" parent killed because of successful child creation so i not able to continue debug my child process.

    Could you please anyone tell me to attach the child process to continue to debugg.


    Ganesh.

  2. #2
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    It's always best to get the information from the horse's mouth, so go here.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...