jabarin has asked for the wisdom of the Perl Monks concerning the following question:
Hello,
I've read that the perl debugger supports debugging a child process when it encounters a fork, however, this is not documented in the perl man pages.
Can you please offer your guidance on how I can go about using the debugger in a perl script that contains a fork?
Thanks.
Re: Using perl debugger with fork
by HuckinFappy (Pilgrim) on Aug 28, 2006 at 18:20 UTC
|
I do the following (on linux):
DB<1> *DB::get_fork_TTY = sub { DB::xterm_get_fork_TTY() }
Somehow I've always had the niggling feeling I shouldn't have to do this, but it does make things work as expected and desired for me. | [reply] [d/l] |
Re: Using perl debugger with fork
by derby (Abbot) on Aug 28, 2006 at 17:08 UTC
|
What platform? In the debug docs, there's some info on getting two debug ttys after a fork (but I've never tried it ... I normally architect around the situation by having a debug run not fork).
| [reply] |
Re: Using perl debugger with fork
by Fletch (Bishop) on Aug 28, 2006 at 18:41 UTC
|
The simplest solution (one not requiring debugger finagling or arcane ptyery) would be to arrange (or rearrange, as the case may be) your code so that the different paths can be executed and tested in isolation.
| [reply] |
|