A while back on Tue, 31 May 2011 18:20:51 -0700 Conor wrote:
Not exactly a high priority bug, but I found that if you set a breakpoint on
> a line where a 'use' statement exists, the breakpoint will show as set and
> the debugger won't complain:
> $ perl -d breakpoint-bug.pl
> Loading DB routines from perl5db.pl version 1.32
> Editor support available.
> Enter h or `h h' for help, or `man perldebug' for more help.
> 7: print "hello!\n";
> DB<1> b 9
> DB<2> v
> 4: use strict;
> 5: use warnings;
> 7==> print "hello!\n";
> 9:b use Data::Dumper;
> 11: print "goodbye!\n";
> 13: exit 0;
> But, if you 'c' from line 7, you skip over the breakpoint on 9 as if it
> wasn't there. It isn't a huge problem (and I really should keep all of my
> 'use' statements at the beginning of the script), but I figured it was
> a mention.
> I couldn't figure out how to actually file a bug at http://rt.perl.org and
> http://search.cpan.org/~jesse/perl-5.14.0/lib/perl5db.pl didn't have the
> usual 'View/Report Bugs' that most modules have. I'm happy to file a bug if
> someone could point me in the right direction.
I just looked at this. I don't think there is a bug here.
The code has a "use" statement. A breakpoint is set on that which the
reporter doesn't feel is respected.
However, recall that "use" happens at compile time and this occurs before
the first stop you see in the debugger.
To verify this when I issued:
$Data::Dumper::VERSION from Devel::Trepan stopped at line 7, I got a
version string, e.g. '2.124'. (in perl5db use "p $Data::Dumper::VERSION"
Change the "use" to a "require" which then changes the semantics, and
you'll things will work as you seem to expect it to would above.
So in sum, I don't think there is a bug. Just perhaps confusion about how
execution works -- which I admit is confusing.