pombreda / unladen-swallow

Automatically exported from code.google.com/p/unladen-swallow
Other
0 stars 0 forks source link

f_lasti is probably broken #20

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
We have altered the definition of f_lasti: pray we don't alter it any
further; but regardless, we should make it work again for pdb.

Original issue reported on code.google.com by jyass...@gmail.com on 22 Apr 2009 at 3:26

GoogleCodeExporter commented 9 years ago

Original comment by collinw on 29 May 2009 at 4:02

GoogleCodeExporter commented 9 years ago
This may need to be done sooner than merger-time, but I'm putting it there for 
starters.

Original comment by collinw on 29 May 2009 at 4:14

GoogleCodeExporter commented 9 years ago
Is there a new variable that does f_lasti's job now? The relevant snippet is 
taken
from Include/frameobject.h

@@ -37,15 +38,55 @@ typedef struct _frame {
     PyObject *f_exc_type, *f_exc_value, *f_exc_traceback;

     PyThreadState *f_tstate;
-    int f_lasti;               /* Last instruction if called */
-    /* As of 2.3 f_lineno is only valid when tracing is active (i.e. when
-       f_trace is set) -- at other times use PyCode_Addr2Line instead. */
+    /* When running through the bytecode interpreter, f_lasti records
+       the index of the most recent instruction to start executing.
+       It's used to resume generators, to let tracers change the
+       current line number, and to look up the current line number
+       through co_lnotab (See PyCode_Addr2Line).  Under LLVM, f_lasti
+       is a negative number used to index basic blocks that we might
+       want to resume from (for generators and line changes within
+       tracing functions).  When f_lasti is negative (and hence
+       meaningless), f_lineno is correct.  f_lasti is initialized to
+       -1 when a function is first entered. */
+    int f_lasti;

Original comment by Artag...@gmail.com on 29 Sep 2009 at 7:36