#include "Python.h"
#include "pycore_audit.h"
#include "pycore_ceval.h"
#include "pycore_object.h"
#include "opcode.h"
#include <stddef.h>
_PyLegacyEventHandler;
#ifdef Py_GIL_DISABLED
#define LOCK_SETUP …
#define UNLOCK_SETUP …
#else
#define LOCK_SETUP() …
#define UNLOCK_SETUP() …
#endif
static PyObject *
call_profile_func(_PyLegacyEventHandler *self, PyObject *arg)
{ … }
static PyObject *
sys_profile_start(
_PyLegacyEventHandler *self, PyObject *const *args,
size_t nargsf, PyObject *kwnames
) { … }
static PyObject *
sys_profile_throw(
_PyLegacyEventHandler *self, PyObject *const *args,
size_t nargsf, PyObject *kwnames
) { … }
static PyObject *
sys_profile_return(
_PyLegacyEventHandler *self, PyObject *const *args,
size_t nargsf, PyObject *kwnames
) { … }
static PyObject *
sys_profile_unwind(
_PyLegacyEventHandler *self, PyObject *const *args,
size_t nargsf, PyObject *kwnames
) { … }
static PyObject *
sys_profile_call_or_return(
_PyLegacyEventHandler *self, PyObject *const *args,
size_t nargsf, PyObject *kwnames
) { … }
int
_PyEval_SetOpcodeTrace(
PyFrameObject *frame,
bool enable
) { … }
static PyObject *
call_trace_func(_PyLegacyEventHandler *self, PyObject *arg)
{ … }
static PyObject *
sys_trace_exception_func(
_PyLegacyEventHandler *self, PyObject *const *args,
size_t nargsf, PyObject *kwnames
) { … }
static PyObject *
sys_trace_start(
_PyLegacyEventHandler *self, PyObject *const *args,
size_t nargsf, PyObject *kwnames
) { … }
static PyObject *
sys_trace_throw(
_PyLegacyEventHandler *self, PyObject *const *args,
size_t nargsf, PyObject *kwnames
) { … }
static PyObject *
sys_trace_unwind(
_PyLegacyEventHandler *self, PyObject *const *args,
size_t nargsf, PyObject *kwnames
) { … }
static PyObject *
sys_trace_return(
_PyLegacyEventHandler *self, PyObject *const *args,
size_t nargsf, PyObject *kwnames
) { … }
static PyObject *
sys_trace_yield(
_PyLegacyEventHandler *self, PyObject *const *args,
size_t nargsf, PyObject *kwnames
) { … }
static PyObject *
sys_trace_instruction_func(
_PyLegacyEventHandler *self, PyObject *const *args,
size_t nargsf, PyObject *kwnames
) { … }
static PyObject *
trace_line(
PyThreadState *tstate, _PyLegacyEventHandler *self,
PyFrameObject *frame, int line
) { … }
static PyObject *
sys_trace_line_func(
_PyLegacyEventHandler *self, PyObject *const *args,
size_t nargsf, PyObject *kwnames
) { … }
static PyObject *
sys_trace_jump_func(
_PyLegacyEventHandler *self, PyObject *const *args,
size_t nargsf, PyObject *kwnames
) { … }
PyTypeObject _PyLegacyEventHandler_Type = …;
static int
set_callbacks(int tool, vectorcallfunc vectorcall, int legacy_event, int event1, int event2)
{ … }
#ifndef NDEBUG
static int
is_tstate_valid(PyThreadState *tstate)
{
assert(!_PyMem_IsPtrFreed(tstate));
assert(!_PyMem_IsPtrFreed(tstate->interp));
return 1;
}
#endif
static Py_ssize_t
setup_profile(PyThreadState *tstate, Py_tracefunc func, PyObject *arg, PyObject **old_profileobj)
{ … }
int
_PyEval_SetProfile(PyThreadState *tstate, Py_tracefunc func, PyObject *arg)
{ … }
static Py_ssize_t
setup_tracing(PyThreadState *tstate, Py_tracefunc func, PyObject *arg, PyObject **old_traceobj)
{ … }
int
_PyEval_SetTrace(PyThreadState *tstate, Py_tracefunc func, PyObject *arg)
{ … }