#510416 liberror-perl: unable to debug code wrapped by try statement

#510416#5
Date:
2009-01-01 16:44:38 UTC
From:
To:
Hello.

Perl debugger treats

try {
 # code, code...
 # ...
 # ...
}

statement as a whole, i.e. I cannot debug statements inside try {...}.

#510416#10
Date:
2010-03-17 06:05:16 UTC
From:
To:
Hi Shlomi,

I'm writing to you in your capacity as maintainer of the "Error" CPAN module. I'm the maintainer of the Debian package for the module.

I've had a bug report "unable to debug code wrapped by try statement" lodged against the package. Full details of the report are at the link below.

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=510416

My intuition is that this is a design limitation, not a bug. May I have your comment?

Thanks,
Clint

#510416#15
Date:
2010-03-17 09:46:43 UTC
From:
To:
Yes it, is. Using this program:
----SNIP---- #!/usr/bin/perl use strict; use warnings; use Error qw(:try); try { my $x = 5; my $y = 6; print "$x*$y == " , $x*$y, "\n"; $x += $y; $y++; } except { my $E = shift; print "Got $E\n"; };
----SNIP---- I can debug it by putting a break on the line number of "my $x = 5;" (using "b 9") and it seems to work fine. Otherwise, I should note that we no longer recommend people to use Error.pm, due to the black magical nature of its syntactic sugar. Regards, Shlomi Fish