From: Gurusamy Sarathy Date: Sun, 28 May 2000 05:03:53 +0000 (+0000) Subject: clarify gotcha with #line directives (from Rocco Caputo X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=003183f2462c206a39eddd45957c1a29fc593c37;p=p5sagit%2Fp5-mst-13.2.git clarify gotcha with #line directives (from Rocco Caputo ) p4raw-id: //depot/perl@6123 --- diff --git a/pod/perldebug.pod b/pod/perldebug.pod index c8ef60f..bccdcf4 100644 --- a/pod/perldebug.pod +++ b/pod/perldebug.pod @@ -767,6 +767,11 @@ Breakable lines are marked with C<:>. Lines with breakpoints are marked by C and those with actions by C. The line that's about to be executed is marked by C<< ==> >>. +Please be aware that code in debugger listings may not look the same +as your original source code. Line directives and external source +filters can alter the code before Perl sees it, causing code to move +from its original positions or take on entirely different forms. + =item Frame listing When the C option is set, the debugger would print entered (and diff --git a/pod/perlsyn.pod b/pod/perlsyn.pod index dfded2e..a65b4cd 100644 --- a/pod/perlsyn.pod +++ b/pod/perlsyn.pod @@ -598,6 +598,11 @@ C with C<$1> being the line number for the next line, and C<$2> being the optional filename (specified within quotes). +There is a fairly obvious gotcha included with the line directive: +Debuggers and profilers will only show the last source line to appear +at a particular line number in a given file. Care should be taken not +to cause line number collisions in code you'd like to debug later. + Here are some examples that you should be able to type into your command shell: