http://qs321.pair.com?node_id=11110616


in reply to Debugger line numbering anomaly

Bisecting this was a bit tricky, but the results are that the regression was accidentally introduced in 6432a58, reported as RT#131930, and fixed in 823ba44 - the bug should therefore only exist in Perl releases v5.26.*.

#!/usr/bin/env perl use warnings; use strict; use Data::Dumper; $Data::Dumper::Useqq=1; # Run from the perl5 source tree: # $ ./Porting/bisect.pl --start=v5.24.0 --end=v5.26.3 -- + ./perl -Ilib /path/to/this.pl # => 6432a58ad9a504c2dc834eb0d131a10b4b6c886b # $ ./Porting/bisect.pl --start=v5.26.0 --end=v5.28.2 --expect-fail -- + ./perl -Ilib /path/to/this.pl # => 823ba440369100de3f2693420a3887a645a57d28 open my $ofh, '>', '/tmp/testdb.pl' or die $!; print $ofh <<'END_SCRIPT'; #!/bin/perl -w use strict; $_ = shift // ''; # line 3 s{a([bc])} # 4 {d$1}g; # 5 print; # 6 END_SCRIPT close $ofh; unlink('/tmp/test.listing'); local $ENV{PERLDB_OPTS} = "NonStop AutoTrace LineInfo=/tmp/test.listin +g"; system($^X,'-Ilib','-d','/tmp/testdb.pl')==0 or die "\$?=$?"; my $o = do { open my $fh, '<', '/tmp/test.listing' or die $!; local $/ +; <$fh> }; my $x = $o =~ /^main::\([^)]+\.pl:5\):\s+{d\$1}g;\s+#\s+5\s*$/m; # goo +d my $y = $o =~ /^main::\([^)]+\.pl:6\):\s+print;\s+#\s+6\s*$/m; # goo +d my $z = $o =~ /^main::\([^)]+\.pl:5\):\s+print;\s+#\s+6\s*$/m; # bad if ( $x && $y && !$z ) { print "GOOD\n"; exit 0; } elsif ( !$x && !$y && $z ) { print "BAD\n"; exit 1; } else { print STDERR Dumper($o,$x,$y,$z); die "What?"; }