summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MANIFEST1
-rw-r--r--lib/perl5db.t30
-rw-r--r--lib/perl5db/t/test-frame-option-126
3 files changed, 56 insertions, 1 deletions
diff --git a/MANIFEST b/MANIFEST
index df23ed2c32..3851de91a7 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -4337,6 +4337,7 @@ lib/perl5db/t/source-cmd-test.perldb TTests for the Perl debugger
lib/perl5db/t/symbol-table-bug Tests for the Perl debugger
lib/perl5db/t/taint Tests for the Perl debugger
lib/perl5db/t/test-dieLevel-option-1 Tests for the Perl debugger
+lib/perl5db/t/test-frame-option-1 Tests for the Perl debugger
lib/perl5db/t/test-l-statement-1 Tests for the Perl debugger
lib/perl5db/t/test-l-statement-2 Tests for the Perl debugger
lib/perl5db/t/test-m-statement-1 Tests for the Perl debugger
diff --git a/lib/perl5db.t b/lib/perl5db.t
index 0dfbd43d5b..dfd99b73bf 100644
--- a/lib/perl5db.t
+++ b/lib/perl5db.t
@@ -28,7 +28,7 @@ BEGIN {
}
}
-plan(103);
+plan(104);
my $rc_filename = '.perldb';
@@ -2476,6 +2476,34 @@ sub _calc_trace_wrapper
);
}
+# Test the o frame option.
+{
+ my $wrapper = DebugWrap->new(
+ {
+ cmds =>
+ [
+ # This is to avoid getting the "Debugger program terminated"
+ # junk that interferes with the normal output.
+ 'o inhibit_exit=0',
+ 'b 10',
+ 'c',
+ 'o frame=255',
+ 'c',
+ 'q',
+ ],
+ prog => '../lib/perl5db/t/test-frame-option-1',
+ }
+ );
+
+ $wrapper->contents_like(
+ qr/
+ in\s*\.=main::my_other_func\(3,\ 1200\)\ from.*?
+ out\s*\.=main::my_other_func\(3,\ 1200\)\ from
+ /msx,
+ "Test o PrintRet=0 in void context",
+ );
+}
+
END {
1 while unlink ($rc_filename, $out_fn);
}
diff --git a/lib/perl5db/t/test-frame-option-1 b/lib/perl5db/t/test-frame-option-1
new file mode 100644
index 0000000000..a6b4dd8c4f
--- /dev/null
+++ b/lib/perl5db/t/test-frame-option-1
@@ -0,0 +1,26 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+sub my_func
+{
+ my ($num1, $num2) = @_;
+
+ print $num1+$num2, "\n";
+
+ my_other_func ($num1*3, $num2*24);
+
+ return $num1*$num2;
+}
+
+sub my_other_func
+{
+ my ($num1, $num2) = @_;
+
+ print "my_other_func: n1=<$num1> n2=<$num2>\n";
+
+ return $num1 * $num2;
+}
+
+my_func(1, 50);