summaryrefslogtreecommitdiff
path: root/lib/perl5db
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2020-03-30 16:32:46 +1100
committerTony Cook <tony@develop-help.com>2020-08-10 04:47:53 +0000
commitb334474a337421c6643b872388245fb2c11bf995 (patch)
tree54ad3892922256baa57f6b9981fa360c71b0403e /lib/perl5db
parent55507ac1d99efa7f407df8ebcf9f6683532679f8 (diff)
downloadperl-b334474a337421c6643b872388245fb2c11bf995.tar.gz
fix C<i $obj> where $obj is a lexical
the DB::eval function depends on the special behaviour of eval "" within the DB package, which evaluates the string within the context of the first non-DB sub or eval scope, working up the call stack. The debugger refactor moved handling for the 'i' command from the DB package to the DB::Obj package, so the eval in DB::eval was working in the context of the DB::Obj::cmd_i function, not in the calling scope. Fixed by moving the handling for the i command back to DB. Fixes #17661.
Diffstat (limited to 'lib/perl5db')
-rw-r--r--lib/perl5db/t/gh-1766114
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/perl5db/t/gh-17661 b/lib/perl5db/t/gh-17661
new file mode 100644
index 0000000000..0d85977b35
--- /dev/null
+++ b/lib/perl5db/t/gh-17661
@@ -0,0 +1,14 @@
+use v5.10.0;
+
+{ package C1; sub c1 { } our @ISA = qw(C2) }
+{ package C2; sub c2 { } our @ISA = qw(C3) }
+{ package C3; sub c3 { } our @ISA = qw( ) }
+{ package C4; sub c4 { } our @ISA = qw( ) }
+{ package C5; sub c5 { } our @ISA = qw(C1 C4) }
+
+my $obj = bless {}, 'C5';
+$main::global = bless {}, 'C5';
+
+$DB::single = 1;
+
+say "Done.";