Name : perl-Devel-TraceCalls
| |
Version : 0.04
| Vendor : obs://build_opensuse_org/devel:languages:perl
|
Release : 9.73
| Date : 2024-08-05 19:29:46
|
Group : Development/Libraries/Perl
| Source RPM : perl-Devel-TraceCalls-0.04-9.73.src.rpm
|
Size : 0.07 MB
| |
Packager : (none)
| |
Summary : Track calls to subs, classes and object instances
|
Description :
*ALPHA CODE ALERT. This module may change before \"official\" release\"*.
Devel::TraceCalls allows subroutine calls to be tracked on a per-subroutine, per-package, per-class, or per object instance basis. This can be quite useful when trying to figure out how some poor thing is being misused in a program you don\'t fully understand.
Devel::TraceCalls works on subroutines and classes by installing wrapper subroutines and on objects by temporarily reblessing the objects in to specialized subclasses with \"shim\" methods. Such objects are reblessed back when the tracker is DESTROYed.
The default action is to log the calls to STDERR. Passing in a \'PreCall\', or \'PostCall\' options disables this default behavior, you can reenable it by manually setting \'< LogTo =\' \\*STDERR>>.
There are 4 ways to specify what to trace.
* 1
By Explicit Sub Name
trace_calls \"foo\", \"bar\"; ## trace to STDOUT.
trace_calls { Subs => [ \"foo\", \"bar\" ], ...options... };
The first form enables tracking with all Capture options enabled (other than CaptureSelf which has no effect when capturing plain subs). The second allows you to control the options.
* 2
By Package Name
trace_calls { Package => \"My::Module\", ...options... };
trace_calls { Package => [ \"My::Module\", \"Another::Module\" ], ...options... };
trace_calls { Package => \"My::Module\", Subs => [ \"foo\", \"bar\" ], ...options... };
This allows you to provide a package prefix for subroutine names to be tracked. If no \"Subs\" option is provided, all subroutines in the package will be tracked.
This does not examine AATTISA like the \'Class\' and \'Objects\' (covered next) techniques do.
* 3
By Class Name
trace_calls { Class => \"My::Class\", ...options... };
trace_calls { Class => \"My::Class\", ...options... };
trace_calls { Class => \"My::Class\", Subs => [ \"foo\", \"bar\" ], ...options... };
This allows tracking of method calls (or things that look like method calls) for a class and it\'s base classes. The $self ($_[0]) will not be captured in \'Args\' (see Data Capture Format), but may be captured in \'Self\' if \'CaptureSelf\' is enabled.
\'Devel::TraceCalls\' can\'t differentiate between \'$obj-\'foo( ... )> and \'foo( $obj, ... )\', which can lead to extra calls being tracked if the latter form is used. The good news is that this means that idioms like:
$meth = $obj->can( \"foo\" ); $meth->( $obj, ... ) if $meth;
are captured.
If a \'Subs\' parameter is provided, only the named methods will be tracked. Otherwise all subs in the class and in all parent classes are tracked.
* 3
By Object Instance
trace_calls $obj1, $obj2;
trace_calls { Objects => [ $obj1, $obj2 ], ...options... };
trace_calls { Objects => [ $obj1, $obj2 ], Subs => [ \"foo\", \"bar\" ], ...options... };
This allows tracking of method calls (or things that look like method calls) for specific instances. The $self ($_[0]) will not be captured in \'Args\', but may be captured in Self if CaptureSelf is enabled.
The first form (\'track $obj, ...\') enables all capture options, including CaptureSelf.
|
RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/devel:/languages:/perl:/CPAN-D/openSUSE_Tumbleweed/noarch |