annotate Python/getversion.c @ 54297:dddf424bd669 legacy-trunk

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.
author Jeffrey Yasskin <jyasskin@gmail.com>
date Sat, 23 May 2009 23:23:01 +0000
parents 379fc66f4c96
children 9f2fbee420da
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3621
f158edccc72c grand renaming; added copyright to some files
Guido van Rossum <guido@python.org>
parents: 3212
diff changeset
1
2896
f0d9f800a4aa Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
2 /* Return the full version string. */
f0d9f800a4aa Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
3
3101
237c3b2a6187 include Python.h
Guido van Rossum <guido@python.org>
parents: 2896
diff changeset
4 #include "Python.h"
237c3b2a6187 include Python.h
Guido van Rossum <guido@python.org>
parents: 2896
diff changeset
5
2896
f0d9f800a4aa Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
6 #include "patchlevel.h"
f0d9f800a4aa Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
7
f0d9f800a4aa Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
8 const char *
13658
f79434ee41fa Mass ANSIfication of function definitions. Doesn't cover all 'extern'
Thomas Wouters <thomas@python.org>
parents: 13256
diff changeset
9 Py_GetVersion(void)
2896
f0d9f800a4aa Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
10 {
10668
8c6ffe670963 Allow longer strings (up to 80 chars each) for version, build,
Guido van Rossum <guido@python.org>
parents: 9970
diff changeset
11 static char version[250];
21077
379fc66f4c96 Use PyOS_snprintf instead of sprintf.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 14375
diff changeset
12 PyOS_snprintf(version, sizeof(version), "%.80s (%.80s) %.80s",
379fc66f4c96 Use PyOS_snprintf instead of sprintf.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 14375
diff changeset
13 PY_VERSION, Py_GetBuildInfo(), Py_GetCompiler());
2896
f0d9f800a4aa Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
14 return version;
f0d9f800a4aa Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
15 }