Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Using perl debugger with fork

by jabarin (Acolyte)
on Aug 28, 2006 at 16:04 UTC ( [id://570000]=perlquestion: print w/replies, xml ) Need Help??

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.

Replies are listed 'Best First'.
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.
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).

    -derby
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://570000]
Approved by Tanktalus
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (2)
As of 2024-04-26 02:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found