| 1 | package Devel::ebug::Backend::Plugin::Run; | ||||||||||
| 2 | |||||||||||
| 3 | 6 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 6 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 6 | our $VERSION = '0.69'; # VERSION | |||||||||
| 7 | |||||||||||
| 8 | 6 | ▶ | sub register_commands { | ||||||||
|
Subroutine
register_commands: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 9 | return ( | ||||||||||
| 10 | 6 | next => { sub => \&next, record => 1 }, | |||||||||
| 11 | return => { sub => \&return, record => 1 }, | ||||||||||
| 12 | run => { sub => \&run, record => 1 }, | ||||||||||
| 13 | step => { sub => \&step, record => 1 }, | ||||||||||
| 14 | ); | ||||||||||
| 15 | } | ||||||||||
| 16 | |||||||||||
| 17 | 3 | ▶ | sub next { | ||||||||
|
Subroutine
next: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 18 | 3 | my($req, $context) = @_; | |||||||||
| 19 | 3 | $context->{mode} = "next"; # single step (but over subroutines) | |||||||||
| 20 | 3 | $context->{last} = 1; # and out of the loop | |||||||||
| 21 | 3 | return {}; | |||||||||
| 22 | } | ||||||||||
| 23 | |||||||||||
| 24 | 0 | ▶ | sub return { | ||||||||
|
Subroutine
return: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||
| 25 | 0 | my($req, $context) = @_; | |||||||||
| 26 | 0 | ▶ | if ($req->{values}) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 27 | 0 | $context->{stack}->[0]->{'return'} = $req->{values}; | |||||||||
| 28 | } | ||||||||||
| 29 | 0 | $context->{mode} = "return"; # run until returned from subroutine | |||||||||
| 30 | 0 | $DB::single = 0; # run | |||||||||
| 31 | 0 | ▶ | if ($context->{stack}->[-1]) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 32 | 0 | $context->{stack}->[-1]->{single} = 1; # single step higher up | |||||||||
| 33 | } | ||||||||||
| 34 | 0 | $context->{last} = 1; # and out of the loop | |||||||||
| 35 | 0 | return {}; | |||||||||
| 36 | } | ||||||||||
| 37 | |||||||||||
| 38 | 10 | ▶ | sub run { | ||||||||
|
Subroutine
run: called CC=2 SCAR=7.1
Pod
undocumented
| |||||||||||
| 39 | 10 | my($req, $context) = @_; | |||||||||
| 40 | # a SIGINT that arrived while we were stopped is stale; don't let it | ||||||||||
| 41 | # stop us again at the very next statement | ||||||||||
| 42 | 10 | $DB::signal = 0; | |||||||||
| 43 | 10 | $context->{mode} = "run"; # run until break point | |||||||||
| 44 | 10 | ▶ | if (@{$context->{watch_points}}) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 45 | # watch points, let's go slow | ||||||||||
| 46 | 0 | $context->{watch_single} = 0; | |||||||||
| 47 | } else { | ||||||||||
| 48 | # no watch points? let's go fast! | ||||||||||
| 49 | 10 | $DB::single = 0; # run until next break point | |||||||||
| 50 | } | ||||||||||
| 51 | 10 | $context->{last} = 1; # and out of the loop | |||||||||
| 52 | 10 | return {}; | |||||||||
| 53 | } | ||||||||||
| 54 | |||||||||||
| 55 | |||||||||||
| 56 | 2 | ▶ | sub step { | ||||||||
|
Subroutine
step: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 57 | 2 | my($req, $context) = @_; | |||||||||
| 58 | 2 | $DB::single = 1; # single step | |||||||||
| 59 | 2 | $context->{mode} = "step"; # single step (into subroutines) | |||||||||
| 60 | 2 | $context->{last} = 1; # and out of the loop, onto the next command | |||||||||
| 61 | 2 | return {}; | |||||||||
| 62 | } | ||||||||||
| 63 | |||||||||||
| 64 | |||||||||||
| 65 | 6 | 1; | |||||||||
| 66 | |||||||||||
| 67 | __END__ | ||||||||||