Bug #1191458: tracing over for loops now produces a line event

on each iteration.  I'm not positive this is the best way to handle
this.  I'm also not sure that there aren't other cases where
the lnotab is generated incorrectly.  It would be great if people
that use pdb or tracing could test heavily.

Also:
 * Remove dead/duplicated code that wasn't used/necessary
   because we already handled the docstring prior to entering the loop.
 * add some debugging code into the compiler (#if 0'd out).
This commit is contained in:
Neal Norwitz 2006-08-04 04:58:47 +00:00
parent ff4b63b80f
commit 4ffedadb10
4 changed files with 56 additions and 11 deletions

View file

@ -62,9 +62,10 @@ extern time_t PyOS_GetLastModificationTime(char *, FILE *);
Python 2.5a0: 62092 (changed WITH_CLEANUP opcode)
Python 2.5b3: 62101 (fix wrong code: for x, in ...)
Python 2.5b3: 62111 (fix wrong code: x += yield)
Python 2.5c1: 62121 (fix wrong lnotab with for loops)
.
*/
#define MAGIC (62111 | ((long)'\r'<<16) | ((long)'\n'<<24))
#define MAGIC (62121 | ((long)'\r'<<16) | ((long)'\n'<<24))
/* Magic word as global; note that _PyImport_Init() can change the
value of this global to accommodate for alterations of how the