pyframe.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef Py_CPYTHON_PYFRAME_H
  2. # error "this header file must not be included directly"
  3. #endif
  4. PyAPI_DATA(PyTypeObject) PyFrame_Type;
  5. #define PyFrame_Check(op) Py_IS_TYPE((op), &PyFrame_Type)
  6. PyAPI_FUNC(PyFrameObject *) PyFrame_GetBack(PyFrameObject *frame);
  7. PyAPI_FUNC(PyObject *) PyFrame_GetLocals(PyFrameObject *frame);
  8. PyAPI_FUNC(PyObject *) PyFrame_GetGlobals(PyFrameObject *frame);
  9. PyAPI_FUNC(PyObject *) PyFrame_GetBuiltins(PyFrameObject *frame);
  10. PyAPI_FUNC(PyObject *) PyFrame_GetGenerator(PyFrameObject *frame);
  11. PyAPI_FUNC(int) PyFrame_GetLasti(PyFrameObject *frame);
  12. PyAPI_FUNC(PyObject*) PyFrame_GetVar(PyFrameObject *frame, PyObject *name);
  13. PyAPI_FUNC(PyObject*) PyFrame_GetVarString(PyFrameObject *frame, const char *name);
  14. /* The following functions are for use by debuggers and other tools
  15. * implementing custom frame evaluators with PEP 523. */
  16. struct _PyInterpreterFrame;
  17. /* Returns the code object of the frame (strong reference).
  18. * Does not raise an exception. */
  19. PyAPI_FUNC(PyObject *) PyUnstable_InterpreterFrame_GetCode(struct _PyInterpreterFrame *frame);
  20. /* Returns a byte ofsset into the last executed instruction.
  21. * Does not raise an exception. */
  22. PyAPI_FUNC(int) PyUnstable_InterpreterFrame_GetLasti(struct _PyInterpreterFrame *frame);
  23. /* Returns the currently executing line number, or -1 if there is no line number.
  24. * Does not raise an exception. */
  25. PyAPI_FUNC(int) PyUnstable_InterpreterFrame_GetLine(struct _PyInterpreterFrame *frame);