Grokbase
x

Re: Bug in Debugger or DateTime?

View PostFlat  Thread  Threaded | < Prev - Next >
Richard Foley Re: Bug in Debugger or DateTime?
| +1 vote
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
Seeing as it happens with (eg.) CGI (etc.), this suggests a debugger bug.

richard@thpad:~> perl -MCGI -de 0

Loading DB routines from perl5db.pl version 1.3
Editor support available.

Enter h or `h h' for help, or `man perldebug' for more help.

main::(-e:1):   0
  DB<1> m CGI->new
Not a subroutine reference at /usr/lib/perl5/5.10.0/perl5db.pl line 7934.
at /usr/lib/perl5/5.10.0/perl5db.pl line 7934
        DB::methods_via('CGI', '', 1) called 
at /usr/lib/perl5/5.10.0/perl5db.pl line 7904
        DB::methods('CGI=HASH(0xd73f00)') called 
at /usr/lib/perl5/5.10.0/perl5db.pl line 670
        DB::eval called at /usr/lib/perl5/5.10.0/perl5db.pl line 3436
        DB::DB called at -e line 1
Debugged program terminated.  Use q to quit or R to restart,
  use o inhibit_exit to avoid stopping after program termination,
  h q, h R or h o to get additional info.
  DB<2>                   

The relevant bit is here (xxx):

7920 sub methods_via {
7921
7922     # If we've processed this class already, just quit.
7923     my $class = shift;
7924     return if $seen{$class}++;
7925
7926     # This is a package that is contributing the methods we're about to 
print.
7927     my $prefix  = shift;
7928     my $prepend = $prefix ? "via $prefix: " : '';
7929
7930     my $name;
7931     for $name (
7932
7933         # Keep if this is a defined subroutine in this class.
7934         grep { defined &{ ${"${class}::"}{$_} } }   # <- here (xxx)!
7935
7936         # Extract from all the symbols in this class.
7937         sort keys %{"${class}::"}
7938       )
7939     {
7940
7941         # If we printed this already, skip it.
7942         next if $seen{$name}++;
7943
7944         # Print the new method name.
7945         local $\ = '';
7946         local $, = '';
7947         print $DB::OUT "$prepend$name\n";
7948     } ## end for $name (grep { defined...

--
Richard Foley
Ciao - shorter than aufwiedersehen

http://www.rfi.net/

On Tuesday 14 July 2009 12:40:50 Ovid wrote:
>
> I honestly have no idea if this is a bug in DateTime or the debugger. If
it's a bug in the debugger, it would be nice to fix and I don't have time to
look at it right now.
>
> Basically, when in the debugger, you can type "m" following by an object and
it will list the methods available on that object.  Here's an example of it 
failing when trying with a DateTime object.
>
>     $ perl -MDateTime -de 1
>
> Loading DB routines from perl5db.pl version 1.3
>     Editor support available.
>
> Enter h or `h h' for help, or `man perldebug' for more help.
>
>     main::(-e:1):    1
>       DB<1> m DateTime->now
> Not a subroutine reference at /usr/share/perl/5.10/perl5db.pl line 7930.
>     at /usr/share/perl/5.10/perl5db.pl line 7930
>       DB::methods_via('DateTime', '', 1) called 
at /usr/share/perl/5.10/perl5db.pl line 7900
> DB::methods('DateTime=HASH(0x94fb878)') called
at /usr/share/perl/5.10/perl5db.pl line 670
> DB::eval called at /usr/share/perl/5.10/perl5db.pl line 3434
>       DB::DB called at -e line 1
> Debugged program terminated. Use q to quit or R to restart,
> use o inhibit_exit to avoid stopping after program termination,
>       h q, h R or h o to get additional info.  
>
> Cheers,
>
> Ovid
> --
> Buy the book - http://www.oreilly.com/catalog/perlhks/
> Tech blog - http://use.perl.org/~Ovid/journal/
> Twitter - http://twitter.com/OvidPerl
> Official Perl 6 Wiki - http://www.perlfoundation.org/perl6
>
>

Thread : Bug in Debugger or DateTime?
1)
Ovid I honestly have no idea if this is a bug in DateTime or the debugger. If it= 's a bug in the...
2)
Richard Foley Seeing as it happens with (eg.) CGI (etc.), this suggests a debugger bug. richard@thpad:~> perl...
3)
Ovid ----- Original Message ----=0A> From: Richard Foley <Richard.Foley@rfi.net>= =0A> =0A> Seeing as it...
4)
Nicholas Clark However, I can't replicate it on blead. So either it's fixed, or it's "works on my machine" because...
5)
Bram Citeren Nicholas Clark <nick@ccl4.org>: The change that broke it: ----Program---- #!/usr/bin/perl...
6)
Dave Mitchell that's been merged into maint, so I guess its a non-issue now.
7)
Michael G Schwern I can verify its broken in 5.10.0 and works in 5.10.1RC0. Contemplating a way to test it.
8)
Joshua ben Jore to It sounds like... The 'm' feature of the debugger in 5.10.0 is busted, It was broken by...
9)
Nicholas Clark Actually, if that's it, then the bustedness was *noticed* because of that. But had actually been...
spacer
View PostFlat  Thread  Threaded | < Prev - Next >