Permalink
Browse files

Build.PL: add recommended modules and change issues and repository. V…

…ersion follows http://perldoc.perl.org/perlmodstyle.html#Version-numbering. Line.pm: Add ranges for subroutines. DRY integration test code more.
  • Loading branch information...
1 parent 8899436 commit c5d59accaf01963477eb345a09eb2d840314bb38 Rocky Bernstein committed Aug 11, 2012
View
@@ -1,6 +1,6 @@
*~
/Build
-/Devel-Trepan-v0.*.tar.gz
+/Devel-Trepan-*.tar.gz
/MANIFEST.SKIP.bak
/MANIFEST.bak
/MYMETA.json
View
@@ -29,7 +29,15 @@ my $builder = Module::Build->new(
dist_version_from => 'lib/Devel/Trepan.pm',
license => 'gpl',
needs_compiler => 0,
- release_status => 'stable',
+ release_status => 'testing', # or 'stable'
+
+ meta_merge => {
+ resources => {
+ bugtracker => 'https://github.com/rocky/Perl-Devel-Trepan/issues',
+ repository => 'http://github.com/rocky/Perl-Devel-Trepan'
+ }
+ },
+
configure_requires => {
'Module::Build' => '0.32',
@@ -40,6 +48,12 @@ my $builder = Module::Build->new(
test_requires => {
'Test::More' => '0.81',
},
+ recommends => {
+ 'Term::ReadLine::Perl' => 0,
+ 'Eval::WithLexicals' => 0,
+ 'Data::Printer' => 0,
+ },
+
requires => {
'perl' => '5.008008',
'Array::Columnize' => '0.003005',
View
@@ -204,6 +204,7 @@ t/20test-display.t
t/20test-eval.t
t/20test-fin.t
t/20test-__FILE__.t
+t/20test-line.t
t/20test-list1.t
t/20test-list2.t
t/20test-list3.t
@@ -244,6 +245,7 @@ t/data/fin.right
t/data/fin2.cmd
t/data/fin2.right
t/data/line.cmd
+t/data/line.right
t/data/list1.cmd
t/data/list1.right
t/data/list2.cmd
View
@@ -50,7 +50,7 @@ how-to-make-a-release\.txt
\.tmp$
\.#
\.rej$
-\.try$
+\.tar.gz$
# Avoid OS-specific files/dirs
# Mac OSX metadata
View
@@ -20,14 +20,18 @@
}
},
"runtime" : {
+ "recommends" : {
+ "Data::Printer" : "0",
+ "Eval::WithLexicals" : "0",
+ "Term::ReadLine::Perl" : "0"
+ },
"requires" : {
"Array::Columnize" : "0.003005",
- "Data::Dumper::Perltidy" : "0",
+ "Data::Dumper" : "0",
"Digest::SHA" : "0",
"Getopt::Long" : "2.36",
"PadWalker" : "0",
"Syntax::Highlight::Perl::Improved" : "0",
- "Test::More" : "0.81",
"perl" : "5.008008",
"rlib" : "0.02",
"version" : "0"
@@ -39,6 +43,10 @@
"file" : "lib/Devel/Trepan/DB/LineCache.pm",
"version" : 0
},
+ "DB::fake" : {
+ "file" : "lib/Devel/Trepan/DB.pm",
+ "version" : 0
+ },
"DBBreak" : {
"file" : "lib/Devel/Trepan/DB/Breakpoint.pm",
"version" : 0
@@ -49,7 +57,7 @@
},
"Devel::Trepan" : {
"file" : "lib/Devel/Trepan.pm",
- "version" : "v0.2.1"
+ "version" : "0.30_01"
},
"Devel::Trepan::BrkptMgr" : {
"file" : "lib/Devel/Trepan/BrkptMgr.pm",
@@ -163,6 +171,10 @@
"file" : "lib/Devel/Trepan/CmdProcessor/Command/Info_Subcmd/Functions.pm",
"version" : 0
},
+ "Devel::Trepan::CmdProcessor::Command::Info::Line" : {
+ "file" : "lib/Devel/Trepan/CmdProcessor/Command/Info_Subcmd/Line.pm",
+ "version" : 0
+ },
"Devel::Trepan::CmdProcessor::Command::Info::Macros" : {
"file" : "lib/Devel/Trepan/CmdProcessor/Command/Info_Subcmd/Macros.pm",
"version" : 0
@@ -557,7 +569,7 @@
},
"Devel::Trepan::Options" : {
"file" : "lib/Devel/Trepan/Options.pm",
- "version" : "v0.2.1"
+ "version" : "v0.2.2"
},
"Devel::Trepan::SigHandler" : {
"file" : "lib/Devel/Trepan/SigHandler.pm",
@@ -584,11 +596,17 @@
"version" : 0
}
},
- "release_status" : "stable",
+ "release_status" : "testing",
"resources" : {
+ "bugtracker" : {
+ "web" : "https://github.com/rocky/Perl-Devel-Trepan/issues"
+ },
"license" : [
"http://www.gnu.org/licenses/old-licenses/gpl-1.0.txt"
- ]
+ ],
+ "repository" : {
+ "url" : "http://github.com/rocky/Perl-Devel-Trepan"
+ }
},
- "version" : "v0.2.1"
+ "version" : "0.30_01"
}
View
@@ -16,6 +16,9 @@ provides:
DB::LineCache:
file: lib/Devel/Trepan/DB/LineCache.pm
version: 0
+ DB::fake:
+ file: lib/Devel/Trepan/DB.pm
+ version: 0
DBBreak:
file: lib/Devel/Trepan/DB/Breakpoint.pm
version: 0
@@ -24,7 +27,7 @@ provides:
version: 0
Devel::Trepan:
file: lib/Devel/Trepan.pm
- version: v0.2.1
+ version: 0.30_01
Devel::Trepan::BrkptMgr:
file: lib/Devel/Trepan/BrkptMgr.pm
version: 0
@@ -109,6 +112,9 @@ provides:
Devel::Trepan::CmdProcessor::Command::Info::Functions:
file: lib/Devel/Trepan/CmdProcessor/Command/Info_Subcmd/Functions.pm
version: 0
+ Devel::Trepan::CmdProcessor::Command::Info::Line:
+ file: lib/Devel/Trepan/CmdProcessor/Command/Info_Subcmd/Line.pm
+ version: 0
Devel::Trepan::CmdProcessor::Command::Info::Macros:
file: lib/Devel/Trepan/CmdProcessor/Command/Info_Subcmd/Macros.pm
version: 0
@@ -405,7 +411,7 @@ provides:
version: 0
Devel::Trepan::Options:
file: lib/Devel/Trepan/Options.pm
- version: v0.2.1
+ version: v0.2.2
Devel::Trepan::SigHandler:
file: lib/Devel/Trepan/SigHandler.pm
version: 0
@@ -424,17 +430,22 @@ provides:
WatchPoint:
file: lib/Devel/Trepan/WatchMgr.pm
version: 0
+recommends:
+ Data::Printer: 0
+ Eval::WithLexicals: 0
+ Term::ReadLine::Perl: 0
requires:
Array::Columnize: 0.003005
- Data::Dumper::Perltidy: 0
+ Data::Dumper: 0
Digest::SHA: 0
Getopt::Long: 2.36
PadWalker: 0
Syntax::Highlight::Perl::Improved: 0
- Test::More: 0.81
perl: 5.008008
rlib: 0.02
version: 0
resources:
+ bugtracker: https://github.com/rocky/Perl-Devel-Trepan/issues
license: http://www.gnu.org/licenses/old-licenses/gpl-1.0.txt
-version: v0.2.1
+ repository: http://github.com/rocky/Perl-Devel-Trepan
+version: 0.30_01
View
@@ -8,7 +8,7 @@ package Devel::Trepan;
use strict;
use warnings;
use vars qw(@ISA @EXPORT @EXPORT_OK $VERSION);
-use version; $VERSION = '0.2.1';
+use version; $VERSION = '0.30_01';
use Exporter;
use Devel::Trepan::Core;
@@ -25,6 +25,7 @@ sub run($$)
my $frame = $proc->{frame};
my $filename = $proc->filename();
my $line;
+ my $end_line = undef;
my $arg_count = scalar @args;
if ($arg_count == 0) {
@@ -33,17 +34,33 @@ sub run($$)
if ($args[0] =~ /\d+/) {
$line = $args[0];
} else {
- $proc->msg("Expecting a line number, got ${args[0]}");
- return;
+ my @matches = $proc->{dbgr}->subs($args[0]);
+ if (scalar(@matches) == 1) {
+ $filename = $matches[0][0];
+ $line = $matches[0][1];
+ $end_line = $matches[0][2];
+ } else {
+ $proc->msg("Expecting a line number or fully qualified function; got ${args[0]}");
+ return;
+ }
}
}
- my $m = sprintf "Line %d, file %s", $line, $filename;
+ my $m;
+ my $canonic = $proc->canonic_file($filename);
+ if (defined $end_line) {
+ $m = sprintf("Function %s in file %s lines %d..%d",
+ $args[0], $canonic, $line, $end_line);
+ } else {
+ $m = sprintf "Line %d, file %s", $line, $canonic;
+ }
$proc->msg($m);
+ local(*DB::dbline) = "::_<$filename";
if (defined($DB::dbline[$line]) && 0 != $DB::dbline[$line]) {
$m = sprintf "COP address: 0x%x.", $DB::dbline[$line];
$proc->msg($m);
} else {
- $proc->msg("Line not showing as associated with code\n");
+ $proc->msg("Line not showing as associated with code\n")
+ unless $end_line;
}
}
@@ -17,10 +17,10 @@ our @ISA;
BEGIN {
$PROGRAM_NAME = 'trepan.pl';
- $VERSION = '0.2.2';
+ $VERSION = '0.30_01';
}
-use constant VERSION => $VERSION;
+use constant VERSION => $VERSION;
use constant PROGRAM_NAME => $PROGRAM_NAME;
@ISA = qw(Exporter);
View
@@ -1,7 +1,6 @@
#!/usr/bin/env perl
use warnings; use strict;
-use rlib '.';
-use Helper;
+use rlib '.'; use Helper;
no warnings 'redefine';
my $opts = {
@@ -19,7 +18,6 @@ my $opts = {
run_opts => " --basename --no-highlight -nx --fall-off-end"
};
-my $test_prog = File::Spec->catfile(dirname(__FILE__), qw(.. example gcd.pl));
-use Test::More;
-Helper::run_debugger("$test_prog 3 5", '__FILE__.cmd', undef, $opts);
+my $test_prog = prog_file('gcd.pl');
+run_debugger("$test_prog 3 5", cmd_file(), undef, $opts);
done_testing();
View
@@ -1,8 +1,7 @@
#!/usr/bin/env perl
use warnings; use strict;
-use rlib '.';
-use Helper;
-my $test_prog = File::Spec->catfile(dirname(__FILE__), qw(.. example gcd.pl));
-use Test::More;
-Helper::run_debugger("$test_prog 3 5", 'alias.cmd');
+use rlib '.'; use Helper;
+
+my $test_prog = prog_file('gcd.pl');
+run_debugger("$test_prog 3 5", cmd_file());
done_testing();
View
@@ -1,6 +1,5 @@
#!/usr/bin/env perl
use warnings; use strict; use English;
-use File::Basename; use File::Spec;
use Test::More;
use Config;
@@ -12,9 +11,7 @@ if (($OSNAME eq 'netbsd' or $OSNAME eq 'freebsd' or $OSNAME eq 'darwin')
"NetBSD and FreeBSD multi with PERL_PRESERVE_IVUV probably has a bug";
}
-use rlib '.';
-use Helper;
-my $test_prog = File::Spec->catfile(dirname(__FILE__),
- qw(.. example gcd.pl));
-Helper::run_debugger("$test_prog 3 5", 'autolist.cmd');
+use rlib '.'; use Helper;
+my $test_prog = prog_file('gcd.pl');
+run_debugger("$test_prog 3 5", 'autolist.cmd');
done_testing();
View
@@ -1,9 +1,8 @@
#!/usr/bin/env perl
use warnings; use strict;
-use rlib '.';
-use Helper;
-my $test_prog = File::Spec->catfile(dirname(__FILE__), qw(.. example gcd.pl));
-use Test::More;
+use rlib '.'; use Helper;
+my $test_prog = prog_file('gcd.pl');
+
my $opts = {
filter => sub{
my ($got_lines, $correct_lines) = @_;
@@ -31,10 +30,9 @@ my $opts = {
},
run_opts => " --no-highlight --basename -nx --testing"
};
-Helper::run_debugger("$test_prog 3 5", 'break.cmd', undef, $opts);
+run_debugger("$test_prog 3 5", 'break.cmd', undef, $opts);
-$test_prog = File::Spec->catfile(dirname(__FILE__),
- qw(.. example TCPPack.pm));
+$test_prog = prog_file('TCPPack.pm');
$opts = {
filter => sub{
my ($got_lines, $correct_lines) = @_;
@@ -56,5 +54,5 @@ $opts = {
run_opts => " --no-highlight --basename -nx --testing"
};
-Helper::run_debugger("$test_prog", 'break2.cmd', undef, $opts);
+run_debugger("$test_prog", 'break2.cmd', undef, $opts);
done_testing();
View
@@ -1,8 +1,7 @@
#!/usr/bin/env perl
use warnings; use strict;
-use rlib '.';
-use Helper;
-my $test_prog = File::Spec->catfile(dirname(__FILE__), qw(.. example gcd.pl));
-use Test::More;
-Helper::run_debugger("$test_prog 3 5", 'display.cmd');
+use rlib '.'; use Helper;
+
+my $test_prog = prog_file('gcd.pl');
+run_debugger("$test_prog 3 5", cmd_file());
done_testing();
View
@@ -1,7 +1,6 @@
#!/usr/bin/env perl
use warnings; use strict;
-use rlib '.';
-use Helper;
+use rlib '.'; use Helper;
my $opts = {
filter => sub{
@@ -17,7 +16,6 @@ my $opts = {
run_opts => " --basename --no-highlight -nx --fall-off-end"
};
-my $test_prog = File::Spec->catfile(dirname(__FILE__), qw(.. example gcd.pl));
-use Test::More;
-Helper::run_debugger("$test_prog 3 5", 'dollar0.cmd', undef, $opts);
+my $test_prog = prog_file('gcd.pl');
+run_debugger("$test_prog 3 5", cmd_file(), undef, $opts);
done_testing();
Oops, something went wrong.

0 comments on commit c5d59ac

Please sign in to comment.