]> granicus.if.org Git - python/commit
Issue #6042:
authorJeffrey Yasskin <jyasskin@gmail.com>
Sat, 23 May 2009 23:23:01 +0000 (23:23 +0000)
committerJeffrey Yasskin <jyasskin@gmail.com>
Sat, 23 May 2009 23:23:01 +0000 (23:23 +0000)
commit655d835415800085cddbacecfc8a22111d70a5ef
tree313b44ddc5a8af0d3c1ec29cc2b1fb35b4b118c3
parent3724d6c3923f45f4c284e1b3d44a60c3090017d1
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.
Doc/library/sys.rst
Include/code.h
Objects/codeobject.c
Objects/lnotab_notes.txt [new file with mode: 0644]
Python/ceval.c
Python/compile.c