Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Devel-ebug CPAN distribution.

Report information
The Basics
Id: 12697
Status: resolved
Priority: 0/
Queue: Devel-ebug

People
Owner: Nobody in particular
Requestors: SAMV [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in:
  • 0.33
  • 0.34
  • 0.35
  • 0.36
  • 0.37
Fixed in: (no value)



Subject: Blessed GLOBs and the pad
diff -urN Devel-ebug-0.42.orig/t/glob.pl Devel-ebug-0.42/t/glob.pl --- Devel-ebug-0.42.orig/t/glob.pl 1970-01-01 12:00:00.000000000 +1200 +++ Devel-ebug-0.42/t/glob.pl 2005-05-06 13:11:31.000000000 +1200 @@ -0,0 +1,9 @@ + +my $glob = \*foo; + +delete $main::{foo}; + +bless $glob, "this"; + +print "Glob is: $glob\n"; + diff -urN Devel-ebug-0.42.orig/t/glob.t Devel-ebug-0.42/t/glob.t --- Devel-ebug-0.42.orig/t/glob.t 1970-01-01 12:00:00.000000000 +1200 +++ Devel-ebug-0.42/t/glob.t 2005-05-06 13:14:18.000000000 +1200 @@ -0,0 +1,27 @@ +#!perl +use strict; +use warnings; +use lib 'lib'; + +use Test::More tests => 19; +use Devel::ebug; + +my $ebug = Devel::ebug->new; +$ebug->program("t/glob.pl"); +$ebug->load; + +# Let's step through the program, and check that we step through the +# lines in the right order + +my @lines = (2, 4, 6, 8); + +my $it = 0; +while (!$ebug->finished) { + my $l = shift @lines; + is($ebug->line, $l, "Line number correct ($l)"); + is($ebug->package, 'main', "Package correct"); + is($ebug->filename, 't/glob.pl', "Filename correct"); + ok($ebug->codeline, "Got a code line"); + ok($ebug->pad, "can get the pad ok") if $it++; + $ebug->next; +}
From: samv [...] cpan.org
Bah, this is actually a Storable limitation. Hmm.
[SAMV - Thu May 5 21:22:58 2005]: Show quoted text
> Bah, this is actually a Storable limitation.
Yes, but it can be worked around; diff -urN Devel-ebug-0.42.orig/lib/Devel/ebug/Backend/Plugin/Pad.pm Devel-ebug-0 .42/lib/Devel/ebug/Backend/Plugin/Pad.pm --- Devel-ebug-0.42.orig/lib/Devel/ebug/Backend/Plugin/Pad.pm 2005-04-29 04:50 :41.000000000 +1200 +++ Devel-ebug-0.42/lib/Devel/ebug/Backend/Plugin/Pad.pm 2005-05-06 15:03 :20.000000000 +1200 @@ -9,6 +9,7 @@ package DB; +use Scalar::Util qw(blessed reftype); sub pad { my($req, $context) = @_; my $pad; @@ -20,6 +21,9 @@ } else { my $v = eval "package $context->{package}; $k"; $pad->{$k} = $v; + + # workaround for blessed globs + $pad->{$k} = "".$v if blessed $v and reftype $v eq "GLOB"; } } return { pad => $pad }; Maybe it would be a good idea to trap this all the time, because there certainly are plenty of things that Storable doesn't round trip safely; diff -urN Devel-ebug-0.42.orig/lib/Devel/ebug/Backend.pm Devel-ebug-0.42/lib/Dev el/ebug/Backend.pm --- Devel-ebug-0.42.orig/lib/Devel/ebug/Backend.pm 2005-04-29 04:50:45.0000 00000 +1200 +++ Devel-ebug-0.42/lib/Devel/ebug/Backend.pm 2005-05-06 15:03:40.000000000 +1 200 @@ -127,9 +127,16 @@ $context->{initialise} = 0; } +#BEGIN { + #open DEBUGOUT, ">&STDOUT"; +#} +#use Data::Dumper; + sub put { my($res) = @_; - my $data = unpack("h*", Dump($res)); + #print DEBUGOUT "Putting: ".Dumper($res)."\n"; + my $data = eval { unpack("h*", Dump($res)) } + || unpack("h*", Dump({dumperror=>$@})); $context->{socket}->print($data . "\n"); } I was also seeing an error without this; don't know if it's related; diff -urN Devel-ebug-0.42.orig/lib/Devel/ebug/Plugin/StackTrace.pm Devel-ebug-0. 42/lib/Devel/ebug/Plugin/StackTrace.pm --- Devel-ebug-0.42.orig/lib/Devel/ebug/Plugin/StackTrace.pm 2005-04-29 04:50 :45.000000000 +1200 +++ Devel-ebug-0.42/lib/Devel/ebug/Plugin/StackTrace.pm 2005-05-06 15:05:33.0000 00000 +1200 @@ -9,7 +9,7 @@ sub stack_trace { my($self) = @_; my $response = $self->talk({ command => "stack_trace" }); - return @{$response->{stack_trace}}; + return @{$response->{stack_trace}||[]}; } # return the stack trace in a human-readable format
Thanks! Will be fixed in 0.46. Leon