lzipin has asked for the wisdom of the Perl Monks concerning the following question:
O monks, I've found anomalous behavior with the Perl debugger, and I'd like a sanity check.
Here's a simple script that demonstrates the issue — at least on my laptop with a recent Xubuntu, Perl 5.26.1 and perl5db.pl v 1.51 (my Win7 machine with Strawberry Perl 5.28.2 doesn't have this problem). The script does a global regex replace on its first arg (word).
#!/bin/perl -w use strict; $_ = shift // ''; # line 3 s{a([bc])} # 4 {d$1}g; # 5 print; # 6
Open this in the debugger, l(ist) the script, and the 'print;' line is tagged line 5, not 6. The debugger doesn't find the script's line 5 ... although the script runs fine (e.g., the single arg 'abacadbd' yields 'dbdcadbd'). The debugger applies the commands 'c 5' and 'b 5' to the 'print;' line.
With one or more multiline replace statements in the middle of a sizable script, this gets aggravating. Further, it's a tough problem to Google — a possible bug in the debugger, etc.
Any resonance from No-Mind?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Debugger line numbering anomaly
by haukex (Bishop) on Dec 25, 2019 at 20:41 UTC | |
by LanX (Sage) on Dec 25, 2019 at 21:02 UTC | |
Re: Debugger line numbering anomaly
by LanX (Sage) on Dec 24, 2019 at 10:24 UTC | |
by lzipin (Acolyte) on Dec 24, 2019 at 19:22 UTC | |
by LanX (Sage) on Dec 24, 2019 at 20:03 UTC | |
by lzipin (Acolyte) on Dec 24, 2019 at 23:01 UTC | |
by LanX (Sage) on Dec 25, 2019 at 00:26 UTC | |
| |
Re: Debugger line numbering anomaly
by lzipin (Acolyte) on Dec 26, 2019 at 00:07 UTC | |
by haukex (Bishop) on Dec 26, 2019 at 07:55 UTC | |
Re: Debugger line numbering anomaly
by BillKSmith (Monsignor) on Dec 24, 2019 at 16:57 UTC | |
by LanX (Sage) on Dec 24, 2019 at 18:09 UTC | |
Re: Debugger line numbering anomaly ( line number wrong mismatch )
by Anonymous Monk on Dec 24, 2019 at 02:35 UTC |