X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fperl5db.pl;h=997b836d93aa722cc92e5be7ec9295ef298169ee;hb=4750257bd21f5a4355221e101326277c013826ec;hp=c770b52321caf78b4b048a03cb599ee4382ec7a5;hpb=7f9c46c2e27d6ddeeb97c57f8d12c650dafc9778;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/perl5db.pl b/lib/perl5db.pl index c770b52..997b836 100644 --- a/lib/perl5db.pl +++ b/lib/perl5db.pl @@ -980,7 +980,28 @@ EOP } $pretype = [$1]; next CMD; }; - $cmd =~ /^n$/ && do { + $cmd =~ /^y(?:\s+(\d*)\s*(.*))?$/ && do { + eval { require PadWalker; PadWalker->VERSION(0.08) } + or &warn($@ =~ /locate/ + ? "PadWalker module not found - please install\n" + : $@) + and next CMD; + do 'dumpvar.pl' unless defined &main::dumpvar; + defined &main::dumpvar + or print $OUT "dumpvar.pl not available.\n" + and next CMD; + my @vars = split(' ', $2 || ''); + my $h = eval { PadWalker::peek_my(($1 || 0) + 1) }; + $@ and $@ =~ s/ at .*//, &warn($@), next CMD; + my $savout = select($OUT); + dumpvar::dumplex($_, $h->{$_}, + defined $option{dumpDepth} + ? $option{dumpDepth} : -1, + @vars) + for sort keys %$h; + select($savout); + next CMD; }; + $cmd =~ /^n$/ && do { end_report(), next CMD if $finished and $level <= 1; $single = 2; $laststep = $cmd; @@ -1257,7 +1278,7 @@ EOP } } next CMD; }; - $cmd =~ /^\@\s*(.*\S)/ && do { + $cmd =~ /^source\s+(.*\S)/ && do { if (open my $fh, $1) { push @cmdfhs, $fh; } else { @@ -2740,7 +2761,7 @@ B<$psh$psh> I Run cmd in a subprocess (reads from DB::IN, writes to DB::O . ( $rc eq $sh ? "" : " B<$psh> [I] Run I in subshell (forces \"\$SHELL -c 'cmd'\")." ) . " See 'B I' too. -B<@>I Execute I containing debugger commands (may nest). +B I Execute I containing debugger commands (may nest). B I<-number> Display last number commands (default all). B

I Same as \"I\" in current package. B<|>I Run debugger command, piping DB::OUT to current pager. @@ -2815,7 +2836,7 @@ I B List break/watch/act B [I<-num>] Display last num commands B [I] I Do cmd before line B<=> [I I] Define/list an alias B I Delete a/all actions B [I] Get help on command B I Add a watch expression - B Complete help page B I Delete a/all watch expressions + B Complete help page B I Delete a/all watch exprs B<|>[B<|>]I Send output to pager B<$psh>\[B<$psh>\] I Run cmd in a subprocess B or B<^D> Quit B Attempt a restart I B Execute perl code, also see: B,B,B I @@ -2909,7 +2930,7 @@ B<$psh$psh> I Run cmd in a subprocess (reads from DB::IN, writes to DB::O . ( $rc eq $sh ? "" : " B<$psh> [I] Run I in subshell (forces \"\$SHELL -c 'cmd'\")." ) . " See 'B I' too. -B<@>I Execute I containing debugger commands (may nest). +B I Execute I containing debugger commands (may nest). B I<-number> Display last number commands (default all). B

I Same as \"I\" in current package. B<|>I Run debugger command, piping DB::OUT to current pager.