Devel-Agent
view release on metacpan or search on metacpan
lib/Devel/Agent.pm view on Meta::CPAN
is=>'rw',
lazy=>1,
default=>0,
clearer=>1,
);
=item * save_to_stack=>Bool
This option is used to turn on or of the saving of frames details in to a layered structure inside of $self->trace. The default is 0 or false.
=cut
has save_to_stack=>(
# isa=>Bool,
is=>'rw',
default=>0,
);
=item * on_frame_end=>CodeRef
This code ref is called when a frame is closed. This should act as the default data streaming hook callback. All tracing operations are halted durriong this callback.
Example:
sub {
my ($self,$last)=@_;
# $self: An instance of DB
# $last: The most currently closed frame
}
=cut
has on_frame_end=>(
# isa=>CodeRef,
is=>'rw',
default=>sub { sub {} },
);
=item * trace_id=>Int
This method provides the current agent tracing pass. This number is incremented at the start of each call to $self->start_trace.
=cut
has trace_id=>(
is=>'rw',
default=>0,
lazy=>1,
);
=item * ignore_blocks=>HasRef[Int]
This hashref reprents what perl phazed blocks to ignore, the defaults are.
{
BEGIN=>1,
END=>1,
INIT=>1,
CHECK=>1,
UNITCHECK=>1,
}
The default values used to generate the hashref contained in in @DB::@PHAZES
=cut
our @PHAZES=(qw(BEGIN END INIT CHECK UNITCHECK));
has ignore_blocks=>(
#isa=>HashRef[Int],
is=>'ro',
default=>sub {
return { map { ($_,1) } @PHAZES}
},
);
=item * constructor_methods=>HashRef[Int]
This is a hash of method names we consider object constructors
Default:
{
# we assume new is an object constructor
new=>1
}
=cut
has constructor_methods=>(
is=>'ro',
#isa=>HashRef,
default=>sub {
return {
new=>1,
};
}
);
=item * max_depth=>Int
When the value is set to something other than -1, the number represents the maxium stack depth to trace too. Once the frame of max_depth exits, then max_depth will again be set to -1.
=cut
has max_depth=>(
is=>'rw',
lazy=>1,
clearer=>1,
default=>-1,
);
=item * tid=>Int
This is mostly here for completeness, retuns the tid id this debugger was created in.
Note Note Note:
The code was not orginally develpoed without threading in mind, if you wish to trace elemetns within a thread make sure you start an instance of the debugger within that thread.
=cut
has tid=>(
is=>'rw',
clearer=>1,
default=>sub {
my $tid=1;
( run in 0.862 second using v1.01-cache-2.11-cpan-4e7a2411597 )