Welcome!

Welcome to the Official BlackBerry Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Native Development

Reply
Developer
BGmot
Posts: 961
Registered: ‎11-24-2011
My Carrier: x

Debugging child process

hello,

is it possible to debug forked process

    if( ( pid = fork() ) == -1 ) {
       perror( "fork" );
       return -1;
    }

    if( pid == 0 ) {
      printf("I am a child");
      return 0;
    }

 

so, how can I make breakpoint at "printf" work (stop)?

Thnaks.

Please use plain text.
New Contributor
macberryman
Posts: 8
Registered: ‎11-12-2011
My Carrier: none

Re: Debugging child process

Please use plain text.
Developer
BGmot
Posts: 961
Registered: ‎11-24-2011
My Carrier: x

Re: Debugging child process

Thanks for advice. Tried to specify 

set follow-fork-mode child

in .gdbinit with no luck.

Please use plain text.
BlackBerry Technical Advisor
davidcummings
Posts: 20
Registered: ‎10-27-2010

Re: Debugging child process

I tried using both the IDE and gdb command line. Unfortunately follow-fork-mode isn't working for me either.

 

I've followed up with our debugger experts and they are looking into a fix.

Please use plain text.
New Developer
npross
Posts: 27
Registered: ‎02-26-2012
My Carrier: Telus

Re: Debugging child process

Hi , I just ran into the same issue and tried the 'set follow-fork-mode child' in .gdbinit with no success.  I tried raise(SIGINT) in the child but that didn't work either.

 

Has anything come of this issue?

 

Thanks,

Norm

Please use plain text.