Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

have perl debugger not stop at first statement

Tags:

debugging

perl

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.

like image 949
templets Avatar asked Mar 05 '11 20:03

templets


People also ask

How do I enable debug mode in Perl script?

Run the debugger command, piping DB::OUT into your current pager. Same as |dbcmd but DB::OUT is temporarily select ed as well. or list current aliases. Execute command as a Perl statement.

How do I debug a Perl code in Visual Studio?

Open a Perl source file, click "Run -> Start Debugging" or hit F5 and observe there is no error as before. Now explore all VSCocde IDE functions working nicely with Perl!


1 Answers

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.

like image 68
templets Avatar answered Oct 21 '22 12:10

templets