diff options
Diffstat (limited to 'Include/frameobject.h')
-rw-r--r-- | Include/frameobject.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Include/frameobject.h b/Include/frameobject.h index 65ebd2a..1fb64bb 100644 --- a/Include/frameobject.h +++ b/Include/frameobject.h @@ -1,6 +1,7 @@ /* Frame object interface */ +#ifndef Py_LIMITED_API #ifndef Py_FRAMEOBJECT_H #define Py_FRAMEOBJECT_H #ifdef __cplusplus @@ -38,8 +39,11 @@ typedef struct _frame { 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. */ + /* Call PyFrame_GetLineNumber() instead of reading this field + directly. As of 2.3 f_lineno is only valid when tracing is + active (i.e. when f_trace is set). At other times we use + PyCode_Addr2Line to calculate the line from the current + bytecode index. */ int f_lineno; /* Current line number */ int f_iblock; /* index in f_blockstack */ PyTryBlock f_blockstack[CO_MAXBLOCKS]; /* for try and loop blocks */ @@ -75,7 +79,11 @@ PyAPI_FUNC(void) PyFrame_FastToLocals(PyFrameObject *); PyAPI_FUNC(int) PyFrame_ClearFreeList(void); +/* Return the line of code the frame is currently executing. */ +PyAPI_FUNC(int) PyFrame_GetLineNumber(PyFrameObject *); + #ifdef __cplusplus } #endif #endif /* !Py_FRAMEOBJECT_H */ +#endif /* Py_LIMITED_API */ |