summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2023-05-12 11:21:20 (GMT)
committerGitHub <noreply@github.com>2023-05-12 11:21:20 (GMT)
commit45f5aa8fc73acf516071d52ef8213532f0381316 (patch)
treebc1f7219305185a7befef7003688d7a4359f98e4 /Objects
parent19ee53d52e8adf267dfd588c2142967734a3b65a (diff)
downloadcpython-45f5aa8fc73acf516071d52ef8213532f0381316.zip
cpython-45f5aa8fc73acf516071d52ef8213532f0381316.tar.gz
cpython-45f5aa8fc73acf516071d52ef8213532f0381316.tar.bz2
GH-103082: Filter LINE events in VM, to simplify tool implementation. (GH-104387)
When monitoring LINE events, instrument all instructions that can have a predecessor on a different line. Then check that the a new line has been hit in the instrumentation code. This brings the behavior closer to that of 3.11, simplifying implementation and porting of tools.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/frameobject.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/Objects/frameobject.c b/Objects/frameobject.c
index d9aaea7..2c90a6b 100644
--- a/Objects/frameobject.c
+++ b/Objects/frameobject.c
@@ -831,7 +831,6 @@ frame_setlineno(PyFrameObject *f, PyObject* p_new_lineno, void *Py_UNUSED(ignore
start_stack = pop_value(start_stack);
}
/* Finally set the new lasti and return OK. */
- f->f_last_traced_line = new_lineno;
f->f_lineno = 0;
f->f_frame->prev_instr = _PyCode_CODE(f->f_frame->f_code) + best_addr;
return 0;
@@ -854,7 +853,6 @@ frame_settrace(PyFrameObject *f, PyObject* v, void *closure)
}
if (v != f->f_trace) {
Py_XSETREF(f->f_trace, Py_XNewRef(v));
- f->f_last_traced_line = -1;
}
return 0;
}
@@ -1056,7 +1054,6 @@ _PyFrame_New_NoTrack(PyCodeObject *code)
f->f_trace_opcodes = 0;
f->f_fast_as_locals = 0;
f->f_lineno = 0;
- f->f_last_traced_line = -1;
return f;
}