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.

inside custom component

Native Development

Reply
Developer
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook
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.

New Contributor
Posts: 8
Registered: ‎11-12-2011
My Device: playbook
My Carrier: none

Re: Debugging child process

Developer
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook
My Carrier: x

Re: Debugging child process

Thanks for advice. Tried to specify 

set follow-fork-mode child

in .gdbinit with no luck.

Retired
Posts: 20
Registered: ‎10-27-2010
My Device: Bold 9800

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.

Highlighted
New Developer
Posts: 29
Registered: ‎02-26-2012
My Device: Playbook, Bold 9900
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