wu-lee has asked for the wisdom of the Perl Monks concerning the following question:
I've been trying to put breakpoints in a Test::Class derivative's test method. The debugger lists the breakpoint, but never stops there. I've whittled this down, and I think it may be due to the attributes used to label test methods.
Is this a bug in the debugger? Either way, is there a workaround? I can't put a breakpoint in a file which isn't the current file, otherwise I could specify the right line to break on.
Consider this example program:
Then if I debug this I get the same sort of behaviour described above. i.e. The breakpoint on subroutine a (with the attribute) is ignored, and the debugger stops instead on subroutine b (with no attributes). Listing the breakpoints, the debugger seems to have put b's breakpoint on an unbreakable line:package X; use strict; use Attribute::Handlers; sub a : ATTR(SCALAR) { print "a\n"; } sub b { print "b\n"; } package main; X::a; X::b;
$ perl -d dbtest.pl Loading DB routines from perl5db.pl version 1.28 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. Attribute::Handlers::CODE(0x8322008)(/usr/share/perl/5.8/Attribute/Han +dlers.pm:206): 206: $global_phase++; DB<1> printf "Perl v%vd\n", $^V Perl v5.8.8 DB<2> b X::a DB<3> b X::b DB<4> L dbtest.pl: 5: sub a : ATTR(SCALAR) { break if (1) 10: print "b\n"; break if (1) DB<4> c a X::b(dbtest.pl:10): print "b\n"; DB<4>
|
|---|