diff options
author | Jeffrey Yasskin <jyasskin@gmail.com> | 2009-05-23 23:23:01 (GMT) |
---|---|---|
committer | Jeffrey Yasskin <jyasskin@gmail.com> | 2009-05-23 23:23:01 (GMT) |
commit | 655d835415800085cddbacecfc8a22111d70a5ef (patch) | |
tree | 313b44ddc5a8af0d3c1ec29cc2b1fb35b4b118c3 /Doc | |
parent | 3724d6c3923f45f4c284e1b3d44a60c3090017d1 (diff) | |
download | cpython-655d835415800085cddbacecfc8a22111d70a5ef.zip cpython-655d835415800085cddbacecfc8a22111d70a5ef.tar.gz cpython-655d835415800085cddbacecfc8a22111d70a5ef.tar.bz2 |
Issue #6042:
lnotab-based tracing is very complicated and isn't documented very well. There
were at least 3 comment blocks purporting to document co_lnotab, and none did a
very good job. This patch unifies them into Objects/lnotab_notes.txt which
tries to completely capture the current state of affairs.
I also discovered that we've attached 2 layers of patches to the basic tracing
scheme. The first layer avoids jumping to instructions that don't start a line,
to avoid problems in if statements and while loops. The second layer
discovered that jumps backward do need to trace at instructions that don't
start a line, so it added extra lnotab entries for 'while' and 'for' loops, and
added a special case for backward jumps within the same line. I replaced these
patches by just treating forward and backward jumps differently.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/sys.rst | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index 6d02109..8616d5d 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -798,9 +798,11 @@ always available. specifies the local trace function. ``'line'`` - The interpreter is about to execute a new line of code (sometimes multiple - line events on one line exist). The local trace function is called; *arg* - is ``None``; the return value specifies the new local trace function. + The interpreter is about to execute a new line of code or re-execute the + condition of a loop. The local trace function is called; *arg* is + ``None``; the return value specifies the new local trace function. See + :file:`Objects/lnotab_notes.txt` for a detailed explanation of how this + works. ``'return'`` A function (or other code block) is about to return. The local trace |