Reputation: 12974
I have a huge Perl script,which many times it hangs, When it's in running state, I need to find out, which step it's now executing.
I don't want Devel::Trace
[compile time entity]. Is there anything like strace kind of thing? To which I can pass the pid of the script and it will show me, what is it executing at run time?
Upvotes: 2
Views: 1578
Reputation: 385565
What's a "step"?
You mentioned strace
, and strace
traces system calls. If that's what you want, go a head and use strace
. It works perfectly fine with Perl.
If you want to trace which Perl statement is executing, you could run the script in perl -d
, the Perl debugger. It has a trace feature. This function is also provided by Devel::Trace through a trivially simple interface.
(I have no idea what problem you have with Devel::Trace. You seem to imply it doesn't show what statements get executed as they get executed, but that's exactly what it does.)
Upvotes: 4
Reputation: 39158
It is a bad idea to paint yourself in the corner where you neither can restart the program with debugging modules, nor clone the environment so you can experiment with it away from production.
Think twice and look out for less risky measures before injecting the Enbugger
debugger at run-time.
Upvotes: 0