in reply to Re^2: Debugging a program
in thread Debugging a program
But even better, I could shift the signal handler code into the debugger initialization file .perldb. Then I do not have to modify the original source code. Works great!
This is the content of file .perldb (place it in the current or in the home directory):
sub afterinit { $::SIG{'__WARN__'} = sub { my $warning = shift; if ( $warning =~ m{\s at \s \S+ \s line \s \d+ \. $}xms ) { $DB::single = 1; # debugger stops here automatically } warn $warning; }; print "sigwarn handler installed!\n"; return; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Debugging a program
by hexcoder (Curate) on Jul 18, 2016 at 11:59 UTC | |
by hexcoder (Curate) on Feb 20, 2019 at 12:48 UTC | |
by jdporter (Paladin) on Feb 20, 2019 at 17:24 UTC | |
by hexcoder (Curate) on Sep 19, 2019 at 09:08 UTC |