diff --git a/Doc/c-api/frame.rst b/Doc/c-api/frame.rst index fb17cf7f1da6b2..6f8b8ada1b168d 100644 --- a/Doc/c-api/frame.rst +++ b/Doc/c-api/frame.rst @@ -250,3 +250,60 @@ Unless using :pep:`523`, you will not need this. .. versionadded:: 3.12 +.. c:type:: PyUnstable_ExecutableKinds + + An array of executable kinds (executor types) for frames, used for internal + debugging and tracing. + + Tools like debuggers and profilers can use this to identify the type of execution + context associated with a frame (e.g. to filter out internal frames). + The entries are indexed by the following constants: + + .. list-table:: + :header-rows: 1 + :widths: auto + + * - Constant + - Description + * - :c:macro:`PyUnstable_EXECUTABLE_KIND_SKIP` + - The frame is internal (e.g. inlined) and should be skipped by tools. + * - :c:macro:`PyUnstable_EXECUTABLE_KIND_PY_FUNCTION` + - The frame corresponds to a standard Python function. + + .. versionadded:: 3.13 + + +.. c:macro:: PyUnstable_EXECUTABLE_KIND_SKIP + + Index for the "skip" kind in :c:data:`PyUnstable_ExecutableKinds`. + Indicates that the frame's code object should be skipped. + + .. versionadded:: 3.13 + + +.. c:macro:: PyUnstable_EXECUTABLE_KIND_PY_FUNCTION + + Index for the "Python function" kind in ``PyUnstable_ExecutableKinds``. + + .. versionadded:: 3.13 + + +.. c:macro:: PyUnstable_EXECUTABLE_KIND_BUILTIN_FUNCTION + + Index for the "built-in function" kind in ``PyUnstable_ExecutableKinds``. + + .. versionadded:: 3.13 + + +.. c:macro:: PyUnstable_EXECUTABLE_KIND_METHOD_DESCRIPTOR + + Index for the "method descriptor" kind in ``PyUnstable_ExecutableKinds``. + + .. versionadded:: 3.13 + + +.. c:macro:: PyUnstable_EXECUTABLE_KINDS + + The number of entries in ``PyUnstable_ExecutableKinds``. + + .. versionadded:: 3.13 diff --git a/Tools/check-c-api-docs/ignored_c_api.txt b/Tools/check-c-api-docs/ignored_c_api.txt index e81ffd51e193b2..88551e09418a9e 100644 --- a/Tools/check-c-api-docs/ignored_c_api.txt +++ b/Tools/check-c-api-docs/ignored_c_api.txt @@ -80,12 +80,6 @@ PyLong_MASK PyLong_SHIFT # cpython/pyerrors.h PyException_HEAD -# cpython/pyframe.h -PyUnstable_EXECUTABLE_KINDS -PyUnstable_EXECUTABLE_KIND_BUILTIN_FUNCTION -PyUnstable_EXECUTABLE_KIND_METHOD_DESCRIPTOR -PyUnstable_EXECUTABLE_KIND_PY_FUNCTION -PyUnstable_EXECUTABLE_KIND_SKIP # cpython/pylifecycle.h Py_FrozenMain # cpython/unicodeobject.h