Skip to content

Commit

Permalink
Breakpoint.pm: remove duplicate code and possibly deal with a failing…
Browse files Browse the repository at this point in the history
… "find_subline". Is it Build.PL ok to drop Version dependency that smokers erroniously suggested we needed? Bump version.
  • Loading branch information
Rocky Bernstein committed Sep 27, 2012
1 parent 9d1b3fa commit d23516f
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 37 deletions.
1 change: 0 additions & 1 deletion Build.PL
Expand Up @@ -74,7 +74,6 @@ my $builder = Module::Build->new(
# 'Capture::Tiny' => 0,
'Data::Dumper' => 0,
'Getopt::Long' => '2.36',
'Devel::Trepan::Version' => 0,
'Digest::SHA' => 0,
'PadWalker' => 0,
'Pod::Text' => 3.13,
Expand Down
28 changes: 16 additions & 12 deletions META.json
Expand Up @@ -4,7 +4,7 @@
"Rocky Bernstein <rocky@cpan.org>"
],
"dynamic_config" : 1,
"generated_by" : "Module::Build version 0.4, CPAN::Meta::Converter version 2.120921",
"generated_by" : "Module::Build version 0.4, CPAN::Meta::Converter version 2.112150",
"license" : [
"open_source"
],
Expand All @@ -21,24 +21,24 @@
},
"runtime" : {
"recommends" : {
"Data::Printer" : "0",
"Data::Printer" : 0,
"Devel::Callsite" : "0.05",
"Eval::WithLexicals" : "0",
"Eval::WithLexicals" : 0,
"Pod::Text::Color" : "2.06",
"Term::ReadKey" : "0",
"Term::ReadLine::Perl" : "0"
"Term::ReadKey" : 0,
"Term::ReadLine::Perl" : 0
},
"requires" : {
"Array::Columnize" : "1.01",
"Data::Dumper" : "0",
"Digest::SHA" : "0",
"Data::Dumper" : 0,
"Digest::SHA" : 0,
"Getopt::Long" : "2.36",
"PadWalker" : "0",
"PadWalker" : 0,
"Pod::Text" : "3.13",
"Syntax::Highlight::Perl::Improved" : "1.01",
"perl" : "5.008008",
"rlib" : "0.02",
"version" : "0"
"version" : 0
}
}
},
Expand All @@ -57,7 +57,7 @@
},
"Devel::Trepan" : {
"file" : "lib/Devel/Trepan.pm",
"version" : 0
"version" : "0.43"
},
"Devel::Trepan::BrkptMgr" : {
"file" : "lib/Devel/Trepan/BrkptMgr.pm",
Expand Down Expand Up @@ -655,6 +655,10 @@
"file" : "lib/Devel/Trepan/Util.pm",
"version" : 0
},
"Devel::Trepan::Version" : {
"file" : "lib/Devel/Trepan/Version.pm",
"version" : "0.44_01"
},
"Devel::Trepan::WatchMgr" : {
"file" : "lib/Devel/Trepan/WatchMgr.pm",
"version" : 0
Expand All @@ -668,7 +672,7 @@
"version" : 0
}
},
"release_status" : "stable",
"release_status" : "testing",
"resources" : {
"bugtracker" : {
"web" : "https://github.com/rocky/Perl-Devel-Trepan/issues"
Expand All @@ -680,5 +684,5 @@
"url" : "http://github.com/rocky/Perl-Devel-Trepan"
}
},
"version" : "0.43"
"version" : "0.44_01"
}
9 changes: 6 additions & 3 deletions META.yml
Expand Up @@ -6,7 +6,7 @@ build_requires: {}
configure_requires:
Module::Build: 0.32
dynamic_config: 1
generated_by: 'Module::Build version 0.4, CPAN::Meta::Converter version 2.120921'
generated_by: 'Module::Build version 0.4, CPAN::Meta::Converter version 2.112150'
license: open_source
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
Expand All @@ -24,7 +24,7 @@ provides:
version: 0
Devel::Trepan:
file: lib/Devel/Trepan.pm
version: 0
version: 0.43
Devel::Trepan::BrkptMgr:
file: lib/Devel/Trepan/BrkptMgr.pm
version: 0
Expand Down Expand Up @@ -472,6 +472,9 @@ provides:
Devel::Trepan::Util:
file: lib/Devel/Trepan/Util.pm
version: 0
Devel::Trepan::Version:
file: lib/Devel/Trepan/Version.pm
version: 0.44_01
Devel::Trepan::WatchMgr:
file: lib/Devel/Trepan/WatchMgr.pm
version: 0
Expand Down Expand Up @@ -503,4 +506,4 @@ resources:
bugtracker: https://github.com/rocky/Perl-Devel-Trepan/issues
license: http://www.gnu.org/licenses/old-licenses/gpl-1.0.txt
repository: http://github.com/rocky/Perl-Devel-Trepan
version: 0.43
version: 0.44_01
22 changes: 2 additions & 20 deletions lib/Devel/Trepan/DB/Breakpoint.pm
Expand Up @@ -78,32 +78,14 @@ sub find_subline($) {
my($filename, $from, $to) = ($DB::sub{$fn_name} =~ /^(.*):(\d+)-(\d+)$/);
if ($from) {
local *DB::dbline = "::_<$filename";
++$from while $DB::dbline[$from] == 0 && $from < $to;
++$from while $DB::dbline[$from] && $DB::dbline[$from] == 0 &&
$from < $to;
return ($filename, $fn_name, $from);
}
}
return (undef, undef, undef);
}

# Find a subroutine line.
# FIXME: reorganize things to really set a breakpoint at a subroutine.
# not just the line number we that we might find subroutine on.
sub _find_subline {
my $name = shift;
$name =~ s/\'/::/;
$name = "${DB::package}\:\:" . $name if $name !~ /::/;
$name = "main" . $name if substr($name,0,2) eq "::";
if (exists $DB::sub{$name}) {
my($fname, $from, $to) = ($DB::sub{$name} =~ /^(.*):(\d+)-(\d+)$/);
if ($from) {
local *DB::dbline = "::_<$fname";
++$from while $DB::dbline[$from] == 0 && $from < $to;
return $from;
}
}
return undef;
}

# Return a warning message if breakpoint position is invalid.
# undef is returned if the breakpont is valid.
sub break_invalid {
Expand Down
2 changes: 1 addition & 1 deletion lib/Devel/Trepan/Version.pm
@@ -1,3 +1,3 @@
package Devel::Trepan::Version;
use version; $VERSION = '0.44';
use version; $VERSION = '0.44_01';
1;

0 comments on commit d23516f

Please sign in to comment.