Browse files

Don't truncate strings in output which can bolix regex compares in te…

…sting. Add better POD documentation on some "set" commands and narrow use of rlib there too.
  • Loading branch information...
1 parent e43b8f4 commit 430879de4354340cdc748fb9d3b108927d3be67b Rocky Bernstein committed Jun 19, 2013
View
18 META.json
@@ -14,6 +14,11 @@
},
"name" : "Devel-Trepan",
"prereqs" : {
+ "build" : {
+ "requires" : {
+ "rlib" : "0.02"
+ }
+ },
"configure" : {
"requires" : {
"Module::Build" : "0.32"
@@ -27,12 +32,13 @@
"Eval::WithLexicals" : "0",
"Pod::Text::Color" : "2.06",
"Term::ReadKey" : "0",
- "Term::ReadLine::Perl5" : "1.08"
+ "Term::ReadLine::Perl5" : "1.09"
},
"requires" : {
"Array::Columnize" : "1.04",
"Data::Dumper" : "0",
"Digest::SHA" : "0",
+ "File::HomeDir" : "0.54",
"Getopt::Long" : "2.36",
"PadWalker" : "0",
"Pod::Text" : "3.13",
@@ -55,7 +61,7 @@
},
"Devel::Trepan" : {
"file" : "lib/Devel/Trepan.pm",
- "version" : "0.49"
+ "version" : "0.49_01"
},
"Devel::Trepan::BrkptMgr" : {
"file" : "lib/Devel/Trepan/BrkptMgr.pm",
@@ -651,7 +657,7 @@
},
"Devel::Trepan::Options" : {
"file" : "lib/Devel/Trepan/Options.pm",
- "version" : "0.37"
+ "version" : 0
},
"Devel::Trepan::Pod2Text" : {
"file" : "lib/Devel/Trepan/Pod2Text.pm",
@@ -679,7 +685,7 @@
},
"Devel::Trepan::Version" : {
"file" : "lib/Devel/Trepan/Version.pm",
- "version" : "0.49"
+ "version" : "0.49_01"
},
"Devel::Trepan::WatchMgr" : {
"file" : "lib/Devel/Trepan/WatchMgr.pm",
@@ -698,7 +704,7 @@
"version" : 0
}
},
- "release_status" : "stable",
+ "release_status" : "testing",
"resources" : {
"bugtracker" : {
"web" : "https://github.com/rocky/Perl-Devel-Trepan/issues"
@@ -710,5 +716,5 @@
"url" : "http://github.com/rocky/Perl-Devel-Trepan"
}
},
- "version" : "0.49"
+ "version" : "0.49_01"
}
View
14 META.yml
@@ -2,7 +2,8 @@
abstract: "Modular Perl Debugger (akin to Ruby \"Trepanning\" Debuggers)."
author:
- 'Rocky Bernstein <rocky@cpan.org>'
-build_requires: {}
+build_requires:
+ rlib: 0.02
configure_requires:
Module::Build: 0.32
dynamic_config: 1
@@ -21,7 +22,7 @@ provides:
version: 0
Devel::Trepan:
file: lib/Devel/Trepan.pm
- version: 0.49
+ version: 0.49_01
Devel::Trepan::BrkptMgr:
file: lib/Devel/Trepan/BrkptMgr.pm
version: 0
@@ -468,7 +469,7 @@ provides:
version: 0
Devel::Trepan::Options:
file: lib/Devel/Trepan/Options.pm
- version: 0.37
+ version: 0
Devel::Trepan::Pod2Text:
file: lib/Devel/Trepan/Pod2Text.pm
version: 0
@@ -489,7 +490,7 @@ provides:
version: 0
Devel::Trepan::Version:
file: lib/Devel/Trepan/Version.pm
- version: 0.49
+ version: 0.49_01
Devel::Trepan::WatchMgr:
file: lib/Devel/Trepan/WatchMgr.pm
version: 0
@@ -509,11 +510,12 @@ recommends:
Eval::WithLexicals: 0
Pod::Text::Color: 2.06
Term::ReadKey: 0
- Term::ReadLine::Perl5: 1.08
+ Term::ReadLine::Perl5: 1.09
requires:
Array::Columnize: 1.04
Data::Dumper: 0
Digest::SHA: 0
+ File::HomeDir: 0.54
Getopt::Long: 2.36
PadWalker: 0
Pod::Text: 3.13
@@ -526,4 +528,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.49
+version: 0.49_01
View
23 lib/Devel/Trepan/CmdProcessor/Command/Set_Subcmd/Auto_Subcmd/Eval.pm
@@ -1,10 +1,15 @@
# -*- coding: utf-8 -*-
-# Copyright (C) 2011-2012 Rocky Bernstein <rocky@cpan.org>
+# Copyright (C) 2011-2013 Rocky Bernstein <rocky@cpan.org>
use warnings; no warnings 'redefine'; no warnings 'once';
-use rlib '../../../../../..';
package Devel::Trepan::CmdProcessor::Command::Set::Auto::Eval;
-use Devel::Trepan::CmdProcessor::Command::Subcmd::Subsubcmd;
+
+BEGIN {
+ my @OLD_INC = @INC;
+ use rlib '../../../../../..';
+ use Devel::Trepan::CmdProcessor::Command::Subcmd::Subsubcmd;
+ @INC = @OLD_INC
+};
use strict;
use vars qw(@ISA @SUBCMD_VARS);
@@ -17,14 +22,18 @@ our $IN_LIST = 1;
our $HELP = <<'HELP';
=pod
+=pod
+
+B<set auto <eval> [B<on>|B<off>]
+
Evaluate unrecognized debugger commands.
Often inside the debugger, one would like to be able to run arbitrary
Perl commands without having to preface expressions with C<print> or
C<eval>. Setting C<auto eval> on will cause unrecognized debugger
-commands to be evaluated as a Perl expression.
+commands to be evaluated as a Perl expression.
-If the expression starts with %, @, or $ the context will be set
+If the expression starts with %, @, or $ the context will be set
to a hash, array or scalar accordingly.
Note that if auto eval is set, the message shown on type a bad
@@ -46,14 +55,14 @@ is not a Perl substitute command but a "step" command when 'auto eval'
is on because by default, C<s> is an alias for the debugger C<step>
command. It is possible to remove that alias if this causes constant
problem. Another possibility is to go into a real shell via the
-C<shell> command.
+C<shell> command.
=cut
HELP
our $MIN_ABBREV = length('ev');
use constant MAX_ARGS => 1;
our $SHORT_HELP = "Set evaluation of unrecognized debugger commands";
-
+
unless (caller) {
# Demo it.
# require_relative '../../../mock'
View
17 lib/Devel/Trepan/CmdProcessor/Command/Set_Subcmd/Auto_Subcmd/List.pm
@@ -1,10 +1,15 @@
# -*- coding: utf-8 -*-
-# Copyright (C) 2011-2012 Rocky Bernstein <rocky@cpan.org>
+# Copyright (C) 2011-2013 Rocky Bernstein <rocky@cpan.org>
use warnings; no warnings 'redefine'; no warnings 'once';
-use rlib '../../../../../..';
package Devel::Trepan::CmdProcessor::Command::Set::Auto::List;
-use Devel::Trepan::CmdProcessor::Command::Subcmd::Subsubcmd;
+
+BEGIN {
+ my @OLD_INC = @INC;
+ use rlib '../../../../../..';
+ use Devel::Trepan::CmdProcessor::Command::Subcmd::Subsubcmd;
+ @INC = @OLD_INC
+};
use strict;
use vars qw(@ISA @SUBCMD_VARS);
@@ -17,14 +22,16 @@ our $IN_LIST = 1;
our $HELP = <<'HELP';
=pod
+B<set auto list> [B<on>|B<off>]
+
Set to run a C<list> command each time we enter the debugger.
=cut
HELP
our $MIN_ABBREV = length('li');
use constant MAX_ARGS => 1;
our $SHORT_HELP = "Set to run a 'list' command each time we enter the debugger";
-
+
sub run($$)
{
my ($self, $args) = @_;
@@ -44,7 +51,7 @@ unless (caller) {
# name = File.basename(__FILE__, '.rb')
# dbgr, set_cmd = MockDebugger::setup('set')
- # max_cmd = Trepan::SubSubcommand::SetMax.new(dbgr.core.processor,
+ # max_cmd = Trepan::SubSubcommand::SetMax.new(dbgr.core.processor,
# set_cmd)
# cmd_ary = Trepan::SubSubcommand::SetMaxList::PREFIX
# cmd_name = cmd_ary.join(' ')
View
25 lib/Devel/Trepan/CmdProcessor/Command/Set_Subcmd/Max_Subcmd/String.pm
@@ -1,10 +1,15 @@
# -*- coding: utf-8 -*-
-# Copyright (C) 2011-2012 Rocky Bernstein <rocky@cpan.org>
+# Copyright (C) 2011-2013 Rocky Bernstein <rocky@cpan.org>
use warnings; no warnings 'redefine'; no warnings 'once';
-use rlib '../../../../../..';
package Devel::Trepan::CmdProcessor::Command::Set::Max::String;
-use Devel::Trepan::CmdProcessor::Command::Subcmd::Subsubcmd;
+
+BEGIN {
+ my @OLD_INC = @INC;
+ use rlib '../../../../../..';
+ use Devel::Trepan::CmdProcessor::Command::Subcmd::Subsubcmd;
+ @INC = @OLD_INC
+};
use strict;
use vars qw(@ISA @SUBCMD_VARS);
@@ -14,13 +19,17 @@ use vars qw(@ISA @SUBCMD_VARS);
use vars @Devel::Trepan::CmdProcessor::Command::Subsubcmd::SUBCMD_VARS;
our $IN_LIST = 1;
-our $HELP = 'Set max st[ring] NUMBER
+our $HELP = <<'HELP';
+=pod
+
+B<Set max st>[B<ring>] I<number>
Sometimes the string representation of an object is very long. This
setting limits how much of the string representation you want to
see. However if the string has an embedded newline then we will assume
the output is intended to be formated as is.
-';
+=cut
+HELP
our $MIN_ABBREV = length('str');
our $SHORT_HELP = "Set maximum chars in a string before truncation";
@@ -31,8 +40,8 @@ sub run($$)
my @args = @$args;
shift @args; shift @args; shift @args;
my $num_str = join(' ', @args);
- $self->run_set_int($num_str,
- "The '$self->{cmd_str}' command requires a line width",
+ $self->run_set_int($num_str,
+ "The '$self->{cmd_str}' command requires a line width",
0);
}
@@ -42,7 +51,7 @@ unless (caller) {
# name = File.basename(__FILE__, '.rb')
# dbgr, set_cmd = MockDebugger::setup('set')
- # max_cmd = Trepan::SubSubcommand::SetMax.new(dbgr.core.processor,
+ # max_cmd = Trepan::SubSubcommand::SetMax.new(dbgr.core.processor,
# set_cmd)
# cmd_ary = Trepan::SubSubcommand::SetMaxString::PREFIX
# cmd_name = cmd_ary.join(' ')
View
2 t/data/debug.cmd
@@ -2,6 +2,8 @@
set basename on
set highlight off
set autoeval on
+# Unlimited string length
+set max string 0
set display eval dumper
# A should be undefined here.
$a
View
1 t/data/debug.right
@@ -4,6 +4,7 @@ die sprintf "Need two integer arguments, got %d", scalar(@ARGV) unless
basename is on.
highlight is off.
set auto eval is on.
+set max string is 0.
Eval result display style is dumper.
$DB::D[0] = <undef>
-- main::((eval 1955)[Eval.pm:73] remapped bogus.pl:6)
View
2 t/data/eval.cmd
@@ -1,5 +1,7 @@
# test of eval and bugs we once had.
# use with example/gcd.pl 3 5
+# Unlimited string length
+set max string 0
set auto eval on
set display eval dumper
1 + 2
View
1 t/data/eval.right
@@ -1,6 +1,7 @@
-- main::(gcd.pl:18)
die sprintf "Need two integer arguments, got %d", scalar(@ARGV) unless
@ARGV == 2;
+set max string is 0.
set auto eval is on.
Eval result display style is dumper.
$DB::D[0] = 3
View
5 t/data/eval2.cmd
@@ -1,8 +1,10 @@
# 2nd part of test of eval debugger command
# Use with example/eval.pl
set display eval dumper
-set max width 80
+set max width 300
set auto eval on
+# Unlimited string length
+set max string 0
list
s
print "--\n";
@@ -16,4 +18,3 @@ s
s
s
bt
-
View
6 t/data/eval2.right
@@ -7,8 +7,9 @@ $x = 2;
$y = 3;
$z = 4';
Eval result display style is dumper.
-set max width is 80.
+set max width is 300.
set auto eval is on.
+set max string is 0.
eval.pl [1-10]
1 -> $var = '
2 # This line is not a comment of the above $var assignment
@@ -49,7 +50,4 @@ eval $eval_sub;
$y = five();
-- main::((eval 1955)[eval.pl:10]:3 remapped bogus.pl:3)
my @args = @_;
---> #0 @ = main::five() in
- file `(eval 1000)[eval.pl:13]' at line 3
- #1 file `eval.pl' at line 14
trepan.pl: That's all, folks...

0 comments on commit 430879d

Please sign in to comment.