Reputation: 161
I'm trying to find a way to start a perl process up under the debugger, but have in just start running automatically without stopping at the first statement and having me enter 'c' to start it. This module is run by a larger system and I need to be able to periodically (based on external conditions) interrupt the program via interrupt signal, examine some data structures and have it continue.
Obviously, I can have the supervising program start my process using "perl -d myProcess", but how to get it to just run without the initial break. Anybody know how to get this to happen?
Much Thanks.
Upvotes: 7
Views: 437
Reputation: 843
If using Perl 5 plugin for IntelliJ Idea, this can be controlled per Run/Debug configuration.
Open the Run/Debug Configurations, select your run/debug configuration from list, then go to Debugging tab. In the "Debugger startup mode" field select "Stop at first breakpoint".
Upvotes: 1
Reputation: 984
You can also add this config option to the .perldb file. The format of the config file is a bit unusual and not so well documented, so here goes
DB::parse_options("NonStop=1");
Other useful options:
DB::parse_options("dumpDepth=3");
DB::parse_options("PrintRet=0");
$DB::deep = 1000;
Upvotes: 2
Reputation: 161
Thanks. That was a big hint. I see several options including "NonStop".
It looks like using the line PERLDB_OPTS="NonStop" perl -d myprog.pl &
does the trick. Then I just kill -INT <pid>
and fg
it to get it up in the debugger. After I 'c' to continue executing and bg
it so it will continue.
Upvotes: 7