Permalink
Browse files

Core.pm: allow for running Bullwinkle in batch by passing through opt…

…ions. rest: small changes
  • Loading branch information...
1 parent d9e3028 commit 588e2bd2b9a121fcdf741abd20bf16542b9b4139 Rocky Bernstein committed Dec 15, 2012
Showing with 17 additions and 5 deletions.
  1. +12 −3 lib/Devel/Trepan/Core.pm
  2. +1 −1 lib/Devel/Trepan/Interface/Script.pm
  3. +2 −1 t/Helper.pm
  4. +1 −0 t/data/eval2.cmd
  5. +1 −0 t/data/eval2.right
View
@@ -123,18 +123,27 @@ sub awaken($;$) {
$SIG{__DIE__} = \&DB::catch if $opts->{post_mortem};
my $proc;
+ my $batch_filename = $opts->{testing};
if ($opts->{bw} && $HAVE_BULLWINKLE) {
- $proc = Devel::Trepan::BWProcessor->new(undef, $self);
+ my $bw_opts = undef;
+ if (defined $batch_filename) {
+ my $fh = IO::File->new($batch_filename, 'r');
+ $bw_opts = {input => $fh,
+ bw_opts => {
+ echo_read => 1,
+ input_opts => {readline => 0}}
+ };
+ }
+ $proc = Devel::Trepan::BWProcessor->new(undef, $self, $bw_opts);
} else {
+ $batch_filename = $opts->{batchfile} unless defined $batch_filename;
my %cmdproc_opts = ();
for my $field
(qw(basename cmddir highlight readline traceprint)) {
# print "field $field $opts->{$field}\n";
$cmdproc_opts{$field} = $opts->{$field};
}
- my $batch_filename = $opts->{testing};
- $batch_filename = $opts->{batchfile} unless defined $batch_filename;
if (defined $batch_filename) {
my $result = Devel::Trepan::Util::invalid_filename($batch_filename);
if (defined $result) {
@@ -37,7 +37,7 @@ sub new
my $self = {};
# FIXME if $script_name is invalid, we get undef $fh and then
# Interface->new uses STDIN.
- my $fh = IO::File->new($script_name, "r");
+ my $fh = IO::File->new($script_name, 'r');
$self = Devel::Trepan::Interface->new($fh, $out, $opts);
$self->{script_name} = $script_name;
$self->{input_lineno} = 0;
View
@@ -34,7 +34,8 @@ sub prog_file(;$)
if (scalar(@_)) {
$prog = shift;
} else {
- my ($pkg, $prog) = caller;
+ my $pkg;
+ ($pkg, $prog) = caller;
$prog .= '.pl'
}
return File::Spec->catfile(dirname(__FILE__), qw(.. example), $prog)
View
@@ -1,6 +1,7 @@
# 2nd part of test of eval debugger command
# Use with example/eval.pl
set display eval dumper
+set max width 80
set auto eval on
list
s
View
@@ -7,6 +7,7 @@ $x = 2;
$y = 3;
$z = 4';
Eval result display style is dumper.
+set max width is 80.
set auto eval is on.
eval.pl [1-10]
1 -> $var = '

0 comments on commit 588e2bd

Please sign in to comment.