This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl-5.11.2 breaks NYTProf savesrc option (Lexer API suspected)
authorZefram <zefram@fysh.org>
Wed, 25 Nov 2009 22:17:52 +0000 (22:17 +0000)
committerJesse Vincent <jesse@bestpractical.com>
Wed, 25 Nov 2009 22:48:05 +0000 (17:48 -0500)
commit17cc9359ea8ee1b546aa067b91362160e3c1e1ee
tree6b56341d1a17cd4f21c87a5693358e1e46835ab1
parent5f61da697ab4e86d3bede8883257b28d30c701ad
perl-5.11.2 breaks NYTProf savesrc option (Lexer API suspected)

Tim Bunce wrote:
>The primary issue is the off-by-one error in the array indexing.

There's a bit more to it than that.  The indexing was off-by-one for
*some* places that process a new line, but correct for others, so the
saved source as a whole was mangled rather than simply offset.  Also,
there were some redundant calls to update_debugger_info(), so some lines
got saved twice, in some cases off-by-one for one saving and not for
the other.  The saved source is, therefore, hopelessly broken in 5.11.2.

Attached patch fixes the source saving.  Includes a new test, which works
through all reachable places that source lines get saved.  This should
close RT #70804.

-zefram
MANIFEST
t/comp/line_debug.t [new file with mode: 0644]
t/comp/line_debug_0.aux [new file with mode: 0644]
toke.c