summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/Devel/Peek.pm
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-04-26 22:16:26 +0000
committerKarl Berry <karl@freefriends.org>2015-04-26 22:16:26 +0000
commit342e672574c4e67d510e46ab6acd0e21a7d0cf54 (patch)
tree79e04202d08c0404bbd780bd26c1e34710e539b6 /Master/tlpkg/tlperl/lib/Devel/Peek.pm
parentbe2706af7c57a0ef0f4d4e9f684ca4ef74922a82 (diff)
(tl)perl 5.20.2 for windows, from siep
git-svn-id: svn://tug.org/texlive/trunk@37064 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/tlperl/lib/Devel/Peek.pm')
-rw-r--r--Master/tlpkg/tlperl/lib/Devel/Peek.pm21
1 files changed, 15 insertions, 6 deletions
diff --git a/Master/tlpkg/tlperl/lib/Devel/Peek.pm b/Master/tlpkg/tlperl/lib/Devel/Peek.pm
index 7869c812946..731dc111176 100644
--- a/Master/tlpkg/tlperl/lib/Devel/Peek.pm
+++ b/Master/tlpkg/tlperl/lib/Devel/Peek.pm
@@ -3,7 +3,7 @@
package Devel::Peek;
-$VERSION = '1.11';
+$VERSION = '1.16';
$XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
@@ -13,7 +13,7 @@ require XSLoader;
@ISA = qw(Exporter);
@EXPORT = qw(Dump mstat DeadCode DumpArray DumpWithOP DumpProg
fill_mstats mstats_fillhash mstats2hash runops_debug debug_flags);
-@EXPORT_OK = qw(SvREFCNT SvREFCNT_inc SvREFCNT_dec CvGV);
+@EXPORT_OK = qw(SvREFCNT CvGV);
%EXPORT_TAGS = ('ALL' => [@EXPORT, @EXPORT_OK]);
XSLoader::load();
@@ -76,6 +76,8 @@ Devel::Peek - A data debugging tool for the XS programmer
use Devel::Peek;
Dump( $a );
Dump( $a, 5 );
+ Dump( @a );
+ Dump( %h );
DumpArray( 5, $a, $b, ... );
mstat "Point 5";
@@ -98,12 +100,18 @@ Devel::Peek supplies a C<Dump()> function which can dump a raw Perl
datatype, and C<mstat("marker")> function to report on memory usage
(if perl is compiled with corresponding option). The function
DeadCode() provides statistics on the data "frozen" into inactive
-C<CV>. Devel::Peek also supplies C<SvREFCNT()>, C<SvREFCNT_inc()>, and
-C<SvREFCNT_dec()> which can query, increment, and decrement reference
+C<CV>. Devel::Peek also supplies C<SvREFCNT()> which can query reference
counts on SVs. This document will take a passive, and safe, approach
to data debugging and for that it will describe only the C<Dump()>
function.
+The C<Dump()> function takes one or two arguments: something to dump, and
+an optional limit for recursion and array elements (default is 4). The
+first argument is evaluted in rvalue scalar context, with exceptions for
+@array and %hash, which dump the array or hash itself. So C<Dump @array>
+works, as does C<Dump $foo>. And C<Dump pos> will call C<pos> in rvalue
+context, whereas C<Dump ${\pos}> will call it in lvalue context.
+
Function C<DumpArray()> allows dumping of multiple values (useful when you
need to analyze returns of functions).
@@ -145,8 +153,9 @@ Three additional functions allow access to this statistic from Perl.
First, use C<mstats_fillhash(%hash)> to get the information contained
in the output of mstat() into %hash. The field of this hash are
- minbucket nbuckets sbrk_good sbrk_slack sbrked_remains sbrks start_slack
- topbucket topbucket_ev topbucket_odd total total_chain total_sbrk totfree
+ minbucket nbuckets sbrk_good sbrk_slack sbrked_remains sbrks
+ start_slack topbucket topbucket_ev topbucket_odd total total_chain
+ total_sbrk totfree
Two additional fields C<free>, C<used> contain array references which
provide per-bucket count of free and used chunks. Two other fields