A debugger is a computer program that is used to debug other programs.
Devel::ebug is a simple, extensible Perl debugger with a clean API.
Using this module, you may easily write a Perl debugger to debug your
programs. Alternatively, it comes with an interactive debugger, ebug.
perl5db.pl, Perl's current debugger is currently 2,600 lines of magic
and special cases. The code is nearly unreadable: fixing bugs and
adding new features is fraught with difficulties. The debugger has no
test suite which has caused breakage with changes that couldn't be
properly tested. It will also not debug regexes. Devel::ebug is aimed
at fixing these problems and delivering a replacement debugger which
provides a well-tested simple programmatic interface to debugging
programs. This makes it easier to build debuggers on top of
Devel::ebug, be they console-, curses-, GUI- or Ajax-based.
There are currently two user interfaces to Devel::debug, ebug and
ebug_http. ebug is a console-based interface to debugging programs,
much like perl5db.pl. ebug_http is an innovative web-based interface
to debugging programs.
The callsite() function returns the callsite (a number) one level up
from where it was called. See the tests for an example. It's useful
for functions that need to uniquely know where they were called, such
as Every::every() (see devel/p5-Every).
Devel::Diagram scans the given Perl modules attempting to discover the
class structure. It produces a hash table that can be converted to XML
(or other formats) via Render().
An XSL stylesheet is included that converts the XML class diagram into
HTML.
The Devel::SmallProf profiler is focused on the time taken for a program
run on a line-by-line basis. It is intended to be as "small" in terms
of impact on the speed and memory usage of the profiled program as
possible and also in terms of being simple to use.
Devel::PartialDump is a data dumper optimized for logging of arbitrary
parameters.
It attempts to truncate overly verbose data, in a way that is hopefully
more useful for diagnostics warnings than
warn Dumper(@stuff);
Unlike other data dumping modules there are no attempts at correctness
or cross referencing, this is only meant to provide a slightly deeper
look into the data in question.
The Devel::Profile package is a Perl code profiler. This will collect
information on the execution time of a Perl script and of the subs in that
script. This information can be used to determine which subroutines are using
the most time and which subroutines are being called most often.
This module lets you add debugging instructions which look
like comments and do nothing unless you 'use' this module.
use Devel::StealthDebug;
my $foo = 0;
# ... Several processing on $foo
my $bar = 1 / $foo; #!assert($foo != 0)!
my %myhash; #!watch(%myhash)!
sub func1 { #!emit(Entering func1)!
#...
}
The Devel::Required module only serves a purpose in the development
environment of an author of a CPAN module (or more precisely: a user of the
ExtUtils::MakeMaker module). It makes sure that any changes to the required
modules specified in the Makefile.PL are automatically reflected in the
appropriate text file and in the appropriate source files (either
explicitly or implicitly specified).
It takes the information given with the PREREQ_PM parameter and by default
writes this to the README file, as well as to the POD of the file specified
with the VERSION_FROM parameter. Both these defaults can be overridden with
the "text" and "pod" parameters in the use Devel::Required specification.
Declaring constants is very convenient for writing programs, but as
they're often inlined by Perl, retrieving their symbolic names can be
tricky. This is made worse with low level modules that use constants for
bit-twiddling.
Devel::Constants makes this much more manageable.
It silently wraps around the constant module, intercepting all constant
declarations. It builds a hash, associating the values to their names.
The names can then be retrieved as necessary.
Devel::Leak has two functions NoteSV and CheckSV.
NoteSV walks the perl internal table of allocated SVs (scalar values) -
(which actually contains arrays and hashes too), and records their
addresses in a table. It returns a count of these "things", and stores
a pointer to the table (which is obtained from the heap using malloc())
in its argument.
CheckSV is passed argument which holds a pointer to a table created by
NoteSV. It re-walks the perl-internals and calls sv_dump() for any
"things" which did not exist when NoteSV was called. It returns a count
of the number of "things" now allocated.