gdb and fork(): the lost child

I’ve experienced problems when trying to port unix programs that
uses fork. The fork call works well but gdb dosn’t handle it
as usual: the set follow-fork-mode child option simply doesn’t
work (making impossible to debug the code).

As usual, I’ve tryed to used gcc directly and use -g, -ggdb, -gstabs
-gdwarf -gdwarf-2 with no success. gdb continues to follow the
parent.

Are there other source-level debugger for qnx-rtp?


Wave++

Wave++ <wavexx@apexmail.com> wrote:

I’ve experienced problems when trying to port unix programs that
uses fork. The fork call works well but gdb dosn’t handle it
as usual: the set follow-fork-mode child option simply doesn’t
work (making impossible to debug the code).

As usual, I’ve tryed to used gcc directly and use -g, -ggdb, -gstabs
-gdwarf -gdwarf-2 with no success. gdb continues to follow the
parent.

Are there other source-level debugger for qnx-rtp?

Our port of gdb doesn’t support following child processes. There is no
notification from the OS, so this would be rather difficult to
implement.

The simplest way to do it right now is to put a raise(SIGSTOP) in the
child process after the fork then attach to the child process
and do finish until you come out of the raise()


cburgess@qnx.com