Skip to content

Commit

Permalink
Handle version comparisons more properly
Browse files Browse the repository at this point in the history
  • Loading branch information
rocky committed Jun 7, 2014
1 parent 929f432 commit 00177ee
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
Expand Up @@ -29,6 +29,7 @@ L<C<set display>|Devel::Trepan::CmdProcessor::Command::Set::Display>
=cut
EOH
our $SHORT_HELP = 'Show display-related controls';

@ISA = qw(Devel::Trepan::CmdProcessor::Command::SubsubcmdMgr);


Expand Down
2 changes: 1 addition & 1 deletion lib/Devel/Trepan/CmdProcessor/Command/Show_Subcmd/Trace.pm
Expand Up @@ -31,9 +31,9 @@ I<name> for help on a particular trace subcommand.
=cut
HELP
our $SHORT_HELP = 'Show tracing event-related controls';

@ISA = qw(Devel::Trepan::CmdProcessor::Command::SubsubcmdMgr);
our $SHORT_HELP = 'Show tracing event-related controls';

# sub run($$)
# {
Expand Down
4 changes: 3 additions & 1 deletion lib/Devel/Trepan/DB.pm
Expand Up @@ -20,6 +20,7 @@ and merged with DB that perl5db.pl and other uses similar ilk.
package DB;
use warnings; no warnings 'redefine';
use English qw( -no_match_vars );
use version;

use Devel::Trepan::DB::Vars;
use Devel::Trepan::DB::Backtrace;
Expand Down Expand Up @@ -78,7 +79,8 @@ BEGIN {
$frame = 0;

if (eval("use Devel::Callsite; 1")) {
if ($Devel::Callsite::VERSION >= 0.08) {
if (version->parse("$Devel::Callsite::VERSION") >=
version->parse('0.08')) {
$HAVE_MODULE{'Devel::Callsite'} = 'call_level_param';
} else {
$HAVE_MODULE{'Devel::Callsite'} = 'single_level';
Expand Down
7 changes: 5 additions & 2 deletions lib/Devel/Trepan/DB/Sub.pm
Expand Up @@ -5,6 +5,7 @@ package DB;
use warnings; no warnings 'redefine'; use utf8;
no warnings 'once';
use English qw( -no_match_vars );
use version;

use constant SINGLE_STEPPING_EVENT => 1;
use constant NEXT_STEPPING_EVENT => 2;
Expand Down Expand Up @@ -54,7 +55,8 @@ sub subcall_debugger {

local $OP_addr =
($HAVE_MODULE{'Devel::Callsite'} &&
$Devel::Callsite::VERSION >= 0.08)
version->parse("$Devel::Callsite::VERSION") >=
version->parse('0.08'))
? Devel::Callsite::callsite(1) : undef;

$DB::subroutine = $sub;
Expand Down Expand Up @@ -173,7 +175,8 @@ sub check_for_stop() {
$DB::wantarray = wantarray;
local $OP_addr =
($HAVE_MODULE{'Devel::Callsite'} &&
$Devel::Callsite::VERSION >= 0.08)
version->parse("$Devel::Callsite::VERSION") >=
version->parse("0.08"))
? Devel::Callsite::callsite(1) : undef;
&subcall_debugger() ;
last;
Expand Down

0 comments on commit 00177ee

Please sign in to comment.