diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2017-09-08 00:14:16 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-08 00:14:16 (GMT) |
commit | 5a8516701f5140c8c989c40e261a4f4e20e8af86 (patch) | |
tree | ce7c8c4d443132b27203a834904469458191a154 /Include/pystate.h | |
parent | 2eb0cb4787d02d995a9bb6dc075983792c12835c (diff) | |
download | cpython-5a8516701f5140c8c989c40e261a4f4e20e8af86.zip cpython-5a8516701f5140c8c989c40e261a4f4e20e8af86.tar.gz cpython-5a8516701f5140c8c989c40e261a4f4e20e8af86.tar.bz2 |
bpo-31344: Per-frame control of trace events (GH-3417)
f_trace_lines: enable/disable line trace events
f_trace_opcodes: enable/disable opcode trace events
These are intended primarily for testing of the interpreter
itself, as they make it much easier to emulate signals
arriving at unfortunate times.
Diffstat (limited to 'Include/pystate.h')
-rw-r--r-- | Include/pystate.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Include/pystate.h b/Include/pystate.h index 6229236..f957d53 100644 --- a/Include/pystate.h +++ b/Include/pystate.h @@ -92,7 +92,11 @@ typedef struct _is { /* Py_tracefunc return -1 when raising an exception, or 0 for success. */ typedef int (*Py_tracefunc)(PyObject *, struct _frame *, int, PyObject *); -/* The following values are used for 'what' for tracefunc functions: */ +/* The following values are used for 'what' for tracefunc functions + * + * To add a new kind of trace event, also update "trace_init" in + * Python/sysmodule.c to define the Python level event name + */ #define PyTrace_CALL 0 #define PyTrace_EXCEPTION 1 #define PyTrace_LINE 2 @@ -100,6 +104,7 @@ typedef int (*Py_tracefunc)(PyObject *, struct _frame *, int, PyObject *); #define PyTrace_C_CALL 4 #define PyTrace_C_EXCEPTION 5 #define PyTrace_C_RETURN 6 +#define PyTrace_OPCODE 7 #endif #ifdef Py_LIMITED_API |