[New-bugs-announce] [issue6042] Document and slightly simplify lnotab tracing

Jeffrey Yasskin report at bugs.python.org
Sat May 16 22:17:02 CEST 2009

New submission from Jeffrey Yasskin <jyasskin at gmail.com>:

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'm posting this here so that people can check that I
got it right. Thanks!

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 treating forward and
backward jumps differently.

I could simplify this slightly more by changing PyCode_CheckLineNumber.
 It doesn't appear to be used outside of the core, but since it doesn't
start with an _, I want to double-check that changing its interface is ok.

components: Interpreter Core
files: lnotab.patch
keywords: needs review, patch
messages: 87919
nosy: jyasskin
severity: normal
stage: patch review
status: open
title: Document and slightly simplify lnotab tracing
versions: Python 2.7, Python 3.2
Added file: http://bugs.python.org/file13996/lnotab.patch

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list