summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2017-09-08 00:14:16 (GMT)
committerGitHub <noreply@github.com>2017-09-08 00:14:16 (GMT)
commit5a8516701f5140c8c989c40e261a4f4e20e8af86 (patch)
treece7c8c4d443132b27203a834904469458191a154 /Objects
parent2eb0cb4787d02d995a9bb6dc075983792c12835c (diff)
downloadcpython-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 'Objects')
-rw-r--r--Objects/frameobject.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Objects/frameobject.c b/Objects/frameobject.c
index 8448319..b3f0b65 100644
--- a/Objects/frameobject.c
+++ b/Objects/frameobject.c
@@ -15,6 +15,8 @@ static PyMemberDef frame_memberlist[] = {
{"f_builtins", T_OBJECT, OFF(f_builtins), READONLY},
{"f_globals", T_OBJECT, OFF(f_globals), READONLY},
{"f_lasti", T_INT, OFF(f_lasti), READONLY},
+ {"f_trace_lines", T_BOOL, OFF(f_trace_lines), 0},
+ {"f_trace_opcodes", T_BOOL, OFF(f_trace_opcodes), 0},
{NULL} /* Sentinel */
};
@@ -728,6 +730,8 @@ _PyFrame_New_NoTrack(PyThreadState *tstate, PyCodeObject *code,
f->f_iblock = 0;
f->f_executing = 0;
f->f_gen = NULL;
+ f->f_trace_opcodes = 0;
+ f->f_trace_lines = 1;
return f;
}