X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fdumpvar.pl;h=51e9c88ea3da555fe702d9b0412ac54a74e9c636;hb=75abe269e0d31ceddf18e82f302e49668a65999c;hp=fb0bb2396f4fdad90a972f565eba56075633c62e;hpb=7894fbab1e479c2ce906aed9132b15a68bfa5d73;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/dumpvar.pl b/lib/dumpvar.pl index fb0bb23..51e9c88 100644 --- a/lib/dumpvar.pl +++ b/lib/dumpvar.pl @@ -53,7 +53,7 @@ sub stringify { return $_ . "" if ref \$_ eq 'GLOB'; $_ = &{'overload::StrVal'}($_) if $bareStringify and ref $_ - and defined %overload:: and defined &{'overload::StrVal'}; + and %overload:: and defined &{'overload::StrVal'}; if ($tick eq 'auto') { if (/[\000-\011\013-\037\177]/) { @@ -125,7 +125,7 @@ sub unwrap { if (ref $v) { my $val = $v; $val = &{'overload::StrVal'}($v) - if defined %overload:: and defined &{'overload::StrVal'}; + if %overload:: and defined &{'overload::StrVal'}; ($address) = $val =~ /(0x[0-9a-f]+)\)$/ ; if (!$dumpReused && defined $address) { $address{$address}++ ; @@ -195,8 +195,8 @@ sub unwrap { if ($#$v >= 0) { $short = $sp . "0..$#{$v} " . join(" ", - map {stringify $_} @{$v}[0..$tArrayDepth]) - . "$shortmore"; + map {exists $v->[$_] ? stringify $v->[$_] : "empty"} ($[..$tArrayDepth) + ) . "$shortmore"; } else { $short = $sp . "empty array"; } @@ -209,7 +209,11 @@ sub unwrap { for $num ($[ .. $tArrayDepth) { return if $DB::signal; print "$sp$num "; - DumpElem $v->[$num], $s; + if (exists $v->[$num]) { + DumpElem $v->[$num], $s; + } else { + print "empty slot\n"; + } } print "$sp empty array\n" unless @$v; print "$sp$more" if defined $more ; @@ -289,12 +293,12 @@ sub dumpglob { print( (' ' x $off) . "\$", &unctrl($key), " = " ); DumpElem $entry, 3+$off; } - if (($key !~ /^_